当前位置:网站首页>Ext file system mechanism principle
Ext file system mechanism principle
2022-07-03 11:10:00 【MrPeng1991】
https://blog.csdn.net/li_wen01/article/details/105313344
There are many types of file systems ,ext234,windows On NTFS, The CD-ROM file system iso9660,MAC Hybrid file systems HFS, Network file system NFS,Oracle R & D btrfs, Old fashioned FAT/FAT32 etc. .
1 The components of the file system
block appear
Read and write at the bottom of the hard disk io One sector at a time , If you want to read and write a lot of files , It must be slow in sectors , Consumption performance , So hard drives use a concept called logical blocks . Logical blocks are logical , The disk drive is responsible for maintenance and operation , It is not physically partitioned like a sector , The size of a logical block may contain one or more sectors , Each logical block has a unique address , be called LBA Logic Block Address. With logical blocks , The disk controller operates on data in logical blocks , Read and write one logic block at a time , The disk controller knows how to translate logical blocks into corresponding sectors and read and write data .
here we are Linux Operating system hierarchy , A read / write unit, also known as a block, is provided through the file system , The size of the file system data block is generally 1024bytes,1k,2048bytes 2k, or 4096bytes 4k, File system data block is also a logical concept , File system level maintenance , The logical data block of the disk is maintained by the disk controller , File system io The manager knows how to translate its data block into the address of the data block maintained by the disk LBA. For those who use the file system io In terms of operation , For example, reading and writing documents , these io The basic unit of is the data block on the file system , Read and write one file system block at a time . For example, when you need to read one or more blocks , File system io The manager first calculates which disk data blocks these file system blocks correspond to , That is to calculate LBA, Then tell the disk controller which blocks to read , The disk controller translates these blocks into sector addresses , Then read the data from the sector , Then, these sector data are reorganized and written into memory through the hard disk controller .
This article is about file system , Naturally, the focus is on the file system rather than the disk , So what will happen later block Both mean to add the data block of your system , instead of , Logical blocks maintained by disk .
file system block The appearance of makes the reading and writing performance on the file system level greatly improved , And a lot less debris . But its side effect is that it can waste space . Because the file system uses block It's a read-write unit , Even if only 1k size , Will also occupy one block, The rest of the space is completely wasted . Under some business requirements, a large number of small files may be stored , This time a lot of space is wasted .
Despite its shortcomings , But the advantages are obvious enough , Nowadays, hard drives are cheap and performance oriented , Use block It must be .
bmap
边栏推荐
猜你喜欢
![[proteus simulation] 16 channel water lamp composed of 74hc154 four wire to 12 wire decoder](/img/1f/729594930c7c97d3e731987f4c3645.png)
[proteus simulation] 16 channel water lamp composed of 74hc154 four wire to 12 wire decoder

11. Provider service registration of Nacos service registration source code analysis

嵌入式软件测试怎么实现自动化测试?

QT: QSS custom qtreeview instance

我对测试工作的一些认识(资深测试人员总结)

How to realize automatic testing in embedded software testing?

嵌入式軟件測試怎麼實現自動化測試?

The highest monthly salary of 18K has a good "mentality and choice", and success is poor "seriousness and persistence"~

Cause: org. apache. ibatis. builder. Builderexception: error parsing SQL mapper configuration problem analysis

【蓝桥杯选拔赛真题44】Scratch消灭骷髅军团 少儿编程scratch蓝桥杯选拔赛真题讲解
随机推荐
使用onvif协议操作设备
Software testing e-commerce projects that can be written into your resume, don't you come in and get it?
Qt:qss custom qlineedit instance
php服务器 与redis交互大量CLOSE_WAIT分析
软件测试(测试用例)编写之俗手、本手、妙手
栈,单调栈,队列,单调队列
Qt:qss custom qheaderview instance
硬 货 | 一改测试步骤代码就全写?为什么不试试用 Yaml实现数据驱动?
【蓝桥杯选拔赛真题44】Scratch消灭骷髅军团 少儿编程scratch蓝桥杯选拔赛真题讲解
嵌入式软件测试怎么实现自动化测试?
one hot 独热码
公司测试部门来了个00后卷王之王,老油条感叹真干不过,但是...
Word line and bit line
有些能力,是工作中学不来的,看看这篇超过90%同行
Is it OK to test the zero basis software?
【Proteus仿真】74HC154 四线转12线译码器组成的16路流水灯
Differences among norm, normalize and normalized in eigen
QT: QSS custom qtableview instance
数据库增量备份 - DB INCR DB FULL
使用ML.NET+ONNX预训练模型整活B站经典《华强买瓜》