← Documents Documentation/filesystems/ext4/super.rst GitHub 원문 ↗

Linux 6.18.37 · Filesystems

Super Block

ext4의 1024바이트 superblock layout과 모든 feature·policy·algorithm bit 표를 옮긴 전문 번역입니다.

Source pathDocumentation/filesystems/ext4/super.rst
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.

1. 요약·해설

원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.

요약·해설

super.rst:1-839

ext4 superblock은 1024바이트 안에 filesystem geometry, journal·RAID·MMP 정보, checksum, error 좌표, quota·encryption 정보와 호환성 feature bit를 모읍니다.

호환성 집합의 차이가 mount 가능성을 결정합니다. 모르는 `COMPAT` bit는 읽기·쓰기가 가능하고, 모르는 `INCOMPAT` bit는 mount를 중단하며, 모르는 `RO_COMPAT` bit는 read-only mount만 허용합니다.

Superblock 해석 순서
`s_magic == 0xEF53`과 1024바이트 structure 확인block·inode geometry와 UUID·checksum 검증`s_feature_incompat` 지원 여부 확인`s_feature_ro_compat`에 따라 read-write 또는 read-only 결정journal·MMP·error policy·mount option 적용

layout과 feature 집합을 안전하게 판독하는 핵심 흐름입니다.

2. 영어 원문 전체

번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.

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

3. 한국어 전문 번역

영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.

superblock 개요와 `0x0`~`0xFC` field

1-240

superblock은 filesystem 전체의 block·inode 수, 지원 feature, 유지보수 상태 등 핵심 정보를 기록합니다.

`sparse_super` flag가 있으면 superblock과 group descriptor의 중복 사본은 group 0 또는 group number가 3, 5, 7의 거듭제곱인 group에만 둡니다. flag가 없으면 모든 group에 사본을 둡니다.

superblock checksum은 filesystem UUID를 포함하는 `struct ext4_super_block` 전체를 대상으로 계산합니다.

`EXT4_DYNAMIC_REV` 전용 field부터는 compatible과 incompatible feature의 의미가 갈립니다. kernel이 모르는 compatible bit는 읽기·쓰기를 막지 않지만, 모르는 incompatible bit는 mount를 거부해야 합니다. `e2fsck`는 어느 집합이든 모르는 feature가 있으면 중단해야 합니다.

directory preallocation 성능 hint는 `EXT4_FEATURE_COMPAT_DIR_PREALLOC`이 켜진 경우에만 유효하고, journal support field는 `EXT4_FEATURE_COMPAT_HAS_JOURNAL`이 설정된 경우에만 유효합니다.

`struct ext4_super_block` 전반부
Offset크기이름설명
`0x0``__le32``s_inodes_count`전체 inode 수.
`0x4``__le32``s_blocks_count_lo`전체 block 수의 하위 32비트.
`0x8``__le32``s_r_blocks_count_lo`super-user만 할당할 수 있는 reserved block 수의 하위 32비트.
`0xC``__le32``s_free_blocks_count_lo`free block 수의 하위 32비트.
`0x10``__le32``s_free_inodes_count`free inode 수.
`0x14``__le32``s_first_data_block`첫 data block. 1KiB-block filesystem에서는 최소 1이어야 하고, 다른 block size에서는 보통 0입니다.
`0x18``__le32``s_log_block_size`block size는 `2 ^ (10 + s_log_block_size)` 바이트입니다.
`0x1C``__le32``s_log_cluster_size``bigalloc`이 켜졌다면 cluster size는 `2 ^ (10 + s_log_cluster_size)` 바이트입니다. 그렇지 않으면 `s_log_cluster_size`는 `s_log_block_size`와 같아야 합니다.
`0x20``__le32``s_blocks_per_group`group당 block 수.
`0x24``__le32``s_clusters_per_group``bigalloc` 사용 시 group당 cluster 수. 그렇지 않으면 `s_blocks_per_group`와 같아야 합니다.
`0x28``__le32``s_inodes_per_group`group당 inode 수.
`0x2C``__le32``s_mtime`epoch 이후 초 단위 mount 시각.
`0x30``__le32``s_wtime`epoch 이후 초 단위 write 시각.
`0x34``__le16``s_mnt_count`마지막 `fsck` 이후 mount 횟수.
`0x36``__le16``s_max_mnt_count``fsck`가 필요해지는 mount 횟수 한계.
`0x38``__le16``s_magic`magic signature `0xEF53`.
`0x3A``__le16``s_state`filesystem 상태. 아래 `super_state` 표를 참조합니다.
`0x3C``__le16``s_errors`오류 감지 시 동작. 아래 `super_errors` 표를 참조합니다.
`0x3E``__le16``s_minor_rev_level`minor revision level.
`0x40``__le32``s_lastcheck`epoch 이후 초 단위 마지막 검사 시각.
`0x44``__le32``s_checkinterval`검사 사이의 최대 간격(초).
`0x48``__le32``s_creator_os`filesystem을 만든 OS. 아래 `super_creator` 표를 참조합니다.
`0x4C``__le32``s_rev_level`revision level. 아래 `super_revision` 표를 참조합니다.
`0x50``__le16``s_def_resuid`reserved block의 기본 uid.
`0x52``__le16``s_def_resgid`reserved block의 기본 gid.
`0x54``__le32``s_first_ino`첫 non-reserved inode.
`0x58``__le16``s_inode_size`inode structure 크기(바이트).
`0x5A``__le16``s_block_group_nr`이 superblock이 속한 block group number.
`0x5C``__le32``s_feature_compat`compatible feature flag. kernel은 모르는 bit가 있어도 읽고 쓸 수 있지만 `fsck`는 그러면 안 됩니다.
`0x60``__le32``s_feature_incompat`incompatible feature flag. kernel이나 `fsck`가 모르는 bit를 만나면 중단해야 합니다.
`0x64``__le32``s_feature_ro_compat`read-only-compatible feature flag. kernel이 모르는 bit여도 read-only mount는 가능합니다.
`0x68``__u8[16]``s_uuid`volume의 128비트 UUID.
`0x78``char[16]``s_volume_name`volume label.
`0x88``char[64]``s_last_mounted`filesystem이 마지막으로 mount된 directory.
`0xC8``__le32``s_algorithm_usage_bitmap`compression용 bitmap. e2fsprogs와 Linux에서는 사용하지 않습니다.
`0xCC``__u8``s_prealloc_blocks`file에 미리 할당하려 시도할 block 수. e2fsprogs와 Linux에서는 사용하지 않습니다.
`0xCD``__u8``s_prealloc_dir_blocks`directory에 미리 할당할 block 수. e2fsprogs와 Linux에서는 사용하지 않습니다.
`0xCE``__le16``s_reserved_gdt_blocks`향후 filesystem 확장을 위해 예약한 GDT entry 수.
`0xD0``__u8[16]``s_journal_uuid`journal superblock UUID.
`0xE0``__le32``s_journal_inum`journal file의 inode number.
`0xE4``__le32``s_journal_dev`external journal feature가 설정됐을 때 journal file의 device number.
`0xE8``__le32``s_last_orphan`삭제할 orphan inode list의 시작.
`0xEC``__le32[4]``s_hash_seed`HTREE hash seed.
`0xFC``__u8``s_def_hash_version`directory hash에 사용할 기본 hash algorithm. 아래 `super_def_hash` 표를 참조합니다.

원문의 offset, 크기, field 이름과 의미를 보존한 표입니다.

.. 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.

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

   * - Offset
     - Size
     - Name
     - Description
   * - 0x0
     - __le32
     - s_inodes_count
     - Total inode count.
   * - 0x4
     - __le32
     - s_blocks_count_lo
     - Total block count.
   * - 0x8
     - __le32
     - s_r_blocks_count_lo
     - This number of blocks can only be allocated by the super-user.
   * - 0xC
     - __le32
     - s_free_blocks_count_lo
     - Free block count.
   * - 0x10
     - __le32
     - s_free_inodes_count
     - Free inode count.
   * - 0x14
     - __le32
     - s_first_data_block
     - First data block. This must be at least 1 for 1k-block filesystems and
       is typically 0 for all other block sizes.
   * - 0x18
     - __le32
     - s_log_block_size
     - Block size is 2 ^ (10 + s_log_block_size).
   * - 0x1C
     - __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.
   * - 0x20
     - __le32
     - s_blocks_per_group
     - Blocks per group.
   * - 0x24
     - __le32
     - s_clusters_per_group
     - Clusters per group, if bigalloc is enabled. Otherwise
       s_clusters_per_group must equal s_blocks_per_group.
   * - 0x28
     - __le32
     - s_inodes_per_group
     - Inodes per group.
   * - 0x2C
     - __le32
     - s_mtime
     - Mount time, in seconds since the epoch.
   * - 0x30
     - __le32
     - s_wtime
     - Write time, in seconds since the epoch.
   * - 0x34
     - __le16
     - s_mnt_count
     - Number of mounts since the last fsck.
   * - 0x36
     - __le16
     - s_max_mnt_count
     - Number of mounts beyond which a fsck is needed.
   * - 0x38
     - __le16
     - s_magic
     - Magic signature, 0xEF53
   * - 0x3A
     - __le16
     - s_state
     - File system state. See super_state_ for more info.
   * - 0x3C
     - __le16
     - s_errors
     - Behaviour when detecting errors. See super_errors_ for more info.
   * - 0x3E
     - __le16
     - s_minor_rev_level
     - Minor revision level.
   * - 0x40
     - __le32
     - s_lastcheck
     - Time of last check, in seconds since the epoch.
   * - 0x44
     - __le32
     - s_checkinterval
     - Maximum time between checks, in seconds.
   * - 0x48
     - __le32
     - s_creator_os
     - Creator OS. See the table super_creator_ for more info.
   * - 0x4C
     - __le32
     - s_rev_level
     - Revision level. See the table super_revision_ for more info.
   * - 0x50
     - __le16
     - s_def_resuid
     - Default uid for reserved blocks.
   * - 0x52
     - __le16
     - s_def_resgid
     - 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
     - __le32
     - s_first_ino
     - First non-reserved inode.
   * - 0x58
     - __le16
     - s_inode_size
     - Size of inode structure, in bytes.
   * - 0x5A
     - __le16
     - s_block_group_nr
     - Block group # of this superblock.
   * - 0x5C
     - __le32
     - s_feature_compat
     - 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
     - __le32
     - s_feature_incompat
     - 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
     - __le32
     - s_feature_ro_compat
     - 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
     - __u8
     - s_uuid[16]
     - 128-bit UUID for volume.
   * - 0x78
     - char
     - s_volume_name[16]
     - Volume label.
   * - 0x88
     - char
     - s_last_mounted[64]
     - Directory where filesystem was last mounted.
   * - 0xC8
     - __le32
     - s_algorithm_usage_bitmap
     - 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
     - __u8
     - s_prealloc_blocks
     - #. of blocks to try to preallocate for ... files? (Not used in
       e2fsprogs/Linux)
   * - 0xCD
     - __u8
     - s_prealloc_dir_blocks
     - #. of blocks to preallocate for directories. (Not used in
       e2fsprogs/Linux)
   * - 0xCE
     - __le16
     - s_reserved_gdt_blocks
     - Number of reserved GDT entries for future filesystem expansion.
   * -
     -
     -
     - Journalling support is valid only if EXT4_FEATURE_COMPAT_HAS_JOURNAL is
       set.
   * - 0xD0
     - __u8
     - s_journal_uuid[16]
     - UUID of journal superblock
   * - 0xE0
     - __le32
     - s_journal_inum
     - inode number of journal file.
   * - 0xE4
     - __le32
     - s_journal_dev
     - Device number of journal file, if the external journal feature flag is
       set.
   * - 0xE8
     - __le32
     - s_last_orphan
     - Start of list of orphaned inodes to delete.
   * - 0xEC
     - __le32
     - s_hash_seed[4]
     - HTREE hash seed.
   * - 0xFC
     - __u8
     - s_def_hash_version
     - Default hash algorithm to use for directory hashes. See super_def_hash_
       for more info.

superblock `0xFD`~`0x3FC` field

241-500

journal backup type이 0 또는 `EXT3_JNL_BACKUP_BLOCKS`이면 `s_jnl_blocks`는 journal inode block map과 size의 복사본입니다. 64bit 지원용 상위 count field는 원문에 적힌 64bit feature 조건에서만 유효합니다.

후반부는 RAID geometry, MMP, checksum, snapshot, 최초·최종 error 좌표, quota·encryption·encoding, 고해상도 timestamp, orphan file과 최종 checksum을 담습니다.

`struct ext4_super_block` 후반부
Offset크기이름설명
`0xFD``__u8``s_jnl_backup_type`0 또는 `EXT3_JNL_BACKUP_BLOCKS`(1)이면 `s_jnl_blocks`가 journal inode의 `i_block[]` 배열과 `i_size` 복사본을 담습니다.
`0xFE``__le16``s_desc_size``64bit` incompat feature가 설정됐을 때 group descriptor 크기(바이트).
`0x100``__le32``s_default_mount_opts`기본 mount option. 아래 `super_mountopts` 표를 참조합니다.
`0x104``__le32``s_first_meta_bg``meta_bg` feature 사용 시 첫 metablock block group.
`0x108``__le32``s_mkfs_time`epoch 이후 초 단위 filesystem 생성 시각.
`0x10C``__le32[17]``s_jnl_blocks`처음 15개 원소는 journal inode의 `i_block[]` 복사본이고, 16번째와 17번째 원소는 각각 `i_size_high`와 `i_size`입니다.
`0x150``__le32``s_blocks_count_hi`전체 block 수의 상위 32비트.
`0x154``__le32``s_r_blocks_count_hi`reserved block 수의 상위 32비트.
`0x158``__le32``s_free_blocks_count_hi`free block 수의 상위 32비트.
`0x15C``__le16``s_min_extra_isize`모든 inode가 최소한 확보해야 하는 extra byte 수.
`0x15E``__le16``s_want_extra_isize`새 inode가 예약해야 하는 extra byte 수.
`0x160``__le32``s_flags`기타 flag. 아래 `super_flags` 표를 참조합니다.
`0x164``__le16``s_raid_stride`RAID stride. 다음 disk로 이동하기 전에 한 disk에서 읽거나 쓰는 logical block 수이며 metadata 배치 최적화에 쓰입니다.
`0x166``__le16``s_mmp_interval`MMP 검사에서 기다릴 시간(초). MMP는 동시 mount를 막기 위해 어느 host와 device가 filesystem을 mount했는지 기록하는 장치이며, 원문은 이 기능이 구현되지 않은 듯하다고 덧붙입니다.
`0x168``__le64``s_mmp_block`multiple mount protection data가 있는 block number.
`0x170``__le32``s_raid_stripe_width`RAID stripe width. 현재 disk로 돌아오기 전까지 읽거나 쓰는 logical block 수이며 RAID5/6의 read-modify-write를 줄이도록 allocator가 사용합니다.
`0x174``__u8``s_log_groups_per_flex`flexible block group 크기는 `2 ^ s_log_groups_per_flex` group입니다.
`0x175``__u8``s_checksum_type`metadata checksum algorithm type. 유효한 값은 1(`crc32c`)뿐입니다.
`0x176``__u8``s_encryption_level`encryption version level.
`0x177``__u8``s_reserved_pad`다음 32비트 경계까지의 padding.
`0x178``__le64``s_kbytes_written`filesystem 수명 동안 기록한 KiB 수.
`0x180``__le32``s_snapshot_inum`active snapshot inode number. e2fsprogs와 Linux에서는 사용하지 않습니다.
`0x184``__le32``s_snapshot_id`active snapshot의 순차 ID. e2fsprogs와 Linux에서는 사용하지 않습니다.
`0x188``__le64``s_snapshot_r_blocks_count`active snapshot의 향후 사용을 위해 예약한 block 수. e2fsprogs와 Linux에서는 사용하지 않습니다.
`0x190``__le32``s_snapshot_list`on-disk snapshot list head의 inode number. e2fsprogs와 Linux에서는 사용하지 않습니다.
`0x194``__le32``s_error_count`관찰한 error 수.
`0x198``__le32``s_first_error_time`epoch 이후 초 단위 첫 error 발생 시각.
`0x19C``__le32``s_first_error_ino`첫 error에 관련된 inode.
`0x1A0``__le64``s_first_error_block`첫 error에 관련된 block number.
`0x1A8``__u8[32]``s_first_error_func`첫 error가 발생한 function 이름.
`0x1C8``__le32``s_first_error_line`첫 error가 발생한 source line number.
`0x1CC``__le32``s_last_error_time`epoch 이후 초 단위 가장 최근 error 시각.
`0x1D0``__le32``s_last_error_ino`가장 최근 error에 관련된 inode.
`0x1D4``__le32``s_last_error_line`가장 최근 error가 발생한 source line number.
`0x1D8``__le64``s_last_error_block`가장 최근 error에 관련된 block number.
`0x1E0``__u8[32]``s_last_error_func`가장 최근 error가 발생한 function 이름.
`0x200``__u8[64]``s_mount_opts`NUL로 끝나는(ASCIIZ) mount option 문자열.
`0x240``__le32``s_usr_quota_inum`user quota file의 inode number.
`0x244``__le32``s_grp_quota_inum`group quota file의 inode number.
`0x248``__le32``s_overhead_blocks`filesystem overhead block/cluster 수. 이 field가 항상 0이면 kernel이 동적으로 계산합니다.
`0x24C``__le32[2]``s_backup_bgs``sparse_super2` 사용 시 backup superblock을 담는 두 block group.
`0x254``__u8[4]``s_encrypt_algos`사용 중인 encryption algorithm code. 한 번에 최대 네 algorithm을 기록하며 아래 `super_encrypt` 표를 참조합니다.
`0x258``__u8[16]``s_encrypt_pw_salt`encryption string2key algorithm의 salt.
`0x268``__le32``s_lpf_ino``lost+found`의 inode number.
`0x26C``__le32``s_prj_quota_inum`project quota를 추적하는 inode.
`0x270``__le32``s_checksum_seed``metadata_csum` 계산용 checksum seed. 값은 `crc32c(~0, $orig_fs_uuid)`입니다.
`0x274``__u8``s_wtime_hi``s_wtime`의 상위 8비트.
`0x275``__u8``s_mtime_hi``s_mtime`의 상위 8비트.
`0x276``__u8``s_mkfs_time_hi``s_mkfs_time`의 상위 8비트.
`0x277``__u8``s_lastcheck_hi``s_lastcheck`의 상위 8비트.
`0x278``__u8``s_first_error_time_hi``s_first_error_time`의 상위 8비트.
`0x279``__u8``s_last_error_time_hi``s_last_error_time`의 상위 8비트.
`0x27A``__u8``s_first_error_errcode`첫 error의 error code.
`0x27B``__u8``s_last_error_errcode`가장 최근 error의 error code.
`0x27C``__le16``s_encoding`filename character set encoding.
`0x27E``__le16``s_encoding_flags`filename character set encoding flag.
`0x280``__le32``s_orphan_file_inum`orphan file inode number.
`0x284``__le32[94]``s_reserved`block 끝까지 채우는 padding.
`0x3FC``__le32``s_checksum`superblock checksum.

1024바이트 구조의 나머지 field를 offset 순서로 정리합니다.

   * - 0xFD
     - __u8
     - s_jnl_backup_type
     - If this value is 0 or EXT3_JNL_BACKUP_BLOCKS (1), then the
       ``s_jnl_blocks`` field contains a duplicate copy of the inode's
       ``i_block[]`` array and ``i_size``.
   * - 0xFE
     - __le16
     - s_desc_size
     - Size of group descriptors, in bytes, if the 64bit incompat feature flag
       is set.
   * - 0x100
     - __le32
     - s_default_mount_opts
     - Default mount options. See the super_mountopts_ table for more info.
   * - 0x104
     - __le32
     - s_first_meta_bg
     - First metablock block group, if the meta_bg feature is enabled.
   * - 0x108
     - __le32
     - s_mkfs_time
     - When the filesystem was created, in seconds since the epoch.
   * - 0x10C
     - __le32
     - s_jnl_blocks[17]
     - Backup copy of the journal inode's ``i_block[]`` array in the first 15
       elements and i_size_high and i_size in the 16th and 17th elements,
       respectively.
   * -
     -
     -
     - 64bit support is valid only if EXT4_FEATURE_COMPAT_64BIT is set.
   * - 0x150
     - __le32
     - s_blocks_count_hi
     - High 32-bits of the block count.
   * - 0x154
     - __le32
     - s_r_blocks_count_hi
     - High 32-bits of the reserved block count.
   * - 0x158
     - __le32
     - s_free_blocks_count_hi
     - High 32-bits of the free block count.
   * - 0x15C
     - __le16
     - s_min_extra_isize
     - All inodes have at least # bytes.
   * - 0x15E
     - __le16
     - s_want_extra_isize
     - New inodes should reserve # bytes.
   * - 0x160
     - __le32
     - s_flags
     - Miscellaneous flags. See the super_flags_ table for more info.
   * - 0x164
     - __le16
     - s_raid_stride
     - 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
     - __le16
     - s_mmp_interval
     - #. 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
     - __le64
     - s_mmp_block
     - Block # for multi-mount protection data.
   * - 0x170
     - __le32
     - s_raid_stripe_width
     - 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
     - __u8
     - s_log_groups_per_flex
     - Size of a flexible block group is 2 ^ ``s_log_groups_per_flex``.
   * - 0x175
     - __u8
     - s_checksum_type
     - Metadata checksum algorithm type. The only valid value is 1 (crc32c).
   * - 0x176
     - \_\_u8
     - s\_encryption\_level
     - Versioning level for encryption.
   * - 0x177
     - \_\_u8
     - s\_reserved\_pad
     - Padding to next 32bits.
   * - 0x178
     - __le64
     - s_kbytes_written
     - Number of KiB written to this filesystem over its lifetime.
   * - 0x180
     - __le32
     - s_snapshot_inum
     - inode number of active snapshot. (Not used in e2fsprogs/Linux.)
   * - 0x184
     - __le32
     - s_snapshot_id
     - Sequential ID of active snapshot. (Not used in e2fsprogs/Linux.)
   * - 0x188
     - __le64
     - s_snapshot_r_blocks_count
     - Number of blocks reserved for active snapshot's future use. (Not used in
       e2fsprogs/Linux.)
   * - 0x190
     - __le32
     - s_snapshot_list
     - inode number of the head of the on-disk snapshot list. (Not used in
       e2fsprogs/Linux.)
   * - 0x194
     - __le32
     - s_error_count
     - Number of errors seen.
   * - 0x198
     - __le32
     - s_first_error_time
     - First time an error happened, in seconds since the epoch.
   * - 0x19C
     - __le32
     - s_first_error_ino
     - inode involved in first error.
   * - 0x1A0
     - __le64
     - s_first_error_block
     - Number of block involved of first error.
   * - 0x1A8
     - __u8
     - s_first_error_func[32]
     - Name of function where the error happened.
   * - 0x1C8
     - __le32
     - s_first_error_line
     - Line number where error happened.
   * - 0x1CC
     - __le32
     - s_last_error_time
     - Time of most recent error, in seconds since the epoch.
   * - 0x1D0
     - __le32
     - s_last_error_ino
     - inode involved in most recent error.
   * - 0x1D4
     - __le32
     - s_last_error_line
     - Line number where most recent error happened.
   * - 0x1D8
     - __le64
     - s_last_error_block
     - Number of block involved in most recent error.
   * - 0x1E0
     - __u8
     - s_last_error_func[32]
     - Name of function where the most recent error happened.
   * - 0x200
     - __u8
     - s_mount_opts[64]
     - ASCIIZ string of mount options.
   * - 0x240
     - __le32
     - s_usr_quota_inum
     - Inode number of user `quota <quota>`__ file.
   * - 0x244
     - __le32
     - s_grp_quota_inum
     - Inode number of group `quota <quota>`__ file.
   * - 0x248
     - __le32
     - s_overhead_blocks
     - Overhead blocks/clusters in fs. (Huh? This field is always zero, which
       means that the kernel calculates it dynamically.)
   * - 0x24C
     - __le32
     - s_backup_bgs[2]
     - Block groups containing superblock backups (if sparse_super2)
   * - 0x254
     - __u8
     - s_encrypt_algos[4]
     - 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
     - __u8
     - s_encrypt_pw_salt[16]
     - Salt for the string2key algorithm for encryption.
   * - 0x268
     - __le32
     - s_lpf_ino
     - Inode number of lost+found
   * - 0x26C
     - __le32
     - s_prj_quota_inum
     - Inode that tracks project quotas.
   * - 0x270
     - __le32
     - s_checksum_seed
     - Checksum seed used for metadata_csum calculations. This value is
       crc32c(~0, $orig_fs_uuid).
   * - 0x274
     - __u8
     - s_wtime_hi
     - Upper 8 bits of the s_wtime field.
   * - 0x275
     - __u8
     - s_mtime_hi
     - Upper 8 bits of the s_mtime field.
   * - 0x276
     - __u8
     - s_mkfs_time_hi
     - Upper 8 bits of the s_mkfs_time field.
   * - 0x277
     - __u8
     - s_lastcheck_hi
     - Upper 8 bits of the s_lastcheck field.
   * - 0x278
     - __u8
     - s_first_error_time_hi
     - Upper 8 bits of the s_first_error_time field.
   * - 0x279
     - __u8
     - s_last_error_time_hi
     - Upper 8 bits of the s_last_error_time field.
   * - 0x27A
     - \_\_u8
     - s\_first\_error\_errcode
     -
   * - 0x27B
     - \_\_u8
     - s\_last\_error\_errcode
     -
   * - 0x27C
     - __le16
     - s_encoding
     - Filename charset encoding.
   * - 0x27E
     - __le16
     - s_encoding_flags
     - Filename charset encoding flags.
   * - 0x280
     - __le32
     - s_orphan_file_inum
     - Orphan file inode number.
   * - 0x284
     - __le32
     - s_reserved[94]
     - Padding to the end of the block.
   * - 0x3FC
     - __le32
     - s_checksum
     - Superblock checksum.

상태·오류 정책·creator·revision

501-572

`s_state`는 정상 unmount, error 감지, orphan 복구 중 bit를 조합합니다. `s_errors`는 error 뒤 계속 진행, read-only remount, panic 중 하나를 지정합니다.

Superblock state (`s_state`)
설명
`0x0001`정상적으로 unmount됨.
`0x0002`error가 감지됨.
`0x0004`orphan을 복구하는 중.

여러 bit를 조합할 수 있습니다.

Superblock error policy (`s_errors`)
설명
`1`계속 진행.
`2`read-only로 remount.
`3`panic.

오류를 발견했을 때 선택할 동작입니다.

Filesystem creator (`s_creator_os`)
설명
`0`Linux
`1`Hurd
`2`Masix
`3`FreeBSD
`4`Lites

filesystem을 생성한 OS code입니다.

Superblock revision (`s_rev_level`)
설명
`0`원래 format.
`1`dynamic inode size를 지원하는 v2 format.

`EXT4_DYNAMIC_REV`는 revision 1 이상을 뜻합니다.

.. _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.

compatible feature bit

573-623

`s_feature_compat`는 kernel이 이해하지 못해도 filesystem을 계속 읽고 쓸 수 있는 feature 집합입니다. 다만 `fsck`는 모르는 compatible feature가 있으면 filesystem을 수정해서는 안 됩니다.

Compatible features (`s_feature_compat`)
설명
`0x1`directory preallocation (`COMPAT_DIR_PREALLOC`).
`0x2`“imagic inode”. code만으로는 기능이 분명하지 않습니다 (`COMPAT_IMAGIC_INODES`).
`0x4`journal 보유 (`COMPAT_HAS_JOURNAL`).
`0x8`extended attribute 지원 (`COMPAT_EXT_ATTR`).
`0x10`filesystem 확장용 reserved GDT block 보유 (`COMPAT_RESIZE_INODE`). `RO_COMPAT_SPARSE_SUPER`가 필요합니다.
`0x20`directory index 보유 (`COMPAT_DIR_INDEX`).
`0x40`“Lazy BG”. Linux kernel에는 없으며 uninitialized block group용이었던 것으로 보입니다 (`COMPAT_LAZY_BG`).
`0x80`“Exclude inode”. 사용하지 않습니다 (`COMPAT_EXCLUDE_INODE`).
`0x100`snapshot 관련 exclude bitmap의 존재를 나타내는 것으로 보이나 kernel에 정의되지 않고 e2fsprogs에서도 사용하지 않습니다 (`COMPAT_EXCLUDE_BITMAP`).
`0x200`Sparse Super Block v2. `s_backup_bgs`가 backup superblock을 가진 두 block group을 가리킵니다 (`COMPAT_SPARSE_SUPER2`).
`0x400`fast commit 지원. fast commit block이 journal에 실제로 있으면 JBD2 incompat flag `JBD2_FEATURE_INCOMPAT_FAST_COMMIT`도 설정됩니다 (`COMPAT_FAST_COMMIT`).
`0x1000`효율적인 orphan 추적용 orphan file이 할당됨 (`COMPAT_ORPHAN_FILE`). 유효 entry가 있을 수 있으면 `RO_COMPAT_ORPHAN_PRESENT`도 설정합니다.

값은 필요한 bit들의 조합입니다.

.. _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
     - Directory preallocation (COMPAT_DIR_PREALLOC).
   * - 0x2
     - “imagic inodes”. Not clear from the code what this does
       (COMPAT_IMAGIC_INODES).
   * - 0x4
     - Has a journal (COMPAT_HAS_JOURNAL).
   * - 0x8
     - Supports extended attributes (COMPAT_EXT_ATTR).
   * - 0x10
     - Has reserved GDT blocks for filesystem expansion
       (COMPAT_RESIZE_INODE). Requires RO_COMPAT_SPARSE_SUPER.
   * - 0x20
     - Has directory indices (COMPAT_DIR_INDEX).
   * - 0x40
     - “Lazy BG”. Not in Linux kernel, seems to have been for uninitialized
       block groups? (COMPAT_LAZY_BG)
   * - 0x80
     - “Exclude inode”. Not used. (COMPAT_EXCLUDE_INODE).
   * - 0x100
     - “Exclude bitmap”. Seems to be used to indicate the presence of
       snapshot-related exclude bitmaps? Not defined in kernel or used in
       e2fsprogs (COMPAT_EXCLUDE_BITMAP).
   * - 0x200
     - Sparse Super Block, v2. If this flag is set, the SB field s_backup_bgs
       points to the two block groups that contain backup superblocks
       (COMPAT_SPARSE_SUPER2).
   * - 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
       (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).

incompatible feature bit

624-675

`s_feature_incompat`의 bit를 kernel 또는 `fsck`가 이해하지 못하면 처리를 중단해야 합니다. 이 집합은 on-disk 해석을 바꾸는 recovery, extent, 64bit, MMP, flexible group, checksum seed, large directory, inline data와 encryption을 표시합니다.

Incompatible features (`s_feature_incompat`)
설명
`0x1`compression (`INCOMPAT_COMPRESSION`).
`0x2`directory entry가 file type을 기록합니다. `ext4_dir_entry_2` 참조 (`INCOMPAT_FILETYPE`).
`0x4`filesystem recovery가 필요합니다 (`INCOMPAT_RECOVER`).
`0x8`별도 journal device를 사용합니다 (`INCOMPAT_JOURNAL_DEV`).
`0x10`meta block group 사용 (`INCOMPAT_META_BG`).
`0x40`file이 extent를 사용합니다 (`INCOMPAT_EXTENTS`).
`0x80`filesystem 크기를 최대 `2^64` block까지 허용합니다 (`INCOMPAT_64BIT`).
`0x100`multiple mount protection (`INCOMPAT_MMP`).
`0x200`flexible block group 사용 (`INCOMPAT_FLEX_BG`).
`0x400`큰 extended attribute 값을 inode에 저장할 수 있습니다 (`INCOMPAT_EA_INODE`).
`0x1000`directory entry 안의 data (`INCOMPAT_DIRDATA`). 구현되지 않은 것으로 보입니다.
`0x2000`metadata checksum seed를 superblock에 저장합니다. mounted `metadata_csum` filesystem의 UUID를 metadata 전체 재작성 없이 바꿀 수 있게 합니다 (`INCOMPAT_CSUM_SEED`).
`0x4000`2GB보다 큰 directory 또는 3-level htree (`INCOMPAT_LARGEDIR`). 이 기능 전에는 directory가 4GiB를 넘거나 htree가 2단계를 넘을 수 없었고, 사용하면 4GiB 초과와 최대 깊이 3을 허용합니다.
`0x8000`inode 안의 data (`INCOMPAT_INLINE_DATA`).
`0x10000`filesystem에 encrypted inode가 존재합니다 (`INCOMPAT_ENCRYPT`).

모르는 bit가 하나라도 있으면 mount 또는 검사 작업을 중단합니다.

.. _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
     - Compression (INCOMPAT_COMPRESSION).
   * - 0x2
     - Directory entries record the file type. See ext4_dir_entry_2 below
       (INCOMPAT_FILETYPE).
   * - 0x4
     - Filesystem needs recovery (INCOMPAT_RECOVER).
   * - 0x8
     - Filesystem has a separate journal device (INCOMPAT_JOURNAL_DEV).
   * - 0x10
     - Meta block groups. See the earlier discussion of this feature
       (INCOMPAT_META_BG).
   * - 0x40
     - Files in this filesystem use extents (INCOMPAT_EXTENTS).
   * - 0x80
     - Enable a filesystem size of 2^64 blocks (INCOMPAT_64BIT).
   * - 0x100
     - Multiple mount protection (INCOMPAT_MMP).
   * - 0x200
     - Flexible block groups. See the earlier discussion of this feature
       (INCOMPAT_FLEX_BG).
   * - 0x400
     - Inodes can be used to store large extended attribute values
       (INCOMPAT_EA_INODE).
   * - 0x1000
     - Data in directory entry (INCOMPAT_DIRDATA). (Not implemented?)
   * - 0x2000
     - Metadata checksum seed is stored in the superblock. This feature enables
       the administrator to change the UUID of a metadata_csum filesystem
       while the filesystem is mounted; without it, the checksum definition
       requires all metadata blocks to be rewritten (INCOMPAT_CSUM_SEED).
   * - 0x4000
     - Large directory >2GB or 3-level htree (INCOMPAT_LARGEDIR). Prior to
       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
     - Data in inode (INCOMPAT_INLINE_DATA).
   * - 0x10000
     - Encrypted inodes are present on the filesystem. (INCOMPAT_ENCRYPT).

read-only-compatible feature bit

676-737

`s_feature_ro_compat`의 모르는 bit는 read-write mount를 막지만 read-only mount는 허용합니다. sparse superblock, large/huge file, checksum, 큰 inode, snapshot, quota, bigalloc, read-only image, verity와 orphan 상태를 표현합니다.

Read-only-compatible features (`s_feature_ro_compat`)
설명
`0x1`sparse superblock (`RO_COMPAT_SPARSE_SUPER`).
`0x2`2GiB보다 큰 file을 저장한 적이 있습니다 (`RO_COMPAT_LARGE_FILE`).
`0x4`kernel과 e2fsprogs에서 사용하지 않습니다 (`RO_COMPAT_BTREE_DIR`).
`0x8`file size를 512-byte sector가 아니라 logical block 단위로 표현합니다. 매우 큰 file을 뜻합니다 (`RO_COMPAT_HUGE_FILE`).
`0x10`group descriptor checksum을 사용합니다. corruption 감지와 uninitialized group의 lazy formatting에 유용합니다 (`RO_COMPAT_GDT_CSUM`).
`0x20`예전 ext3의 32,000 subdirectory 제한이 적용되지 않습니다 (`RO_COMPAT_DIR_NLINK`). `i_links_count`가 64,999를 넘어 증가하면 1로 설정합니다.
`0x40`큰 inode가 존재합니다 (`RO_COMPAT_EXTRA_ISIZE`).
`0x80`filesystem에 snapshot이 있습니다 (`RO_COMPAT_HAS_SNAPSHOT`).
`0x100`quota 지원 (`RO_COMPAT_QUOTA`).
`0x200`file extent를 block 대신 block cluster 단위로 추적하는 `bigalloc` 지원 (`RO_COMPAT_BIGALLOC`).
`0x400`metadata checksum 지원 (`RO_COMPAT_METADATA_CSUM`). `RO_COMPAT_GDT_CSUM`을 함의하지만 GDT_CSUM bit 자체는 설정하면 안 됩니다.
`0x800`replica 지원. kernel과 e2fsprogs에는 없는 기능입니다 (`RO_COMPAT_REPLICA`).
`0x1000`read-only filesystem image. kernel은 read-write mount하지 않고 대부분의 tool도 image 쓰기를 거부합니다 (`RO_COMPAT_READONLY`).
`0x2000`project quota 추적 (`RO_COMPAT_PROJECT`).
`0x8000`verity inode가 존재할 수 있습니다 (`RO_COMPAT_VERITY`).
`0x10000`orphan file에 유효한 orphan entry가 있을 수 있으므로 mount 시 정리해야 합니다 (`RO_COMPAT_ORPHAN_PRESENT`).

지원하지 않는 bit가 있으면 read-only로만 안전하게 mount할 수 있습니다.

.. _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
       (RO_COMPAT_SPARSE_SUPER).
   * - 0x2
     - This filesystem has been used to store a file greater than 2GiB
       (RO_COMPAT_LARGE_FILE).
   * - 0x4
     - Not used in kernel or e2fsprogs (RO_COMPAT_BTREE_DIR).
   * - 0x8
     - This filesystem has files whose sizes are represented in units of
       logical blocks, not 512-byte sectors. This implies a very large file
       indeed! (RO_COMPAT_HUGE_FILE)
   * - 0x10
     - Group descriptors have checksums. In addition to detecting corruption,
       this is useful for lazy formatting with uninitialized groups
       (RO_COMPAT_GDT_CSUM).
   * - 0x20
     - Indicates that the old ext3 32,000 subdirectory limit no longer applies
       (RO_COMPAT_DIR_NLINK). A directory's i_links_count will be set to 1
       if it is incremented past 64,999.
   * - 0x40
     - Indicates that large inodes exist on this filesystem
       (RO_COMPAT_EXTRA_ISIZE).
   * - 0x80
     - This filesystem has a snapshot (RO_COMPAT_HAS_SNAPSHOT).
   * - 0x100
     - `Quota <Quota>`__ (RO_COMPAT_QUOTA).
   * - 0x200
     - This filesystem supports “bigalloc”, which means that file extents are
       tracked in units of clusters (of blocks) instead of blocks
       (RO_COMPAT_BIGALLOC).
   * - 0x400
     - This filesystem supports metadata checksumming.
       (RO_COMPAT_METADATA_CSUM; implies RO_COMPAT_GDT_CSUM, though
       GDT_CSUM must not be set)
   * - 0x800
     - Filesystem supports replicas. This feature is neither in the kernel nor
       e2fsprogs. (RO_COMPAT_REPLICA)
   * - 0x1000
     - Read-only filesystem image; the kernel will not mount this image
       read-write and most tools will refuse to write to the image.
       (RO_COMPAT_READONLY)
   * - 0x2000
     - Filesystem tracks project quotas. (RO_COMPAT_PROJECT)
   * - 0x8000
     - 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).

hash·mount option·flag·encryption

738-839

`s_def_hash_version`은 directory hash algorithm을 고르고, `s_default_mount_opts`는 기본 mount 동작을 bit 조합으로 저장합니다. `s_flags`는 directory hash 부호 처리와 개발 시험 상태를 기록합니다.

Directory hash (`s_def_hash_version`)
설명
`0x0`Legacy.
`0x1`Half MD4.
`0x2`Tea.
`0x3`Legacy, unsigned.
`0x4`Half MD4, unsigned.
`0x5`Tea, unsigned.

directory index의 기본 hash algorithm code입니다.

Default mount options (`s_default_mount_opts`)
설명
`0x0001`(re)mount할 때 debug 정보를 출력합니다 (`EXT4_DEFM_DEBUG`).
`0x0002`새 file은 현재 process의 `fsgid` 대신 상위 directory의 gid를 물려받습니다 (`EXT4_DEFM_BSDGROUPS`).
`0x0004`userspace가 제공하는 extended attribute를 지원합니다 (`EXT4_DEFM_XATTR_USER`).
`0x0008`POSIX ACL을 지원합니다 (`EXT4_DEFM_ACL`).
`0x0010`32비트 UID를 지원하지 않습니다 (`EXT4_DEFM_UID16`).
`0x0020`모든 data와 metadata를 journal에 commit합니다 (`EXT4_DEFM_JMODE_DATA`).
`0x0040`metadata를 journal에 commit하기 전에 모든 data를 disk로 flush합니다 (`EXT4_DEFM_JMODE_ORDERED`).
`0x0060`data 순서를 보존하지 않아 metadata 기록 뒤에 data가 기록될 수 있습니다 (`EXT4_DEFM_JMODE_WBACK`).
`0x0100`write flush를 끕니다 (`EXT4_DEFM_NOBARRIER`).
`0x0200`metadata block을 추적해 data block으로 사용하지 않게 합니다 (`EXT4_DEFM_BLOCK_VALIDITY`). 원문은 3.18에서 기본 활성화 예정이라고 설명합니다.
`0x0400`사용하지 않게 된 block을 storage device에 알리는 DISCARD를 켭니다 (`EXT4_DEFM_DISCARD`).
`0x0800`delayed allocation을 끕니다 (`EXT4_DEFM_NODELALLOC`).

여러 기본 option bit를 조합할 수 있습니다.

Miscellaneous flags (`s_flags`)
설명
`0x0001`signed directory hash 사용 중.
`0x0002`unsigned directory hash 사용 중.
`0x0004`development code 시험용.

directory hash와 개발 시험 관련 flag입니다.

Encryption algorithms (`s_encrypt_algos`)
설명
`0`유효하지 않은 algorithm (`ENCRYPTION_MODE_INVALID`).
`1`XTS mode의 256-bit AES (`ENCRYPTION_MODE_AES_256_XTS`).
`2`GCM mode의 256-bit AES (`ENCRYPTION_MODE_AES_256_GCM`).
`3`CBC mode의 256-bit AES (`ENCRYPTION_MODE_AES_256_CBC`).

목록에는 다음 algorithm code를 최대 네 개까지 담을 수 있습니다.

ext4 superblock의 전체 크기는 1024바이트입니다.

.. _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
     - Print debugging info upon (re)mount. (EXT4_DEFM_DEBUG)
   * - 0x0002
     - New files take the gid of the containing directory (instead of the fsgid
       of the current process). (EXT4_DEFM_BSDGROUPS)
   * - 0x0004
     - Support userspace-provided extended attributes. (EXT4_DEFM_XATTR_USER)
   * - 0x0008
     - Support POSIX access control lists (ACLs). (EXT4_DEFM_ACL)
   * - 0x0010
     - Do not support 32-bit UIDs. (EXT4_DEFM_UID16)
   * - 0x0020
     - All data and metadata are committed to the journal.
       (EXT4_DEFM_JMODE_DATA)
   * - 0x0040
     - All data are flushed to the disk before metadata are committed to the
       journal. (EXT4_DEFM_JMODE_ORDERED)
   * - 0x0060
     - Data ordering is not preserved; data may be written after the metadata
       has been written. (EXT4_DEFM_JMODE_WBACK)
   * - 0x0100
     - Disable write flushes. (EXT4_DEFM_NOBARRIER)
   * - 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,
       hopefully. (EXT4_DEFM_BLOCK_VALIDITY)
   * - 0x0400
     - Enable DISCARD support, where the storage device is told about blocks
       becoming unused. (EXT4_DEFM_DISCARD)
   * - 0x0800
     - Disable delayed allocation. (EXT4_DEFM_NODELALLOC)

.. _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
     - Invalid algorithm (ENCRYPTION_MODE_INVALID).
   * - 1
     - 256-bit AES in XTS mode (ENCRYPTION_MODE_AES_256_XTS).
   * - 2
     - 256-bit AES in GCM mode (ENCRYPTION_MODE_AES_256_GCM).
   * - 3
     - 256-bit AES in CBC mode (ENCRYPTION_MODE_AES_256_CBC).

Total size of the superblock is 1024 bytes.