Ext4: Difference between revisions

Jump to navigation Jump to search
1,840 bytes added ,  3 years ago
Add Multiple Mount Protection description.
[unchecked revision][unchecked revision]
(Add explanation.)
(Add Multiple Mount Protection description.)
Line 2:
{{Filesystems}}
While the ext4 filesystem originated a series of patches to the [[ext3]] filesystem, it was later rebranded as a dedicated filesystem design that shares design with [[ext2]] and [[ext3]]. Like ext3, it supports [[journaling]]. Amongst the upgrades are larger maximums (file size, filesystem size, files per folder, folders per folder etc), and features that were inspired from existing filesystems like [[XFS]].
 
== Basic Concepts ==
{{Stub}}
 
== Superblock ==
 
Line 427 ⟶ 431:
| 0x0004 || Block groups's inode table is zeroed.
|}
 
== Multiple Mount Protection ==
 
Multiple Mount Protection (MMP) protects filesystems being mounted multiple times leading to dangerous data races. This feature writes a sequence number into the block referenced in the MMP block superblock field.
 
To check for MMP, check the required feature flag Multiple Mount Protection, and the magic field in the block referenced by the MMP block superblock field.
 
In MMP, the driver checks the sequence number in the MMP block . If the sequence number is fs check running or any unknown code above maximum MMP value, the drive is not safe to mount, even if the timestamp is outdated.
 
While running, the driver checks the MMP block sequence number at the interval specified in the MMP check superblock field. If this does not match the in-memory sequence number, a different host has mounted the filesystem, requiring the driver to remount as readonly. If it does match, the driver increments the number in memory and on disk. The driver also writes the hostname and mount path in the MMP block on open() success.
 
The minimum interval to MMP check is 5 seconds and the maximum interval is 300.
 
=== MMP structure ===
 
{| {{wikitable}}
! Starting
Byte
! Ending
Byte
! Size
in Bytes
! Description
|-
| 0 || 3 || 4 || MMP signature (0x004d4d50)
|-
| 4 || 7 || 4 || Sequence Number ([[#MMP_Sequences|see below]])
|-
| 8 || 15 || 8 || Last updated time (does not affect algorithm)
|-
| 16 || 79 || 64 || Hostname of system that open() the filesystem (does not affect algorithm)
|-
| 80 || 111 || 32 || Mount path of system that open() the filesystem (does not affect algorithm)
|-
| 112 || 113 || 2 || Interval to check MMP block
|-
| 114 || 115 || 2 || Padding.
|-
| 116 || 1019 || 904 || Padding.
|-
| 1020 || 1023 || 4 || Checksum (crc32c(UUID+MMP Block number))
|}
 
 
==See Also==
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.

Navigation menu