Documentation/filesystems/ext4/super.rst
.. SPDX-License-Identifier: GPL-2.0
The superblock records various information about the enclosing filesystem, such as block counts, inode counts, supported features, maintenance information, and more.
If the sparse_super feature flag is set, redundant copies of the 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
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...
s_jnl_blocks field contains a duplicate copy of the inode's
i_block[] array and i_size.i_block[] array in the first 15
elements and i_size_high and i_size in the 16th and 17th elements,
respectively.s_log_groups_per_flex.quota <quota>__ file.quota <quota>__ file... _super_state:
The superblock state is some combination of the following:
.. list-table:: :widths: 8 72 :header-rows: 1
.. _super_errors:
The superblock error policy is one of the following:
.. list-table:: :widths: 8 72 :header-rows: 1
.. _super_creator:
The filesystem creator is one of the following:
.. list-table:: :widths: 8 72 :header-rows: 1
.. _super_revision:
The superblock revision is one of the following:
.. list-table:: :widths: 8 72 :header-rows: 1
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
.. _super_incompat:
The superblock incompatible features field is a combination of any of the following:
.. list-table:: :widths: 16 64 :header-rows: 1
.. _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
Quota <Quota>__ (RO_COMPAT_QUOTA)... _super_def_hash:
The s_def_hash_version field is one of the following:
.. list-table:: :widths: 8 72 :header-rows: 1
.. _super_mountopts:
The s_default_mount_opts field is any combination of the following:
.. list-table:: :widths: 8 72 :header-rows: 1
.. _super_flags:
The s_flags field is any combination of the following:
.. list-table:: :widths: 8 72 :header-rows: 1
.. _super_encrypt:
The s_encrypt_algos list can contain any of the following:
.. list-table:: :widths: 8 72 :header-rows: 1
Total size of the superblock is 1024 bytes.