super.rst 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831
  1. .. SPDX-License-Identifier: GPL-2.0
  2. Super Block
  3. -----------
  4. The superblock records various information about the enclosing
  5. filesystem, such as block counts, inode counts, supported features,
  6. maintenance information, and more.
  7. If the sparse_super feature flag is set, redundant copies of the
  8. superblock and group descriptors are kept only in the groups whose group
  9. number is either 0 or a power of 3, 5, or 7. If the flag is not set,
  10. redundant copies are kept in all groups.
  11. The superblock checksum is calculated against the superblock structure,
  12. which includes the FS UUID.
  13. The ext4 superblock is laid out as follows in
  14. ``struct ext4_super_block``:
  15. .. list-table::
  16. :widths: 8 8 24 40
  17. :header-rows: 1
  18. * - Offset
  19. - Size
  20. - Name
  21. - Description
  22. * - 0x0
  23. - __le32
  24. - s_inodes_count
  25. - Total inode count.
  26. * - 0x4
  27. - __le32
  28. - s_blocks_count_lo
  29. - Total block count.
  30. * - 0x8
  31. - __le32
  32. - s_r_blocks_count_lo
  33. - This number of blocks can only be allocated by the super-user.
  34. * - 0xC
  35. - __le32
  36. - s_free_blocks_count_lo
  37. - Free block count.
  38. * - 0x10
  39. - __le32
  40. - s_free_inodes_count
  41. - Free inode count.
  42. * - 0x14
  43. - __le32
  44. - s_first_data_block
  45. - First data block. This must be at least 1 for 1k-block filesystems and
  46. is typically 0 for all other block sizes.
  47. * - 0x18
  48. - __le32
  49. - s_log_block_size
  50. - Block size is 2 ^ (10 + s_log_block_size).
  51. * - 0x1C
  52. - __le32
  53. - s_log_cluster_size
  54. - Cluster size is 2 ^ (10 + s_log_cluster_size) blocks if bigalloc is
  55. enabled. Otherwise s_log_cluster_size must equal s_log_block_size.
  56. * - 0x20
  57. - __le32
  58. - s_blocks_per_group
  59. - Blocks per group.
  60. * - 0x24
  61. - __le32
  62. - s_clusters_per_group
  63. - Clusters per group, if bigalloc is enabled. Otherwise
  64. s_clusters_per_group must equal s_blocks_per_group.
  65. * - 0x28
  66. - __le32
  67. - s_inodes_per_group
  68. - Inodes per group.
  69. * - 0x2C
  70. - __le32
  71. - s_mtime
  72. - Mount time, in seconds since the epoch.
  73. * - 0x30
  74. - __le32
  75. - s_wtime
  76. - Write time, in seconds since the epoch.
  77. * - 0x34
  78. - __le16
  79. - s_mnt_count
  80. - Number of mounts since the last fsck.
  81. * - 0x36
  82. - __le16
  83. - s_max_mnt_count
  84. - Number of mounts beyond which a fsck is needed.
  85. * - 0x38
  86. - __le16
  87. - s_magic
  88. - Magic signature, 0xEF53
  89. * - 0x3A
  90. - __le16
  91. - s_state
  92. - File system state. See super_state_ for more info.
  93. * - 0x3C
  94. - __le16
  95. - s_errors
  96. - Behaviour when detecting errors. See super_errors_ for more info.
  97. * - 0x3E
  98. - __le16
  99. - s_minor_rev_level
  100. - Minor revision level.
  101. * - 0x40
  102. - __le32
  103. - s_lastcheck
  104. - Time of last check, in seconds since the epoch.
  105. * - 0x44
  106. - __le32
  107. - s_checkinterval
  108. - Maximum time between checks, in seconds.
  109. * - 0x48
  110. - __le32
  111. - s_creator_os
  112. - Creator OS. See the table super_creator_ for more info.
  113. * - 0x4C
  114. - __le32
  115. - s_rev_level
  116. - Revision level. See the table super_revision_ for more info.
  117. * - 0x50
  118. - __le16
  119. - s_def_resuid
  120. - Default uid for reserved blocks.
  121. * - 0x52
  122. - __le16
  123. - s_def_resgid
  124. - Default gid for reserved blocks.
  125. * -
  126. -
  127. -
  128. - These fields are for EXT4_DYNAMIC_REV superblocks only.
  129. Note: the difference between the compatible feature set and the
  130. incompatible feature set is that if there is a bit set in the
  131. incompatible feature set that the kernel doesn't know about, it should
  132. refuse to mount the filesystem.
  133. e2fsck's requirements are more strict; if it doesn't know
  134. about a feature in either the compatible or incompatible feature set, it
  135. must abort and not try to meddle with things it doesn't understand...
  136. * - 0x54
  137. - __le32
  138. - s_first_ino
  139. - First non-reserved inode.
  140. * - 0x58
  141. - __le16
  142. - s_inode_size
  143. - Size of inode structure, in bytes.
  144. * - 0x5A
  145. - __le16
  146. - s_block_group_nr
  147. - Block group # of this superblock.
  148. * - 0x5C
  149. - __le32
  150. - s_feature_compat
  151. - Compatible feature set flags. Kernel can still read/write this fs even
  152. if it doesn't understand a flag; fsck should not do that. See the
  153. super_compat_ table for more info.
  154. * - 0x60
  155. - __le32
  156. - s_feature_incompat
  157. - Incompatible feature set. If the kernel or fsck doesn't understand one
  158. of these bits, it should stop. See the super_incompat_ table for more
  159. info.
  160. * - 0x64
  161. - __le32
  162. - s_feature_ro_compat
  163. - Readonly-compatible feature set. If the kernel doesn't understand one of
  164. these bits, it can still mount read-only. See the super_rocompat_ table
  165. for more info.
  166. * - 0x68
  167. - __u8
  168. - s_uuid[16]
  169. - 128-bit UUID for volume.
  170. * - 0x78
  171. - char
  172. - s_volume_name[16]
  173. - Volume label.
  174. * - 0x88
  175. - char
  176. - s_last_mounted[64]
  177. - Directory where filesystem was last mounted.
  178. * - 0xC8
  179. - __le32
  180. - s_algorithm_usage_bitmap
  181. - For compression (Not used in e2fsprogs/Linux)
  182. * -
  183. -
  184. -
  185. - Performance hints. Directory preallocation should only happen if the
  186. EXT4_FEATURE_COMPAT_DIR_PREALLOC flag is on.
  187. * - 0xCC
  188. - __u8
  189. - s_prealloc_blocks
  190. - #. of blocks to try to preallocate for ... files? (Not used in
  191. e2fsprogs/Linux)
  192. * - 0xCD
  193. - __u8
  194. - s_prealloc_dir_blocks
  195. - #. of blocks to preallocate for directories. (Not used in
  196. e2fsprogs/Linux)
  197. * - 0xCE
  198. - __le16
  199. - s_reserved_gdt_blocks
  200. - Number of reserved GDT entries for future filesystem expansion.
  201. * -
  202. -
  203. -
  204. - Journalling support is valid only if EXT4_FEATURE_COMPAT_HAS_JOURNAL is
  205. set.
  206. * - 0xD0
  207. - __u8
  208. - s_journal_uuid[16]
  209. - UUID of journal superblock
  210. * - 0xE0
  211. - __le32
  212. - s_journal_inum
  213. - inode number of journal file.
  214. * - 0xE4
  215. - __le32
  216. - s_journal_dev
  217. - Device number of journal file, if the external journal feature flag is
  218. set.
  219. * - 0xE8
  220. - __le32
  221. - s_last_orphan
  222. - Start of list of orphaned inodes to delete.
  223. * - 0xEC
  224. - __le32
  225. - s_hash_seed[4]
  226. - HTREE hash seed.
  227. * - 0xFC
  228. - __u8
  229. - s_def_hash_version
  230. - Default hash algorithm to use for directory hashes. See super_def_hash_
  231. for more info.
  232. * - 0xFD
  233. - __u8
  234. - s_jnl_backup_type
  235. - If this value is 0 or EXT3_JNL_BACKUP_BLOCKS (1), then the
  236. ``s_jnl_blocks`` field contains a duplicate copy of the inode's
  237. ``i_block[]`` array and ``i_size``.
  238. * - 0xFE
  239. - __le16
  240. - s_desc_size
  241. - Size of group descriptors, in bytes, if the 64bit incompat feature flag
  242. is set.
  243. * - 0x100
  244. - __le32
  245. - s_default_mount_opts
  246. - Default mount options. See the super_mountopts_ table for more info.
  247. * - 0x104
  248. - __le32
  249. - s_first_meta_bg
  250. - First metablock block group, if the meta_bg feature is enabled.
  251. * - 0x108
  252. - __le32
  253. - s_mkfs_time
  254. - When the filesystem was created, in seconds since the epoch.
  255. * - 0x10C
  256. - __le32
  257. - s_jnl_blocks[17]
  258. - Backup copy of the journal inode's ``i_block[]`` array in the first 15
  259. elements and i_size_high and i_size in the 16th and 17th elements,
  260. respectively.
  261. * -
  262. -
  263. -
  264. - 64bit support is valid only if EXT4_FEATURE_COMPAT_64BIT is set.
  265. * - 0x150
  266. - __le32
  267. - s_blocks_count_hi
  268. - High 32-bits of the block count.
  269. * - 0x154
  270. - __le32
  271. - s_r_blocks_count_hi
  272. - High 32-bits of the reserved block count.
  273. * - 0x158
  274. - __le32
  275. - s_free_blocks_count_hi
  276. - High 32-bits of the free block count.
  277. * - 0x15C
  278. - __le16
  279. - s_min_extra_isize
  280. - All inodes have at least # bytes.
  281. * - 0x15E
  282. - __le16
  283. - s_want_extra_isize
  284. - New inodes should reserve # bytes.
  285. * - 0x160
  286. - __le32
  287. - s_flags
  288. - Miscellaneous flags. See the super_flags_ table for more info.
  289. * - 0x164
  290. - __le16
  291. - s_raid_stride
  292. - RAID stride. This is the number of logical blocks read from or written
  293. to the disk before moving to the next disk. This affects the placement
  294. of filesystem metadata, which will hopefully make RAID storage faster.
  295. * - 0x166
  296. - __le16
  297. - s_mmp_interval
  298. - #. seconds to wait in multi-mount prevention (MMP) checking. In theory,
  299. MMP is a mechanism to record in the superblock which host and device
  300. have mounted the filesystem, in order to prevent multiple mounts. This
  301. feature does not seem to be implemented...
  302. * - 0x168
  303. - __le64
  304. - s_mmp_block
  305. - Block # for multi-mount protection data.
  306. * - 0x170
  307. - __le32
  308. - s_raid_stripe_width
  309. - RAID stripe width. This is the number of logical blocks read from or
  310. written to the disk before coming back to the current disk. This is used
  311. by the block allocator to try to reduce the number of read-modify-write
  312. operations in a RAID5/6.
  313. * - 0x174
  314. - __u8
  315. - s_log_groups_per_flex
  316. - Size of a flexible block group is 2 ^ ``s_log_groups_per_flex``.
  317. * - 0x175
  318. - __u8
  319. - s_checksum_type
  320. - Metadata checksum algorithm type. The only valid value is 1 (crc32c).
  321. * - 0x176
  322. - __le16
  323. - s_reserved_pad
  324. -
  325. * - 0x178
  326. - __le64
  327. - s_kbytes_written
  328. - Number of KiB written to this filesystem over its lifetime.
  329. * - 0x180
  330. - __le32
  331. - s_snapshot_inum
  332. - inode number of active snapshot. (Not used in e2fsprogs/Linux.)
  333. * - 0x184
  334. - __le32
  335. - s_snapshot_id
  336. - Sequential ID of active snapshot. (Not used in e2fsprogs/Linux.)
  337. * - 0x188
  338. - __le64
  339. - s_snapshot_r_blocks_count
  340. - Number of blocks reserved for active snapshot's future use. (Not used in
  341. e2fsprogs/Linux.)
  342. * - 0x190
  343. - __le32
  344. - s_snapshot_list
  345. - inode number of the head of the on-disk snapshot list. (Not used in
  346. e2fsprogs/Linux.)
  347. * - 0x194
  348. - __le32
  349. - s_error_count
  350. - Number of errors seen.
  351. * - 0x198
  352. - __le32
  353. - s_first_error_time
  354. - First time an error happened, in seconds since the epoch.
  355. * - 0x19C
  356. - __le32
  357. - s_first_error_ino
  358. - inode involved in first error.
  359. * - 0x1A0
  360. - __le64
  361. - s_first_error_block
  362. - Number of block involved of first error.
  363. * - 0x1A8
  364. - __u8
  365. - s_first_error_func[32]
  366. - Name of function where the error happened.
  367. * - 0x1C8
  368. - __le32
  369. - s_first_error_line
  370. - Line number where error happened.
  371. * - 0x1CC
  372. - __le32
  373. - s_last_error_time
  374. - Time of most recent error, in seconds since the epoch.
  375. * - 0x1D0
  376. - __le32
  377. - s_last_error_ino
  378. - inode involved in most recent error.
  379. * - 0x1D4
  380. - __le32
  381. - s_last_error_line
  382. - Line number where most recent error happened.
  383. * - 0x1D8
  384. - __le64
  385. - s_last_error_block
  386. - Number of block involved in most recent error.
  387. * - 0x1E0
  388. - __u8
  389. - s_last_error_func[32]
  390. - Name of function where the most recent error happened.
  391. * - 0x200
  392. - __u8
  393. - s_mount_opts[64]
  394. - ASCIIZ string of mount options.
  395. * - 0x240
  396. - __le32
  397. - s_usr_quota_inum
  398. - Inode number of user `quota <quota>`__ file.
  399. * - 0x244
  400. - __le32
  401. - s_grp_quota_inum
  402. - Inode number of group `quota <quota>`__ file.
  403. * - 0x248
  404. - __le32
  405. - s_overhead_blocks
  406. - Overhead blocks/clusters in fs. (Huh? This field is always zero, which
  407. means that the kernel calculates it dynamically.)
  408. * - 0x24C
  409. - __le32
  410. - s_backup_bgs[2]
  411. - Block groups containing superblock backups (if sparse_super2)
  412. * - 0x254
  413. - __u8
  414. - s_encrypt_algos[4]
  415. - Encryption algorithms in use. There can be up to four algorithms in use
  416. at any time; valid algorithm codes are given in the super_encrypt_ table
  417. below.
  418. * - 0x258
  419. - __u8
  420. - s_encrypt_pw_salt[16]
  421. - Salt for the string2key algorithm for encryption.
  422. * - 0x268
  423. - __le32
  424. - s_lpf_ino
  425. - Inode number of lost+found
  426. * - 0x26C
  427. - __le32
  428. - s_prj_quota_inum
  429. - Inode that tracks project quotas.
  430. * - 0x270
  431. - __le32
  432. - s_checksum_seed
  433. - Checksum seed used for metadata_csum calculations. This value is
  434. crc32c(~0, $orig_fs_uuid).
  435. * - 0x274
  436. - __u8
  437. - s_wtime_hi
  438. - Upper 8 bits of the s_wtime field.
  439. * - 0x275
  440. - __u8
  441. - s_mtime_hi
  442. - Upper 8 bits of the s_mtime field.
  443. * - 0x276
  444. - __u8
  445. - s_mkfs_time_hi
  446. - Upper 8 bits of the s_mkfs_time field.
  447. * - 0x277
  448. - __u8
  449. - s_lastcheck_hi
  450. - Upper 8 bits of the s_lastcheck field.
  451. * - 0x278
  452. - __u8
  453. - s_first_error_time_hi
  454. - Upper 8 bits of the s_first_error_time field.
  455. * - 0x279
  456. - __u8
  457. - s_last_error_time_hi
  458. - Upper 8 bits of the s_last_error_time field.
  459. * - 0x27A
  460. - __u8
  461. - s_pad[2]
  462. - Zero padding.
  463. * - 0x27C
  464. - __le16
  465. - s_encoding
  466. - Filename charset encoding.
  467. * - 0x27E
  468. - __le16
  469. - s_encoding_flags
  470. - Filename charset encoding flags.
  471. * - 0x280
  472. - __le32
  473. - s_orphan_file_inum
  474. - Orphan file inode number.
  475. * - 0x284
  476. - __le32
  477. - s_reserved[94]
  478. - Padding to the end of the block.
  479. * - 0x3FC
  480. - __le32
  481. - s_checksum
  482. - Superblock checksum.
  483. .. _super_state:
  484. The superblock state is some combination of the following:
  485. .. list-table::
  486. :widths: 8 72
  487. :header-rows: 1
  488. * - Value
  489. - Description
  490. * - 0x0001
  491. - Cleanly umounted
  492. * - 0x0002
  493. - Errors detected
  494. * - 0x0004
  495. - Orphans being recovered
  496. .. _super_errors:
  497. The superblock error policy is one of the following:
  498. .. list-table::
  499. :widths: 8 72
  500. :header-rows: 1
  501. * - Value
  502. - Description
  503. * - 1
  504. - Continue
  505. * - 2
  506. - Remount read-only
  507. * - 3
  508. - Panic
  509. .. _super_creator:
  510. The filesystem creator is one of the following:
  511. .. list-table::
  512. :widths: 8 72
  513. :header-rows: 1
  514. * - Value
  515. - Description
  516. * - 0
  517. - Linux
  518. * - 1
  519. - Hurd
  520. * - 2
  521. - Masix
  522. * - 3
  523. - FreeBSD
  524. * - 4
  525. - Lites
  526. .. _super_revision:
  527. The superblock revision is one of the following:
  528. .. list-table::
  529. :widths: 8 72
  530. :header-rows: 1
  531. * - Value
  532. - Description
  533. * - 0
  534. - Original format
  535. * - 1
  536. - v2 format w/ dynamic inode sizes
  537. Note that ``EXT4_DYNAMIC_REV`` refers to a revision 1 or newer filesystem.
  538. .. _super_compat:
  539. The superblock compatible features field is a combination of any of the
  540. following:
  541. .. list-table::
  542. :widths: 16 64
  543. :header-rows: 1
  544. * - Value
  545. - Description
  546. * - 0x1
  547. - Directory preallocation (COMPAT_DIR_PREALLOC).
  548. * - 0x2
  549. - “imagic inodes”. Not clear from the code what this does
  550. (COMPAT_IMAGIC_INODES).
  551. * - 0x4
  552. - Has a journal (COMPAT_HAS_JOURNAL).
  553. * - 0x8
  554. - Supports extended attributes (COMPAT_EXT_ATTR).
  555. * - 0x10
  556. - Has reserved GDT blocks for filesystem expansion
  557. (COMPAT_RESIZE_INODE). Requires RO_COMPAT_SPARSE_SUPER.
  558. * - 0x20
  559. - Has directory indices (COMPAT_DIR_INDEX).
  560. * - 0x40
  561. - “Lazy BG”. Not in Linux kernel, seems to have been for uninitialized
  562. block groups? (COMPAT_LAZY_BG)
  563. * - 0x80
  564. - “Exclude inode”. Not used. (COMPAT_EXCLUDE_INODE).
  565. * - 0x100
  566. - “Exclude bitmap”. Seems to be used to indicate the presence of
  567. snapshot-related exclude bitmaps? Not defined in kernel or used in
  568. e2fsprogs (COMPAT_EXCLUDE_BITMAP).
  569. * - 0x200
  570. - Sparse Super Block, v2. If this flag is set, the SB field s_backup_bgs
  571. points to the two block groups that contain backup superblocks
  572. (COMPAT_SPARSE_SUPER2).
  573. * - 0x400
  574. - Fast commits supported. Although fast commits blocks are
  575. backward incompatible, fast commit blocks are not always
  576. present in the journal. If fast commit blocks are present in
  577. the journal, JBD2 incompat feature
  578. (JBD2_FEATURE_INCOMPAT_FAST_COMMIT) gets
  579. set (COMPAT_FAST_COMMIT).
  580. * - 0x1000
  581. - Orphan file allocated. This is the special file for more efficient
  582. tracking of unlinked but still open inodes. When there may be any
  583. entries in the file, we additionally set proper rocompat feature
  584. (RO_COMPAT_ORPHAN_PRESENT).
  585. .. _super_incompat:
  586. The superblock incompatible features field is a combination of any of the
  587. following:
  588. .. list-table::
  589. :widths: 16 64
  590. :header-rows: 1
  591. * - Value
  592. - Description
  593. * - 0x1
  594. - Compression (INCOMPAT_COMPRESSION).
  595. * - 0x2
  596. - Directory entries record the file type. See ext4_dir_entry_2 below
  597. (INCOMPAT_FILETYPE).
  598. * - 0x4
  599. - Filesystem needs recovery (INCOMPAT_RECOVER).
  600. * - 0x8
  601. - Filesystem has a separate journal device (INCOMPAT_JOURNAL_DEV).
  602. * - 0x10
  603. - Meta block groups. See the earlier discussion of this feature
  604. (INCOMPAT_META_BG).
  605. * - 0x40
  606. - Files in this filesystem use extents (INCOMPAT_EXTENTS).
  607. * - 0x80
  608. - Enable a filesystem size of 2^64 blocks (INCOMPAT_64BIT).
  609. * - 0x100
  610. - Multiple mount protection (INCOMPAT_MMP).
  611. * - 0x200
  612. - Flexible block groups. See the earlier discussion of this feature
  613. (INCOMPAT_FLEX_BG).
  614. * - 0x400
  615. - Inodes can be used to store large extended attribute values
  616. (INCOMPAT_EA_INODE).
  617. * - 0x1000
  618. - Data in directory entry (INCOMPAT_DIRDATA). (Not implemented?)
  619. * - 0x2000
  620. - Metadata checksum seed is stored in the superblock. This feature enables
  621. the administrator to change the UUID of a metadata_csum filesystem
  622. while the filesystem is mounted; without it, the checksum definition
  623. requires all metadata blocks to be rewritten (INCOMPAT_CSUM_SEED).
  624. * - 0x4000
  625. - Large directory >2GB or 3-level htree (INCOMPAT_LARGEDIR). Prior to
  626. this feature, directories could not be larger than 4GiB and could not
  627. have an htree more than 2 levels deep. If this feature is enabled,
  628. directories can be larger than 4GiB and have a maximum htree depth of 3.
  629. * - 0x8000
  630. - Data in inode (INCOMPAT_INLINE_DATA).
  631. * - 0x10000
  632. - Encrypted inodes are present on the filesystem. (INCOMPAT_ENCRYPT).
  633. .. _super_rocompat:
  634. The superblock read-only compatible features field is a combination of any of
  635. the following:
  636. .. list-table::
  637. :widths: 16 64
  638. :header-rows: 1
  639. * - Value
  640. - Description
  641. * - 0x1
  642. - Sparse superblocks. See the earlier discussion of this feature
  643. (RO_COMPAT_SPARSE_SUPER).
  644. * - 0x2
  645. - This filesystem has been used to store a file greater than 2GiB
  646. (RO_COMPAT_LARGE_FILE).
  647. * - 0x4
  648. - Not used in kernel or e2fsprogs (RO_COMPAT_BTREE_DIR).
  649. * - 0x8
  650. - This filesystem has files whose sizes are represented in units of
  651. logical blocks, not 512-byte sectors. This implies a very large file
  652. indeed! (RO_COMPAT_HUGE_FILE)
  653. * - 0x10
  654. - Group descriptors have checksums. In addition to detecting corruption,
  655. this is useful for lazy formatting with uninitialized groups
  656. (RO_COMPAT_GDT_CSUM).
  657. * - 0x20
  658. - Indicates that the old ext3 32,000 subdirectory limit no longer applies
  659. (RO_COMPAT_DIR_NLINK). A directory's i_links_count will be set to 1
  660. if it is incremented past 64,999.
  661. * - 0x40
  662. - Indicates that large inodes exist on this filesystem
  663. (RO_COMPAT_EXTRA_ISIZE).
  664. * - 0x80
  665. - This filesystem has a snapshot (RO_COMPAT_HAS_SNAPSHOT).
  666. * - 0x100
  667. - `Quota <Quota>`__ (RO_COMPAT_QUOTA).
  668. * - 0x200
  669. - This filesystem supports “bigalloc”, which means that file extents are
  670. tracked in units of clusters (of blocks) instead of blocks
  671. (RO_COMPAT_BIGALLOC).
  672. * - 0x400
  673. - This filesystem supports metadata checksumming.
  674. (RO_COMPAT_METADATA_CSUM; implies RO_COMPAT_GDT_CSUM, though
  675. GDT_CSUM must not be set)
  676. * - 0x800
  677. - Filesystem supports replicas. This feature is neither in the kernel nor
  678. e2fsprogs. (RO_COMPAT_REPLICA)
  679. * - 0x1000
  680. - Read-only filesystem image; the kernel will not mount this image
  681. read-write and most tools will refuse to write to the image.
  682. (RO_COMPAT_READONLY)
  683. * - 0x2000
  684. - Filesystem tracks project quotas. (RO_COMPAT_PROJECT)
  685. * - 0x8000
  686. - Verity inodes may be present on the filesystem. (RO_COMPAT_VERITY)
  687. * - 0x10000
  688. - Indicates orphan file may have valid orphan entries and thus we need
  689. to clean them up when mounting the filesystem
  690. (RO_COMPAT_ORPHAN_PRESENT).
  691. .. _super_def_hash:
  692. The ``s_def_hash_version`` field is one of the following:
  693. .. list-table::
  694. :widths: 8 72
  695. :header-rows: 1
  696. * - Value
  697. - Description
  698. * - 0x0
  699. - Legacy.
  700. * - 0x1
  701. - Half MD4.
  702. * - 0x2
  703. - Tea.
  704. * - 0x3
  705. - Legacy, unsigned.
  706. * - 0x4
  707. - Half MD4, unsigned.
  708. * - 0x5
  709. - Tea, unsigned.
  710. .. _super_mountopts:
  711. The ``s_default_mount_opts`` field is any combination of the following:
  712. .. list-table::
  713. :widths: 8 72
  714. :header-rows: 1
  715. * - Value
  716. - Description
  717. * - 0x0001
  718. - Print debugging info upon (re)mount. (EXT4_DEFM_DEBUG)
  719. * - 0x0002
  720. - New files take the gid of the containing directory (instead of the fsgid
  721. of the current process). (EXT4_DEFM_BSDGROUPS)
  722. * - 0x0004
  723. - Support userspace-provided extended attributes. (EXT4_DEFM_XATTR_USER)
  724. * - 0x0008
  725. - Support POSIX access control lists (ACLs). (EXT4_DEFM_ACL)
  726. * - 0x0010
  727. - Do not support 32-bit UIDs. (EXT4_DEFM_UID16)
  728. * - 0x0020
  729. - All data and metadata are committed to the journal.
  730. (EXT4_DEFM_JMODE_DATA)
  731. * - 0x0040
  732. - All data are flushed to the disk before metadata are committed to the
  733. journal. (EXT4_DEFM_JMODE_ORDERED)
  734. * - 0x0060
  735. - Data ordering is not preserved; data may be written after the metadata
  736. has been written. (EXT4_DEFM_JMODE_WBACK)
  737. * - 0x0100
  738. - Disable write flushes. (EXT4_DEFM_NOBARRIER)
  739. * - 0x0200
  740. - Track which blocks in a filesystem are metadata and therefore should not
  741. be used as data blocks. This option will be enabled by default on 3.18,
  742. hopefully. (EXT4_DEFM_BLOCK_VALIDITY)
  743. * - 0x0400
  744. - Enable DISCARD support, where the storage device is told about blocks
  745. becoming unused. (EXT4_DEFM_DISCARD)
  746. * - 0x0800
  747. - Disable delayed allocation. (EXT4_DEFM_NODELALLOC)
  748. .. _super_flags:
  749. The ``s_flags`` field is any combination of the following:
  750. .. list-table::
  751. :widths: 8 72
  752. :header-rows: 1
  753. * - Value
  754. - Description
  755. * - 0x0001
  756. - Signed directory hash in use.
  757. * - 0x0002
  758. - Unsigned directory hash in use.
  759. * - 0x0004
  760. - To test development code.
  761. .. _super_encrypt:
  762. The ``s_encrypt_algos`` list can contain any of the following:
  763. .. list-table::
  764. :widths: 8 72
  765. :header-rows: 1
  766. * - Value
  767. - Description
  768. * - 0
  769. - Invalid algorithm (ENCRYPTION_MODE_INVALID).
  770. * - 1
  771. - 256-bit AES in XTS mode (ENCRYPTION_MODE_AES_256_XTS).
  772. * - 2
  773. - 256-bit AES in GCM mode (ENCRYPTION_MODE_AES_256_GCM).
  774. * - 3
  775. - 256-bit AES in CBC mode (ENCRYPTION_MODE_AES_256_CBC).
  776. Total size of the superblock is 1024 bytes.