EXT4 Bit by Bit (PDFDrive)
EXT4 Bit by Bit (PDFDrive)
Hal Pomeranz
Deer Run Associates
What’s New in EXT4?
• 48-bit address space
• Uses extents instead of indirect block chains
• 64-bit nanosecond resolution timestamps
• File creation time timestamp
Backwards Compatibility
• Backwards compatibility was a design goal
• Inodes expanded to 256 bytes:
– Much of the first 128 bytes unchanged from EXT[23]…
– … except that block pointers replaced by extents
– Extended timestamps, etc in upper 128 bytes
Let’s Make a File!
# echo Time for knowledge >testfile
# touch -a -t 211101231917.42 testfile No fractional
seconds!
# touch -m -t 204005160308.19 testfile
Seconds
Mtime Atime Ctime
“Extra”
“Extra”
Seconds Creation Time (Btime)
“Extra” – Not Just Nanoseconds!
Atime “extra”
000000000000000000000000000000 01
0x00000001
Atime seconds
01 00001001010101001011000101010110 0x0954B156
Extent Header (Bytes 40-51)
Depth of
Tree
Logical Block
Offset Length in Phys Start Addr Phys Start Addr
Blocks (upper 16 bits) (lower 32 bits)
[CMD]time set to
Atime unaltered
time file deleted
Btime unaltered
Post-Deletion Extent Structs
File size, Num Extents,
and Depth of Tree zeroed
• Extents
– Data block address in extent index(es) [if any]
– Unused extent structs in inode [if any]
– Logical block offsets in extent structs
[allows extent sizes to be inferred in some cases]
Wrapping Up
• Any final questions?
• Thanks for listening!