832 lines
23 KiB
ReStructuredText
Raw Normal View History

2026-01-21 18:59:54 +08:00
.. SPDX-License-Identifier: GPL-2.0
Super Block
-----------
The superblock records various information about the enclosing
filesystem, such as block counts, inode counts, supported features,
maintenance information, and more.
2026-01-29 22:25:33 +08:00
If the sparse_super feature flag is set, redundant copies of the
2026-01-21 18:59:54 +08:00
superblock and group descriptors are kept only in the groups whose group
number is either 0 or a power of 3, 5, or 7. If the flag is not set,
redundant copies are kept in all groups.
The superblock checksum is calculated against the superblock structure,
which includes the FS UUID.
The ext4 superblock is laid out as follows in
``struct ext4_super_block``:
.. list-table::
:widths: 8 8 24 40
:header-rows: 1
* - Offset
- Size
- Name
- Description
* - 0x0
2026-01-29 22:25:33 +08:00
- __le32
- s_inodes_count
2026-01-21 18:59:54 +08:00
- Total inode count.
* - 0x4
2026-01-29 22:25:33 +08:00
- __le32
- s_blocks_count_lo
2026-01-21 18:59:54 +08:00
- Total block count.
* - 0x8
2026-01-29 22:25:33 +08:00
- __le32
- s_r_blocks_count_lo
2026-01-21 18:59:54 +08:00
- This number of blocks can only be allocated by the super-user.
* - 0xC
2026-01-29 22:25:33 +08:00
- __le32
- s_free_blocks_count_lo
2026-01-21 18:59:54 +08:00
- Free block count.
* - 0x10
2026-01-29 22:25:33 +08:00
- __le32
- s_free_inodes_count
2026-01-21 18:59:54 +08:00
- Free inode count.
* - 0x14
2026-01-29 22:25:33 +08:00
- __le32
- s_first_data_block
2026-01-21 18:59:54 +08:00
- First data block. This must be at least 1 for 1k-block filesystems and
is typically 0 for all other block sizes.
* - 0x18
2026-01-29 22:25:33 +08:00
- __le32
- s_log_block_size
- Block size is 2 ^ (10 + s_log_block_size).
2026-01-21 18:59:54 +08:00
* - 0x1C
2026-01-29 22:25:33 +08:00
- __le32
- s_log_cluster_size
- Cluster size is 2 ^ (10 + s_log_cluster_size) blocks if bigalloc is
enabled. Otherwise s_log_cluster_size must equal s_log_block_size.
2026-01-21 18:59:54 +08:00
* - 0x20
2026-01-29 22:25:33 +08:00
- __le32
- s_blocks_per_group
2026-01-21 18:59:54 +08:00
- Blocks per group.
* - 0x24
2026-01-29 22:25:33 +08:00
- __le32
- s_clusters_per_group
2026-01-21 18:59:54 +08:00
- Clusters per group, if bigalloc is enabled. Otherwise
2026-01-29 22:25:33 +08:00
s_clusters_per_group must equal s_blocks_per_group.
2026-01-21 18:59:54 +08:00
* - 0x28
2026-01-29 22:25:33 +08:00
- __le32
- s_inodes_per_group
2026-01-21 18:59:54 +08:00
- Inodes per group.
* - 0x2C
2026-01-29 22:25:33 +08:00
- __le32
- s_mtime
2026-01-21 18:59:54 +08:00
- Mount time, in seconds since the epoch.
* - 0x30
2026-01-29 22:25:33 +08:00
- __le32
- s_wtime
2026-01-21 18:59:54 +08:00
- Write time, in seconds since the epoch.
* - 0x34
2026-01-29 22:25:33 +08:00
- __le16
- s_mnt_count
2026-01-21 18:59:54 +08:00
- Number of mounts since the last fsck.
* - 0x36
2026-01-29 22:25:33 +08:00
- __le16
- s_max_mnt_count
2026-01-21 18:59:54 +08:00
- Number of mounts beyond which a fsck is needed.
* - 0x38
2026-01-29 22:25:33 +08:00
- __le16
- s_magic
2026-01-21 18:59:54 +08:00
- Magic signature, 0xEF53
* - 0x3A
2026-01-29 22:25:33 +08:00
- __le16
- s_state
2026-01-21 18:59:54 +08:00
- File system state. See super_state_ for more info.
* - 0x3C
2026-01-29 22:25:33 +08:00
- __le16
- s_errors
2026-01-21 18:59:54 +08:00
- Behaviour when detecting errors. See super_errors_ for more info.
* - 0x3E
2026-01-29 22:25:33 +08:00
- __le16
- s_minor_rev_level
2026-01-21 18:59:54 +08:00
- Minor revision level.
* - 0x40
2026-01-29 22:25:33 +08:00
- __le32
- s_lastcheck
2026-01-21 18:59:54 +08:00
- Time of last check, in seconds since the epoch.
* - 0x44
2026-01-29 22:25:33 +08:00
- __le32
- s_checkinterval
2026-01-21 18:59:54 +08:00
- Maximum time between checks, in seconds.
* - 0x48
2026-01-29 22:25:33 +08:00
- __le32
- s_creator_os
2026-01-21 18:59:54 +08:00
- Creator OS. See the table super_creator_ for more info.
* - 0x4C
2026-01-29 22:25:33 +08:00
- __le32
- s_rev_level
2026-01-21 18:59:54 +08:00
- Revision level. See the table super_revision_ for more info.
* - 0x50
2026-01-29 22:25:33 +08:00
- __le16
- s_def_resuid
2026-01-21 18:59:54 +08:00
- Default uid for reserved blocks.
* - 0x52
2026-01-29 22:25:33 +08:00
- __le16
- s_def_resgid
2026-01-21 18:59:54 +08:00
- Default gid for reserved blocks.
* -
-
-
- These fields are for EXT4_DYNAMIC_REV superblocks only.
Note: the difference between the compatible feature set and the
incompatible feature set is that if there is a bit set in the
incompatible feature set that the kernel doesn't know about, it should
refuse to mount the filesystem.
e2fsck's requirements are more strict; if it doesn't know
about a feature in either the compatible or incompatible feature set, it
must abort and not try to meddle with things it doesn't understand...
* - 0x54
2026-01-29 22:25:33 +08:00
- __le32
- s_first_ino
2026-01-21 18:59:54 +08:00
- First non-reserved inode.
* - 0x58
2026-01-29 22:25:33 +08:00
- __le16
- s_inode_size
2026-01-21 18:59:54 +08:00
- Size of inode structure, in bytes.
* - 0x5A
2026-01-29 22:25:33 +08:00
- __le16
- s_block_group_nr
2026-01-21 18:59:54 +08:00
- Block group # of this superblock.
* - 0x5C
2026-01-29 22:25:33 +08:00
- __le32
- s_feature_compat
2026-01-21 18:59:54 +08:00
- Compatible feature set flags. Kernel can still read/write this fs even
if it doesn't understand a flag; fsck should not do that. See the
super_compat_ table for more info.
* - 0x60
2026-01-29 22:25:33 +08:00
- __le32
- s_feature_incompat
2026-01-21 18:59:54 +08:00
- Incompatible feature set. If the kernel or fsck doesn't understand one
of these bits, it should stop. See the super_incompat_ table for more
info.
* - 0x64
2026-01-29 22:25:33 +08:00
- __le32
- s_feature_ro_compat
2026-01-21 18:59:54 +08:00
- Readonly-compatible feature set. If the kernel doesn't understand one of
these bits, it can still mount read-only. See the super_rocompat_ table
for more info.
* - 0x68
2026-01-29 22:25:33 +08:00
- __u8
- s_uuid[16]
2026-01-21 18:59:54 +08:00
- 128-bit UUID for volume.
* - 0x78
- char
2026-01-29 22:25:33 +08:00
- s_volume_name[16]
2026-01-21 18:59:54 +08:00
- Volume label.
* - 0x88
- char
2026-01-29 22:25:33 +08:00
- s_last_mounted[64]
2026-01-21 18:59:54 +08:00
- Directory where filesystem was last mounted.
* - 0xC8
2026-01-29 22:25:33 +08:00
- __le32
- s_algorithm_usage_bitmap
2026-01-21 18:59:54 +08:00
- For compression (Not used in e2fsprogs/Linux)
* -
-
-
- Performance hints. Directory preallocation should only happen if the
EXT4_FEATURE_COMPAT_DIR_PREALLOC flag is on.
* - 0xCC
2026-01-29 22:25:33 +08:00
- __u8
- s_prealloc_blocks
2026-01-21 18:59:54 +08:00
- #. of blocks to try to preallocate for ... files? (Not used in
e2fsprogs/Linux)
* - 0xCD
2026-01-29 22:25:33 +08:00
- __u8
- s_prealloc_dir_blocks
2026-01-21 18:59:54 +08:00
- #. of blocks to preallocate for directories. (Not used in
e2fsprogs/Linux)
* - 0xCE
2026-01-29 22:25:33 +08:00
- __le16
- s_reserved_gdt_blocks
2026-01-21 18:59:54 +08:00
- Number of reserved GDT entries for future filesystem expansion.
* -
-
-
- Journalling support is valid only if EXT4_FEATURE_COMPAT_HAS_JOURNAL is
set.
* - 0xD0
2026-01-29 22:25:33 +08:00
- __u8
- s_journal_uuid[16]
2026-01-21 18:59:54 +08:00
- UUID of journal superblock
* - 0xE0
2026-01-29 22:25:33 +08:00
- __le32
- s_journal_inum
2026-01-21 18:59:54 +08:00
- inode number of journal file.
* - 0xE4
2026-01-29 22:25:33 +08:00
- __le32
- s_journal_dev
2026-01-21 18:59:54 +08:00
- Device number of journal file, if the external journal feature flag is
set.
* - 0xE8
2026-01-29 22:25:33 +08:00
- __le32
- s_last_orphan
2026-01-21 18:59:54 +08:00
- Start of list of orphaned inodes to delete.
* - 0xEC
2026-01-29 22:25:33 +08:00
- __le32
- s_hash_seed[4]
2026-01-21 18:59:54 +08:00
- HTREE hash seed.
* - 0xFC
2026-01-29 22:25:33 +08:00
- __u8
- s_def_hash_version
2026-01-21 18:59:54 +08:00
- Default hash algorithm to use for directory hashes. See super_def_hash_
for more info.
* - 0xFD
2026-01-29 22:25:33 +08:00
- __u8
- s_jnl_backup_type
- If this value is 0 or EXT3_JNL_BACKUP_BLOCKS (1), then the
2026-01-21 18:59:54 +08:00
``s_jnl_blocks`` field contains a duplicate copy of the inode's
``i_block[]`` array and ``i_size``.
* - 0xFE
2026-01-29 22:25:33 +08:00
- __le16
- s_desc_size
2026-01-21 18:59:54 +08:00
- Size of group descriptors, in bytes, if the 64bit incompat feature flag
is set.
* - 0x100
2026-01-29 22:25:33 +08:00
- __le32
- s_default_mount_opts
2026-01-21 18:59:54 +08:00
- Default mount options. See the super_mountopts_ table for more info.
* - 0x104
2026-01-29 22:25:33 +08:00
- __le32
- s_first_meta_bg
- First metablock block group, if the meta_bg feature is enabled.
2026-01-21 18:59:54 +08:00
* - 0x108
2026-01-29 22:25:33 +08:00
- __le32
- s_mkfs_time
2026-01-21 18:59:54 +08:00
- When the filesystem was created, in seconds since the epoch.
* - 0x10C
2026-01-29 22:25:33 +08:00
- __le32
- s_jnl_blocks[17]
2026-01-21 18:59:54 +08:00
- Backup copy of the journal inode's ``i_block[]`` array in the first 15
2026-01-29 22:25:33 +08:00
elements and i_size_high and i_size in the 16th and 17th elements,
2026-01-21 18:59:54 +08:00
respectively.
* -
-
-
- 64bit support is valid only if EXT4_FEATURE_COMPAT_64BIT is set.
* - 0x150
2026-01-29 22:25:33 +08:00
- __le32
- s_blocks_count_hi
2026-01-21 18:59:54 +08:00
- High 32-bits of the block count.
* - 0x154
2026-01-29 22:25:33 +08:00
- __le32
- s_r_blocks_count_hi
2026-01-21 18:59:54 +08:00
- High 32-bits of the reserved block count.
* - 0x158
2026-01-29 22:25:33 +08:00
- __le32
- s_free_blocks_count_hi
2026-01-21 18:59:54 +08:00
- High 32-bits of the free block count.
* - 0x15C
2026-01-29 22:25:33 +08:00
- __le16
- s_min_extra_isize
2026-01-21 18:59:54 +08:00
- All inodes have at least # bytes.
* - 0x15E
2026-01-29 22:25:33 +08:00
- __le16
- s_want_extra_isize
2026-01-21 18:59:54 +08:00
- New inodes should reserve # bytes.
* - 0x160
2026-01-29 22:25:33 +08:00
- __le32
- s_flags
2026-01-21 18:59:54 +08:00
- Miscellaneous flags. See the super_flags_ table for more info.
* - 0x164
2026-01-29 22:25:33 +08:00
- __le16
- s_raid_stride
2026-01-21 18:59:54 +08:00
- RAID stride. This is the number of logical blocks read from or written
to the disk before moving to the next disk. This affects the placement
of filesystem metadata, which will hopefully make RAID storage faster.
* - 0x166
2026-01-29 22:25:33 +08:00
- __le16
- s_mmp_interval
2026-01-21 18:59:54 +08:00
- #. seconds to wait in multi-mount prevention (MMP) checking. In theory,
MMP is a mechanism to record in the superblock which host and device
have mounted the filesystem, in order to prevent multiple mounts. This
feature does not seem to be implemented...
* - 0x168
2026-01-29 22:25:33 +08:00
- __le64
- s_mmp_block
2026-01-21 18:59:54 +08:00
- Block # for multi-mount protection data.
* - 0x170
2026-01-29 22:25:33 +08:00
- __le32
- s_raid_stripe_width
2026-01-21 18:59:54 +08:00
- RAID stripe width. This is the number of logical blocks read from or
written to the disk before coming back to the current disk. This is used
by the block allocator to try to reduce the number of read-modify-write
operations in a RAID5/6.
* - 0x174
2026-01-29 22:25:33 +08:00
- __u8
- s_log_groups_per_flex
2026-01-21 18:59:54 +08:00
- Size of a flexible block group is 2 ^ ``s_log_groups_per_flex``.
* - 0x175
2026-01-29 22:25:33 +08:00
- __u8
- s_checksum_type
2026-01-21 18:59:54 +08:00
- Metadata checksum algorithm type. The only valid value is 1 (crc32c).
* - 0x176
2026-01-29 22:25:33 +08:00
- __le16
- s_reserved_pad
2026-01-21 18:59:54 +08:00
-
* - 0x178
2026-01-29 22:25:33 +08:00
- __le64
- s_kbytes_written
2026-01-21 18:59:54 +08:00
- Number of KiB written to this filesystem over its lifetime.
* - 0x180
2026-01-29 22:25:33 +08:00
- __le32
- s_snapshot_inum
2026-01-21 18:59:54 +08:00
- inode number of active snapshot. (Not used in e2fsprogs/Linux.)
* - 0x184
2026-01-29 22:25:33 +08:00
- __le32
- s_snapshot_id
2026-01-21 18:59:54 +08:00
- Sequential ID of active snapshot. (Not used in e2fsprogs/Linux.)
* - 0x188
2026-01-29 22:25:33 +08:00
- __le64
- s_snapshot_r_blocks_count
2026-01-21 18:59:54 +08:00
- Number of blocks reserved for active snapshot's future use. (Not used in
e2fsprogs/Linux.)
* - 0x190
2026-01-29 22:25:33 +08:00
- __le32
- s_snapshot_list
2026-01-21 18:59:54 +08:00
- inode number of the head of the on-disk snapshot list. (Not used in
e2fsprogs/Linux.)
* - 0x194
2026-01-29 22:25:33 +08:00
- __le32
- s_error_count
2026-01-21 18:59:54 +08:00
- Number of errors seen.
* - 0x198
2026-01-29 22:25:33 +08:00
- __le32
- s_first_error_time
2026-01-21 18:59:54 +08:00
- First time an error happened, in seconds since the epoch.
* - 0x19C
2026-01-29 22:25:33 +08:00
- __le32
- s_first_error_ino
2026-01-21 18:59:54 +08:00
- inode involved in first error.
* - 0x1A0
2026-01-29 22:25:33 +08:00
- __le64
- s_first_error_block
2026-01-21 18:59:54 +08:00
- Number of block involved of first error.
* - 0x1A8
2026-01-29 22:25:33 +08:00
- __u8
- s_first_error_func[32]
2026-01-21 18:59:54 +08:00
- Name of function where the error happened.
* - 0x1C8
2026-01-29 22:25:33 +08:00
- __le32
- s_first_error_line
2026-01-21 18:59:54 +08:00
- Line number where error happened.
* - 0x1CC
2026-01-29 22:25:33 +08:00
- __le32
- s_last_error_time
2026-01-21 18:59:54 +08:00
- Time of most recent error, in seconds since the epoch.
* - 0x1D0
2026-01-29 22:25:33 +08:00
- __le32
- s_last_error_ino
2026-01-21 18:59:54 +08:00
- inode involved in most recent error.
* - 0x1D4
2026-01-29 22:25:33 +08:00
- __le32
- s_last_error_line
2026-01-21 18:59:54 +08:00
- Line number where most recent error happened.
* - 0x1D8
2026-01-29 22:25:33 +08:00
- __le64
- s_last_error_block
2026-01-21 18:59:54 +08:00
- Number of block involved in most recent error.
* - 0x1E0
2026-01-29 22:25:33 +08:00
- __u8
- s_last_error_func[32]
2026-01-21 18:59:54 +08:00
- Name of function where the most recent error happened.
* - 0x200
2026-01-29 22:25:33 +08:00
- __u8
- s_mount_opts[64]
2026-01-21 18:59:54 +08:00
- ASCIIZ string of mount options.
* - 0x240
2026-01-29 22:25:33 +08:00
- __le32
- s_usr_quota_inum
2026-01-21 18:59:54 +08:00
- Inode number of user `quota <quota>`__ file.
* - 0x244
2026-01-29 22:25:33 +08:00
- __le32
- s_grp_quota_inum
2026-01-21 18:59:54 +08:00
- Inode number of group `quota <quota>`__ file.
* - 0x248
2026-01-29 22:25:33 +08:00
- __le32
- s_overhead_blocks
2026-01-21 18:59:54 +08:00
- Overhead blocks/clusters in fs. (Huh? This field is always zero, which
means that the kernel calculates it dynamically.)
* - 0x24C
2026-01-29 22:25:33 +08:00
- __le32
- s_backup_bgs[2]
- Block groups containing superblock backups (if sparse_super2)
2026-01-21 18:59:54 +08:00
* - 0x254
2026-01-29 22:25:33 +08:00
- __u8
- s_encrypt_algos[4]
2026-01-21 18:59:54 +08:00
- Encryption algorithms in use. There can be up to four algorithms in use
at any time; valid algorithm codes are given in the super_encrypt_ table
below.
* - 0x258
2026-01-29 22:25:33 +08:00
- __u8
- s_encrypt_pw_salt[16]
2026-01-21 18:59:54 +08:00
- Salt for the string2key algorithm for encryption.
* - 0x268
2026-01-29 22:25:33 +08:00
- __le32
- s_lpf_ino
2026-01-21 18:59:54 +08:00
- Inode number of lost+found
* - 0x26C
2026-01-29 22:25:33 +08:00
- __le32
- s_prj_quota_inum
2026-01-21 18:59:54 +08:00
- Inode that tracks project quotas.
* - 0x270
2026-01-29 22:25:33 +08:00
- __le32
- s_checksum_seed
- Checksum seed used for metadata_csum calculations. This value is
crc32c(~0, $orig_fs_uuid).
2026-01-21 18:59:54 +08:00
* - 0x274
2026-01-29 22:25:33 +08:00
- __u8
- s_wtime_hi
2026-01-21 18:59:54 +08:00
- Upper 8 bits of the s_wtime field.
* - 0x275
2026-01-29 22:25:33 +08:00
- __u8
- s_mtime_hi
2026-01-21 18:59:54 +08:00
- Upper 8 bits of the s_mtime field.
* - 0x276
2026-01-29 22:25:33 +08:00
- __u8
- s_mkfs_time_hi
2026-01-21 18:59:54 +08:00
- Upper 8 bits of the s_mkfs_time field.
* - 0x277
2026-01-29 22:25:33 +08:00
- __u8
- s_lastcheck_hi
- Upper 8 bits of the s_lastcheck field.
2026-01-21 18:59:54 +08:00
* - 0x278
2026-01-29 22:25:33 +08:00
- __u8
- s_first_error_time_hi
- Upper 8 bits of the s_first_error_time field.
2026-01-21 18:59:54 +08:00
* - 0x279
2026-01-29 22:25:33 +08:00
- __u8
- s_last_error_time_hi
- Upper 8 bits of the s_last_error_time field.
2026-01-21 18:59:54 +08:00
* - 0x27A
2026-01-29 22:25:33 +08:00
- __u8
- s_pad[2]
2026-01-21 18:59:54 +08:00
- Zero padding.
* - 0x27C
2026-01-29 22:25:33 +08:00
- __le16
- s_encoding
2026-01-21 18:59:54 +08:00
- Filename charset encoding.
* - 0x27E
2026-01-29 22:25:33 +08:00
- __le16
- s_encoding_flags
2026-01-21 18:59:54 +08:00
- Filename charset encoding flags.
* - 0x280
2026-01-29 22:25:33 +08:00
- __le32
- s_orphan_file_inum
- Orphan file inode number.
* - 0x284
- __le32
- s_reserved[94]
2026-01-21 18:59:54 +08:00
- Padding to the end of the block.
* - 0x3FC
2026-01-29 22:25:33 +08:00
- __le32
- s_checksum
2026-01-21 18:59:54 +08:00
- Superblock checksum.
.. _super_state:
The superblock state is some combination of the following:
.. list-table::
:widths: 8 72
:header-rows: 1
* - Value
- Description
* - 0x0001
- Cleanly umounted
* - 0x0002
- Errors detected
* - 0x0004
- Orphans being recovered
.. _super_errors:
The superblock error policy is one of the following:
.. list-table::
:widths: 8 72
:header-rows: 1
* - Value
- Description
* - 1
- Continue
* - 2
- Remount read-only
* - 3
- Panic
.. _super_creator:
The filesystem creator is one of the following:
.. list-table::
:widths: 8 72
:header-rows: 1
* - Value
- Description
* - 0
- Linux
* - 1
- Hurd
* - 2
- Masix
* - 3
- FreeBSD
* - 4
- Lites
.. _super_revision:
The superblock revision is one of the following:
.. list-table::
:widths: 8 72
:header-rows: 1
* - Value
- Description
* - 0
- Original format
* - 1
- v2 format w/ dynamic inode sizes
Note that ``EXT4_DYNAMIC_REV`` refers to a revision 1 or newer filesystem.
.. _super_compat:
The superblock compatible features field is a combination of any of the
following:
.. list-table::
:widths: 16 64
:header-rows: 1
* - Value
- Description
* - 0x1
2026-01-29 22:25:33 +08:00
- Directory preallocation (COMPAT_DIR_PREALLOC).
2026-01-21 18:59:54 +08:00
* - 0x2
- “imagic inodes”. Not clear from the code what this does
2026-01-29 22:25:33 +08:00
(COMPAT_IMAGIC_INODES).
2026-01-21 18:59:54 +08:00
* - 0x4
2026-01-29 22:25:33 +08:00
- Has a journal (COMPAT_HAS_JOURNAL).
2026-01-21 18:59:54 +08:00
* - 0x8
2026-01-29 22:25:33 +08:00
- Supports extended attributes (COMPAT_EXT_ATTR).
2026-01-21 18:59:54 +08:00
* - 0x10
- Has reserved GDT blocks for filesystem expansion
2026-01-29 22:25:33 +08:00
(COMPAT_RESIZE_INODE). Requires RO_COMPAT_SPARSE_SUPER.
2026-01-21 18:59:54 +08:00
* - 0x20
2026-01-29 22:25:33 +08:00
- Has directory indices (COMPAT_DIR_INDEX).
2026-01-21 18:59:54 +08:00
* - 0x40
- “Lazy BG”. Not in Linux kernel, seems to have been for uninitialized
2026-01-29 22:25:33 +08:00
block groups? (COMPAT_LAZY_BG)
2026-01-21 18:59:54 +08:00
* - 0x80
2026-01-29 22:25:33 +08:00
- “Exclude inode”. Not used. (COMPAT_EXCLUDE_INODE).
2026-01-21 18:59:54 +08:00
* - 0x100
- “Exclude bitmap”. Seems to be used to indicate the presence of
snapshot-related exclude bitmaps? Not defined in kernel or used in
2026-01-29 22:25:33 +08:00
e2fsprogs (COMPAT_EXCLUDE_BITMAP).
2026-01-21 18:59:54 +08:00
* - 0x200
2026-01-29 22:25:33 +08:00
- Sparse Super Block, v2. If this flag is set, the SB field s_backup_bgs
2026-01-21 18:59:54 +08:00
points to the two block groups that contain backup superblocks
2026-01-29 22:25:33 +08:00
(COMPAT_SPARSE_SUPER2).
2026-01-21 18:59:54 +08:00
* - 0x400
- Fast commits supported. Although fast commits blocks are
backward incompatible, fast commit blocks are not always
present in the journal. If fast commit blocks are present in
the journal, JBD2 incompat feature
2026-01-29 22:25:33 +08:00
(JBD2_FEATURE_INCOMPAT_FAST_COMMIT) gets
set (COMPAT_FAST_COMMIT).
* - 0x1000
- Orphan file allocated. This is the special file for more efficient
tracking of unlinked but still open inodes. When there may be any
entries in the file, we additionally set proper rocompat feature
(RO_COMPAT_ORPHAN_PRESENT).
2026-01-21 18:59:54 +08:00
.. _super_incompat:
The superblock incompatible features field is a combination of any of the
following:
.. list-table::
:widths: 16 64
:header-rows: 1
* - Value
- Description
* - 0x1
2026-01-29 22:25:33 +08:00
- Compression (INCOMPAT_COMPRESSION).
2026-01-21 18:59:54 +08:00
* - 0x2
2026-01-29 22:25:33 +08:00
- Directory entries record the file type. See ext4_dir_entry_2 below
(INCOMPAT_FILETYPE).
2026-01-21 18:59:54 +08:00
* - 0x4
2026-01-29 22:25:33 +08:00
- Filesystem needs recovery (INCOMPAT_RECOVER).
2026-01-21 18:59:54 +08:00
* - 0x8
2026-01-29 22:25:33 +08:00
- Filesystem has a separate journal device (INCOMPAT_JOURNAL_DEV).
2026-01-21 18:59:54 +08:00
* - 0x10
- Meta block groups. See the earlier discussion of this feature
2026-01-29 22:25:33 +08:00
(INCOMPAT_META_BG).
2026-01-21 18:59:54 +08:00
* - 0x40
2026-01-29 22:25:33 +08:00
- Files in this filesystem use extents (INCOMPAT_EXTENTS).
2026-01-21 18:59:54 +08:00
* - 0x80
2026-01-29 22:25:33 +08:00
- Enable a filesystem size of 2^64 blocks (INCOMPAT_64BIT).
2026-01-21 18:59:54 +08:00
* - 0x100
2026-01-29 22:25:33 +08:00
- Multiple mount protection (INCOMPAT_MMP).
2026-01-21 18:59:54 +08:00
* - 0x200
- Flexible block groups. See the earlier discussion of this feature
2026-01-29 22:25:33 +08:00
(INCOMPAT_FLEX_BG).
2026-01-21 18:59:54 +08:00
* - 0x400
- Inodes can be used to store large extended attribute values
2026-01-29 22:25:33 +08:00
(INCOMPAT_EA_INODE).
2026-01-21 18:59:54 +08:00
* - 0x1000
2026-01-29 22:25:33 +08:00
- Data in directory entry (INCOMPAT_DIRDATA). (Not implemented?)
2026-01-21 18:59:54 +08:00
* - 0x2000
- Metadata checksum seed is stored in the superblock. This feature enables
2026-01-29 22:25:33 +08:00
the administrator to change the UUID of a metadata_csum filesystem
2026-01-21 18:59:54 +08:00
while the filesystem is mounted; without it, the checksum definition
2026-01-29 22:25:33 +08:00
requires all metadata blocks to be rewritten (INCOMPAT_CSUM_SEED).
2026-01-21 18:59:54 +08:00
* - 0x4000
2026-01-29 22:25:33 +08:00
- Large directory >2GB or 3-level htree (INCOMPAT_LARGEDIR). Prior to
2026-01-21 18:59:54 +08:00
this feature, directories could not be larger than 4GiB and could not
have an htree more than 2 levels deep. If this feature is enabled,
directories can be larger than 4GiB and have a maximum htree depth of 3.
* - 0x8000
2026-01-29 22:25:33 +08:00
- Data in inode (INCOMPAT_INLINE_DATA).
2026-01-21 18:59:54 +08:00
* - 0x10000
2026-01-29 22:25:33 +08:00
- Encrypted inodes are present on the filesystem. (INCOMPAT_ENCRYPT).
2026-01-21 18:59:54 +08:00
.. _super_rocompat:
The superblock read-only compatible features field is a combination of any of
the following:
.. list-table::
:widths: 16 64
:header-rows: 1
* - Value
- Description
* - 0x1
- Sparse superblocks. See the earlier discussion of this feature
2026-01-29 22:25:33 +08:00
(RO_COMPAT_SPARSE_SUPER).
2026-01-21 18:59:54 +08:00
* - 0x2
- This filesystem has been used to store a file greater than 2GiB
2026-01-29 22:25:33 +08:00
(RO_COMPAT_LARGE_FILE).
2026-01-21 18:59:54 +08:00
* - 0x4
2026-01-29 22:25:33 +08:00
- Not used in kernel or e2fsprogs (RO_COMPAT_BTREE_DIR).
2026-01-21 18:59:54 +08:00
* - 0x8
- This filesystem has files whose sizes are represented in units of
logical blocks, not 512-byte sectors. This implies a very large file
2026-01-29 22:25:33 +08:00
indeed! (RO_COMPAT_HUGE_FILE)
2026-01-21 18:59:54 +08:00
* - 0x10
- Group descriptors have checksums. In addition to detecting corruption,
this is useful for lazy formatting with uninitialized groups
2026-01-29 22:25:33 +08:00
(RO_COMPAT_GDT_CSUM).
2026-01-21 18:59:54 +08:00
* - 0x20
- Indicates that the old ext3 32,000 subdirectory limit no longer applies
2026-01-29 22:25:33 +08:00
(RO_COMPAT_DIR_NLINK). A directory's i_links_count will be set to 1
2026-01-21 18:59:54 +08:00
if it is incremented past 64,999.
* - 0x40
- Indicates that large inodes exist on this filesystem
2026-01-29 22:25:33 +08:00
(RO_COMPAT_EXTRA_ISIZE).
2026-01-21 18:59:54 +08:00
* - 0x80
2026-01-29 22:25:33 +08:00
- This filesystem has a snapshot (RO_COMPAT_HAS_SNAPSHOT).
2026-01-21 18:59:54 +08:00
* - 0x100
2026-01-29 22:25:33 +08:00
- `Quota <Quota>`__ (RO_COMPAT_QUOTA).
2026-01-21 18:59:54 +08:00
* - 0x200
- This filesystem supports “bigalloc”, which means that file extents are
tracked in units of clusters (of blocks) instead of blocks
2026-01-29 22:25:33 +08:00
(RO_COMPAT_BIGALLOC).
2026-01-21 18:59:54 +08:00
* - 0x400
- This filesystem supports metadata checksumming.
2026-01-29 22:25:33 +08:00
(RO_COMPAT_METADATA_CSUM; implies RO_COMPAT_GDT_CSUM, though
GDT_CSUM must not be set)
2026-01-21 18:59:54 +08:00
* - 0x800
- Filesystem supports replicas. This feature is neither in the kernel nor
2026-01-29 22:25:33 +08:00
e2fsprogs. (RO_COMPAT_REPLICA)
2026-01-21 18:59:54 +08:00
* - 0x1000
- Read-only filesystem image; the kernel will not mount this image
read-write and most tools will refuse to write to the image.
2026-01-29 22:25:33 +08:00
(RO_COMPAT_READONLY)
2026-01-21 18:59:54 +08:00
* - 0x2000
2026-01-29 22:25:33 +08:00
- Filesystem tracks project quotas. (RO_COMPAT_PROJECT)
2026-01-21 18:59:54 +08:00
* - 0x8000
2026-01-29 22:25:33 +08:00
- Verity inodes may be present on the filesystem. (RO_COMPAT_VERITY)
* - 0x10000
- Indicates orphan file may have valid orphan entries and thus we need
to clean them up when mounting the filesystem
(RO_COMPAT_ORPHAN_PRESENT).
2026-01-21 18:59:54 +08:00
.. _super_def_hash:
The ``s_def_hash_version`` field is one of the following:
.. list-table::
:widths: 8 72
:header-rows: 1
* - Value
- Description
* - 0x0
- Legacy.
* - 0x1
- Half MD4.
* - 0x2
- Tea.
* - 0x3
- Legacy, unsigned.
* - 0x4
- Half MD4, unsigned.
* - 0x5
- Tea, unsigned.
.. _super_mountopts:
The ``s_default_mount_opts`` field is any combination of the following:
.. list-table::
:widths: 8 72
:header-rows: 1
* - Value
- Description
* - 0x0001
2026-01-29 22:25:33 +08:00
- Print debugging info upon (re)mount. (EXT4_DEFM_DEBUG)
2026-01-21 18:59:54 +08:00
* - 0x0002
- New files take the gid of the containing directory (instead of the fsgid
2026-01-29 22:25:33 +08:00
of the current process). (EXT4_DEFM_BSDGROUPS)
2026-01-21 18:59:54 +08:00
* - 0x0004
2026-01-29 22:25:33 +08:00
- Support userspace-provided extended attributes. (EXT4_DEFM_XATTR_USER)
2026-01-21 18:59:54 +08:00
* - 0x0008
2026-01-29 22:25:33 +08:00
- Support POSIX access control lists (ACLs). (EXT4_DEFM_ACL)
2026-01-21 18:59:54 +08:00
* - 0x0010
2026-01-29 22:25:33 +08:00
- Do not support 32-bit UIDs. (EXT4_DEFM_UID16)
2026-01-21 18:59:54 +08:00
* - 0x0020
2026-01-29 22:25:33 +08:00
- All data and metadata are committed to the journal.
(EXT4_DEFM_JMODE_DATA)
2026-01-21 18:59:54 +08:00
* - 0x0040
- All data are flushed to the disk before metadata are committed to the
2026-01-29 22:25:33 +08:00
journal. (EXT4_DEFM_JMODE_ORDERED)
2026-01-21 18:59:54 +08:00
* - 0x0060
- Data ordering is not preserved; data may be written after the metadata
2026-01-29 22:25:33 +08:00
has been written. (EXT4_DEFM_JMODE_WBACK)
2026-01-21 18:59:54 +08:00
* - 0x0100
2026-01-29 22:25:33 +08:00
- Disable write flushes. (EXT4_DEFM_NOBARRIER)
2026-01-21 18:59:54 +08:00
* - 0x0200
- Track which blocks in a filesystem are metadata and therefore should not
be used as data blocks. This option will be enabled by default on 3.18,
2026-01-29 22:25:33 +08:00
hopefully. (EXT4_DEFM_BLOCK_VALIDITY)
2026-01-21 18:59:54 +08:00
* - 0x0400
- Enable DISCARD support, where the storage device is told about blocks
2026-01-29 22:25:33 +08:00
becoming unused. (EXT4_DEFM_DISCARD)
2026-01-21 18:59:54 +08:00
* - 0x0800
2026-01-29 22:25:33 +08:00
- Disable delayed allocation. (EXT4_DEFM_NODELALLOC)
2026-01-21 18:59:54 +08:00
.. _super_flags:
The ``s_flags`` field is any combination of the following:
.. list-table::
:widths: 8 72
:header-rows: 1
* - Value
- Description
* - 0x0001
- Signed directory hash in use.
* - 0x0002
- Unsigned directory hash in use.
* - 0x0004
- To test development code.
.. _super_encrypt:
The ``s_encrypt_algos`` list can contain any of the following:
.. list-table::
:widths: 8 72
:header-rows: 1
* - Value
- Description
* - 0
2026-01-29 22:25:33 +08:00
- Invalid algorithm (ENCRYPTION_MODE_INVALID).
2026-01-21 18:59:54 +08:00
* - 1
2026-01-29 22:25:33 +08:00
- 256-bit AES in XTS mode (ENCRYPTION_MODE_AES_256_XTS).
2026-01-21 18:59:54 +08:00
* - 2
2026-01-29 22:25:33 +08:00
- 256-bit AES in GCM mode (ENCRYPTION_MODE_AES_256_GCM).
2026-01-21 18:59:54 +08:00
* - 3
2026-01-29 22:25:33 +08:00
- 256-bit AES in CBC mode (ENCRYPTION_MODE_AES_256_CBC).
2026-01-21 18:59:54 +08:00
Total size of the superblock is 1024 bytes.