File System

最後更新: 2021-02-10

目錄

  • GPT(GUID Partition Table)
  • Write barriers
  • Extents
  • B+Tree

 


GPT(GUID Partition Table)

 

單一分區大小 > 2TB

分區數量 > 4 primary partitions

+ partition table is redundant

 


Write barriers

 

Write barriers mean the kernel guarantees that it will complete certain disk writes before the "barrier" disk write,

to ensure that filesystems and RAID can recover in the event of a sudden power loss or crash.

 


Extents

 

With extents, a part of contiguous blocks after a file can be "reserved" for when the file grows.

Not all files may grow and the reserved space may be required for use by other files.

With inodes, the metadata section contained direct and indirect block pointers.

These pointers were the hard disk addresses. Extents are another list which is pointed to by the inode block and lists contiguous blocks that make up the file.

For example, suppose a file takes up 5 contiguous blocks and then another 3 contiguous blocks at another section.

The inode pointer will point to the extents list which contains two entries. The first entry is the address of the first 5 blocks and specifies that 5 blocks are used.

The second entry is the address of the second 3 contiguous blocks and specifies there three blocks in the set.

A third entry in the extent list is an offset. If a file physically starts in extent 10, but more precisely in the third block, then the offset is 3. Extents are a set number of blocks.

If one file ends at the second block of extent 10, then the next file would start at block 3, making its offset 3 in extent 10.

 


B+Tree

 

Each node contains a key and pointer. The key is the search item, such as a file name.

The data pointer for the key points to the actual data.

P0   P1  P2  P3  P4
  K1   K2  K3  K4
  V1   V2  V3  V4

If the search item we are looking for is less than Key-1, Pointer-0 is followed.

If the search item is greater than or equal to Key-1 and less than Key-2, we follow Pointer-1.

perform the same task and so on until we reach a leaf which contains the search value

Doc

http://www.linux.org/threads/trees-b-trees-b-trees-and-h-trees.4278/

https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Storage_Administration_Guide/xfsquota.html

 


 

Creative Commons license icon Creative Commons license icon