super.rst 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818
  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_hi field.
  451. * - 0x278
  452. - \_\_u8
  453. - s\_first_error_time_hi
  454. - Upper 8 bits of the s_first_error_time_hi field.
  455. * - 0x279
  456. - \_\_u8
  457. - s\_last_error_time_hi
  458. - Upper 8 bits of the s_last_error_time_hi 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\_reserved[95]
  474. - Padding to the end of the block.
  475. * - 0x3FC
  476. - \_\_le32
  477. - s\_checksum
  478. - Superblock checksum.
  479. .. _super_state:
  480. The superblock state is some combination of the following:
  481. .. list-table::
  482. :widths: 8 72
  483. :header-rows: 1
  484. * - Value
  485. - Description
  486. * - 0x0001
  487. - Cleanly umounted
  488. * - 0x0002
  489. - Errors detected
  490. * - 0x0004
  491. - Orphans being recovered
  492. .. _super_errors:
  493. The superblock error policy is one of the following:
  494. .. list-table::
  495. :widths: 8 72
  496. :header-rows: 1
  497. * - Value
  498. - Description
  499. * - 1
  500. - Continue
  501. * - 2
  502. - Remount read-only
  503. * - 3
  504. - Panic
  505. .. _super_creator:
  506. The filesystem creator is one of the following:
  507. .. list-table::
  508. :widths: 8 72
  509. :header-rows: 1
  510. * - Value
  511. - Description
  512. * - 0
  513. - Linux
  514. * - 1
  515. - Hurd
  516. * - 2
  517. - Masix
  518. * - 3
  519. - FreeBSD
  520. * - 4
  521. - Lites
  522. .. _super_revision:
  523. The superblock revision is one of the following:
  524. .. list-table::
  525. :widths: 8 72
  526. :header-rows: 1
  527. * - Value
  528. - Description
  529. * - 0
  530. - Original format
  531. * - 1
  532. - v2 format w/ dynamic inode sizes
  533. Note that ``EXT4_DYNAMIC_REV`` refers to a revision 1 or newer filesystem.
  534. .. _super_compat:
  535. The superblock compatible features field is a combination of any of the
  536. following:
  537. .. list-table::
  538. :widths: 16 64
  539. :header-rows: 1
  540. * - Value
  541. - Description
  542. * - 0x1
  543. - Directory preallocation (COMPAT\_DIR\_PREALLOC).
  544. * - 0x2
  545. - “imagic inodes”. Not clear from the code what this does
  546. (COMPAT\_IMAGIC\_INODES).
  547. * - 0x4
  548. - Has a journal (COMPAT\_HAS\_JOURNAL).
  549. * - 0x8
  550. - Supports extended attributes (COMPAT\_EXT\_ATTR).
  551. * - 0x10
  552. - Has reserved GDT blocks for filesystem expansion
  553. (COMPAT\_RESIZE\_INODE). Requires RO\_COMPAT\_SPARSE\_SUPER.
  554. * - 0x20
  555. - Has directory indices (COMPAT\_DIR\_INDEX).
  556. * - 0x40
  557. - “Lazy BG”. Not in Linux kernel, seems to have been for uninitialized
  558. block groups? (COMPAT\_LAZY\_BG)
  559. * - 0x80
  560. - “Exclude inode”. Not used. (COMPAT\_EXCLUDE\_INODE).
  561. * - 0x100
  562. - “Exclude bitmap”. Seems to be used to indicate the presence of
  563. snapshot-related exclude bitmaps? Not defined in kernel or used in
  564. e2fsprogs (COMPAT\_EXCLUDE\_BITMAP).
  565. * - 0x200
  566. - Sparse Super Block, v2. If this flag is set, the SB field s\_backup\_bgs
  567. points to the two block groups that contain backup superblocks
  568. (COMPAT\_SPARSE\_SUPER2).
  569. * - 0x400
  570. - Fast commits supported. Although fast commits blocks are
  571. backward incompatible, fast commit blocks are not always
  572. present in the journal. If fast commit blocks are present in
  573. the journal, JBD2 incompat feature
  574. (JBD2\_FEATURE\_INCOMPAT\_FAST\_COMMIT) gets
  575. set (COMPAT\_FAST\_COMMIT).
  576. .. _super_incompat:
  577. The superblock incompatible features field is a combination of any of the
  578. following:
  579. .. list-table::
  580. :widths: 16 64
  581. :header-rows: 1
  582. * - Value
  583. - Description
  584. * - 0x1
  585. - Compression (INCOMPAT\_COMPRESSION).
  586. * - 0x2
  587. - Directory entries record the file type. See ext4\_dir\_entry\_2 below
  588. (INCOMPAT\_FILETYPE).
  589. * - 0x4
  590. - Filesystem needs recovery (INCOMPAT\_RECOVER).
  591. * - 0x8
  592. - Filesystem has a separate journal device (INCOMPAT\_JOURNAL\_DEV).
  593. * - 0x10
  594. - Meta block groups. See the earlier discussion of this feature
  595. (INCOMPAT\_META\_BG).
  596. * - 0x40
  597. - Files in this filesystem use extents (INCOMPAT\_EXTENTS).
  598. * - 0x80
  599. - Enable a filesystem size of 2^64 blocks (INCOMPAT\_64BIT).
  600. * - 0x100
  601. - Multiple mount protection (INCOMPAT\_MMP).
  602. * - 0x200
  603. - Flexible block groups. See the earlier discussion of this feature
  604. (INCOMPAT\_FLEX\_BG).
  605. * - 0x400
  606. - Inodes can be used to store large extended attribute values
  607. (INCOMPAT\_EA\_INODE).
  608. * - 0x1000
  609. - Data in directory entry (INCOMPAT\_DIRDATA). (Not implemented?)
  610. * - 0x2000
  611. - Metadata checksum seed is stored in the superblock. This feature enables
  612. the administrator to change the UUID of a metadata\_csum filesystem
  613. while the filesystem is mounted; without it, the checksum definition
  614. requires all metadata blocks to be rewritten (INCOMPAT\_CSUM\_SEED).
  615. * - 0x4000
  616. - Large directory >2GB or 3-level htree (INCOMPAT\_LARGEDIR). Prior to
  617. this feature, directories could not be larger than 4GiB and could not
  618. have an htree more than 2 levels deep. If this feature is enabled,
  619. directories can be larger than 4GiB and have a maximum htree depth of 3.
  620. * - 0x8000
  621. - Data in inode (INCOMPAT\_INLINE\_DATA).
  622. * - 0x10000
  623. - Encrypted inodes are present on the filesystem. (INCOMPAT\_ENCRYPT).
  624. .. _super_rocompat:
  625. The superblock read-only compatible features field is a combination of any of
  626. the following:
  627. .. list-table::
  628. :widths: 16 64
  629. :header-rows: 1
  630. * - Value
  631. - Description
  632. * - 0x1
  633. - Sparse superblocks. See the earlier discussion of this feature
  634. (RO\_COMPAT\_SPARSE\_SUPER).
  635. * - 0x2
  636. - This filesystem has been used to store a file greater than 2GiB
  637. (RO\_COMPAT\_LARGE\_FILE).
  638. * - 0x4
  639. - Not used in kernel or e2fsprogs (RO\_COMPAT\_BTREE\_DIR).
  640. * - 0x8
  641. - This filesystem has files whose sizes are represented in units of
  642. logical blocks, not 512-byte sectors. This implies a very large file
  643. indeed! (RO\_COMPAT\_HUGE\_FILE)
  644. * - 0x10
  645. - Group descriptors have checksums. In addition to detecting corruption,
  646. this is useful for lazy formatting with uninitialized groups
  647. (RO\_COMPAT\_GDT\_CSUM).
  648. * - 0x20
  649. - Indicates that the old ext3 32,000 subdirectory limit no longer applies
  650. (RO\_COMPAT\_DIR\_NLINK). A directory's i\_links\_count will be set to 1
  651. if it is incremented past 64,999.
  652. * - 0x40
  653. - Indicates that large inodes exist on this filesystem
  654. (RO\_COMPAT\_EXTRA\_ISIZE).
  655. * - 0x80
  656. - This filesystem has a snapshot (RO\_COMPAT\_HAS\_SNAPSHOT).
  657. * - 0x100
  658. - `Quota <Quota>`__ (RO\_COMPAT\_QUOTA).
  659. * - 0x200
  660. - This filesystem supports “bigalloc”, which means that file extents are
  661. tracked in units of clusters (of blocks) instead of blocks
  662. (RO\_COMPAT\_BIGALLOC).
  663. * - 0x400
  664. - This filesystem supports metadata checksumming.
  665. (RO\_COMPAT\_METADATA\_CSUM; implies RO\_COMPAT\_GDT\_CSUM, though
  666. GDT\_CSUM must not be set)
  667. * - 0x800
  668. - Filesystem supports replicas. This feature is neither in the kernel nor
  669. e2fsprogs. (RO\_COMPAT\_REPLICA)
  670. * - 0x1000
  671. - Read-only filesystem image; the kernel will not mount this image
  672. read-write and most tools will refuse to write to the image.
  673. (RO\_COMPAT\_READONLY)
  674. * - 0x2000
  675. - Filesystem tracks project quotas. (RO\_COMPAT\_PROJECT)
  676. * - 0x8000
  677. - Verity inodes may be present on the filesystem. (RO\_COMPAT\_VERITY)
  678. .. _super_def_hash:
  679. The ``s_def_hash_version`` field is one of the following:
  680. .. list-table::
  681. :widths: 8 72
  682. :header-rows: 1
  683. * - Value
  684. - Description
  685. * - 0x0
  686. - Legacy.
  687. * - 0x1
  688. - Half MD4.
  689. * - 0x2
  690. - Tea.
  691. * - 0x3
  692. - Legacy, unsigned.
  693. * - 0x4
  694. - Half MD4, unsigned.
  695. * - 0x5
  696. - Tea, unsigned.
  697. .. _super_mountopts:
  698. The ``s_default_mount_opts`` field is any combination of the following:
  699. .. list-table::
  700. :widths: 8 72
  701. :header-rows: 1
  702. * - Value
  703. - Description
  704. * - 0x0001
  705. - Print debugging info upon (re)mount. (EXT4\_DEFM\_DEBUG)
  706. * - 0x0002
  707. - New files take the gid of the containing directory (instead of the fsgid
  708. of the current process). (EXT4\_DEFM\_BSDGROUPS)
  709. * - 0x0004
  710. - Support userspace-provided extended attributes. (EXT4\_DEFM\_XATTR\_USER)
  711. * - 0x0008
  712. - Support POSIX access control lists (ACLs). (EXT4\_DEFM\_ACL)
  713. * - 0x0010
  714. - Do not support 32-bit UIDs. (EXT4\_DEFM\_UID16)
  715. * - 0x0020
  716. - All data and metadata are commited to the journal.
  717. (EXT4\_DEFM\_JMODE\_DATA)
  718. * - 0x0040
  719. - All data are flushed to the disk before metadata are committed to the
  720. journal. (EXT4\_DEFM\_JMODE\_ORDERED)
  721. * - 0x0060
  722. - Data ordering is not preserved; data may be written after the metadata
  723. has been written. (EXT4\_DEFM\_JMODE\_WBACK)
  724. * - 0x0100
  725. - Disable write flushes. (EXT4\_DEFM\_NOBARRIER)
  726. * - 0x0200
  727. - Track which blocks in a filesystem are metadata and therefore should not
  728. be used as data blocks. This option will be enabled by default on 3.18,
  729. hopefully. (EXT4\_DEFM\_BLOCK\_VALIDITY)
  730. * - 0x0400
  731. - Enable DISCARD support, where the storage device is told about blocks
  732. becoming unused. (EXT4\_DEFM\_DISCARD)
  733. * - 0x0800
  734. - Disable delayed allocation. (EXT4\_DEFM\_NODELALLOC)
  735. .. _super_flags:
  736. The ``s_flags`` field is any combination of the following:
  737. .. list-table::
  738. :widths: 8 72
  739. :header-rows: 1
  740. * - Value
  741. - Description
  742. * - 0x0001
  743. - Signed directory hash in use.
  744. * - 0x0002
  745. - Unsigned directory hash in use.
  746. * - 0x0004
  747. - To test development code.
  748. .. _super_encrypt:
  749. The ``s_encrypt_algos`` list can contain any of the following:
  750. .. list-table::
  751. :widths: 8 72
  752. :header-rows: 1
  753. * - Value
  754. - Description
  755. * - 0
  756. - Invalid algorithm (ENCRYPTION\_MODE\_INVALID).
  757. * - 1
  758. - 256-bit AES in XTS mode (ENCRYPTION\_MODE\_AES\_256\_XTS).
  759. * - 2
  760. - 256-bit AES in GCM mode (ENCRYPTION\_MODE\_AES\_256\_GCM).
  761. * - 3
  762. - 256-bit AES in CBC mode (ENCRYPTION\_MODE\_AES\_256\_CBC).
  763. Total size of the superblock is 1024 bytes.