@@ -372,7 +372,8 @@ Contains the upper 32-bit of the value
372
372
| 368 | 4 | | [yellow-background]*Unknown (blocks on all data disks (N*stride))*
373
373
| 372 | 1 | | Flex block group size +
374
374
The size is stored as: 2 ^ value
375
- | 373 | 1 | | [yellow-background]*Unknown (metadata checksum method)*
375
+ | 373 | 1 | | Checksum type +
376
+ See section: <<checksum_types,checksum types>>
376
377
| 374 | 1 | | [yellow-background]*Unknown (encryption level)*
377
378
| 375 | 1 | | [yellow-background]*Unknown (padding)*
378
379
| 376 | 8 | | [yellow-background]*Unknown (s_kbytes_written)*
@@ -413,13 +414,16 @@ The size is stored as: 2 ^ value
413
414
| 618 | 2 | | [yellow-background]*Unknown (s_encoding_flags)*
414
415
| 620 | 4 | | [yellow-background]*Unknown (s_orphan_file_inum)*
415
416
| 624 | 94 x 4 | | [yellow-background]*Unknown (reserved)*
416
- | 1000 | 4 | | [yellow-background]*Unknown (s_checksum)*
417
+ | 1000 | 4 | | Checksum
417
418
|===
418
419
419
420
[NOTE]
420
421
Some versions of mkfs.ext set the file system creation time even for ext2 and
421
422
when EXT3_FEATURE_COMPAT_HAS_JOURNAL is not set.
422
423
424
+ The checksum, if checksum type is CRC-32C, contain a CRC-32 of data in the
425
+ superblock before the checksum. The checksum is stored as 0xffffffff - CRC-32C.
426
+
423
427
[yellow-background]*Is the only way to determine the file system version the
424
428
compatibility and equivalent flags?*
425
429
@@ -514,7 +518,7 @@ and COMPAT_ can be used interchangeably.
514
518
| 0x00001000 | EXT4_FEATURE_INCOMPAT_DIRDATA | Data in directory entry +
515
519
[yellow-background]*Not yet supported, in development*
516
520
| 0x00002000 | EXT4_FEATURE_INCOMPAT_CSUM_SEED +
517
- EXT4_FEATURE_INCOMPAT_BG_USE_META_CSUM | Metadata checksum seed is stored in the superblock
521
+ EXT4_FEATURE_INCOMPAT_BG_USE_META_CSUM | Initial metadata checksum value (or seed) is stored in the superblock
518
522
| 0x00004000 | EXT4_FEATURE_INCOMPAT_LARGEDIR | Large directory >2GB or 3-level hash tree (HTree).
519
523
| 0x00008000 | EXT4_FEATURE_INCOMPAT_INLINE_DATA | Has data stored in inode.
520
524
| 0x00010000 | EXT4_FEATURE_INCOMPAT_ENCRYPT | Has encrypted inodes.
@@ -547,11 +551,11 @@ The size of an inode can be larger than ext2 inode size.
547
551
| 0x00000100 | EXT4_FEATURE_RO_COMPAT_QUOTA | Quota is handled transactionally with the journal.
548
552
| 0x00000200 | EXT4_FEATURE_RO_COMPAT_BIGALLOC | Has big block allocation bitmaps. +
549
553
Block allocation bitmaps are tracked in units of clusters (of blocks) instead of blocks.
550
- | 0x00000400 | EXT4_FEATURE_RO_COMPAT_METADATA_CSUM | Supports metadata checksum .
554
+ | 0x00000400 | EXT4_FEATURE_RO_COMPAT_METADATA_CSUM | File system metadata has checksums .
551
555
| 0x00000800 | EXT4_FEATURE_RO_COMPAT_REPLICA | Supports replicas.
552
556
| 0x00001000 | EXT4_FEATURE_RO_COMPAT_READONLY | Read-only file system image.
553
- | 0x00002000 | EXT4_FEATURE_RO_COMPAT_PROJECT | Filesystem tracks project quotas.
554
- | 0x00004000 | EXT4_FEATURE_RO_COMPAT_SHARED_BLOCKS | Filesystem has (read-only) shared blocks.
557
+ | 0x00002000 | EXT4_FEATURE_RO_COMPAT_PROJECT | File system tracks project quotas.
558
+ | 0x00004000 | EXT4_FEATURE_RO_COMPAT_SHARED_BLOCKS | File system has (read-only) shared blocks.
555
559
| 0x00008000 | EXT4_FEATURE_RO_COMPAT_VERITY | [yellow-background]*Unknown (Verity inodes may be present on the filesystem.)*
556
560
| 0x00010000 | EXT4_FEATURE_RO_COMPAT_ORPHAN_PRESENT | Orphan file may be non-empty.
557
561
|===
@@ -565,6 +569,14 @@ In some ext file systems used by ChromeOS it has been observed that the upper
565
569
8-bits of the read-only compatible features flags are set as in 0xff000003.
566
570
debugfs identifies these as FEATURE_R24 - FEATURE_R31.
567
571
572
+ === [[checksum_types]]Checksum types
573
+
574
+ [cols="1,1,5",options="header"]
575
+ |===
576
+ | Value | Identifier | Description
577
+ | 1 | EXT4_CRC32C_CHKSUM | CRC-32C (or CRC32-C), which uses the Castagnoli polynomial (0x1edc6f41)
578
+ |===
579
+
568
580
== The group descriptor table
569
581
570
582
The group descriptor table is stored in the block following the super block.
@@ -623,10 +635,10 @@ Value contains the block number relative from the start of the volume +
623
635
[yellow-background]*The excluded bitmap is used for snapshots*
624
636
| 24 | 2 | | Block bitmap checksum +
625
637
Contains the lower 16-bit of the value if 64-bit support (EXT4_FEATURE_INCOMPAT_64BIT) is enabled +
626
- The checksum is a CRC-32 [yellow-background]*TODO: crc32c(s_uuid+grp_num+bbitmap)*
638
+ The checksum is a CRC-32C [yellow-background]*TODO: crc32c(s_uuid+grp_num+bbitmap)*
627
639
| 26 | 2 | | Inode bitmap checksum +
628
640
Contains the lower 16-bit of the value if 64-bit support (EXT4_FEATURE_INCOMPAT_64BIT) is enabled +
629
- The checksum is a CRC-32 [yellow-background]*TODO: crc32c(s_uuid+grp_num+ibitmap)*
641
+ The checksum is a CRC-32C [yellow-background]*TODO: crc32c(s_uuid+grp_num+ibitmap)*
630
642
| 28 | 2 | | Number of unused inodes +
631
643
Contains the lower 16-bit of the value if 64-bit support (EXT4_FEATURE_INCOMPAT_64BIT) is enabled +
632
644
| 30 | 2 | | Checksum +
@@ -655,10 +667,10 @@ Value contains the block number relative from the start of the volume +
655
667
[yellow-background]*The excluded bitmap is used for snapshots*
656
668
| 56 | 2 | | Block bitmap checksum +
657
669
Contains the upper 16-bit of the value +
658
- The checksum is a CRC-32 [yellow-background]*TODO: crc32c(s_uuid+grp_num+bbitmap)*
670
+ The checksum is a CRC-32C [yellow-background]*TODO: crc32c(s_uuid+grp_num+bbitmap)*
659
671
| 60 | 2 | | Inode bitmap checksum +
660
672
Contains the upper 16-bit of the value +
661
- The checksum is a CRC-32 [yellow-background]*TODO: crc32c(s_uuid+grp_num+ibitmap)*
673
+ The checksum is a CRC-32C [yellow-background]*TODO: crc32c(s_uuid+grp_num+ibitmap)*
662
674
| 64 | 4 | | [yellow-background]*Unknown (reserved)*
663
675
|===
664
676
@@ -886,7 +898,7 @@ block numbers contain the minor and major device number respectively.
886
898
887
899
=== The ext4 inode
888
900
889
- The ext4 inode is 156 bytes of size and consists of:
901
+ The ext4 inode is 160 bytes of size and consists of:
890
902
891
903
[cols="1,1,1,5",options="header"]
892
904
|===
@@ -944,22 +956,34 @@ Also see: <<ext4_extent,The ext4 extent>> or <<ext4_extent_index,The ext4 extent
944
956
| 118 | 2 | | Upper part of file ACL (or extended attributes) block number
945
957
| 120 | 2 | | Upper part of owner (or user) identifier (UID)
946
958
| 122 | 2 | | Upper part of group identifier (GID)
947
- | 124 | 2 | | Lower part of checksum
959
+ | 124 | 2 | | Lower part of checksum +
960
+ Contains the lower 16-bit of the checksum value
948
961
| 126 | 2 | | [yellow-background]*Unknown (reserved)*
949
962
| 128 | 2 | | Extended inode size
950
- | 130 | 2 | | Upper part of checksum
963
+ | 130 | 2 | | Upper part of checksum +
964
+ Contains the upper 16-bit of the checksum value
951
965
| 132 | 4 | | (last) inode change time extra precision
952
966
| 136 | 4 | | (last) modification time extra precision
953
967
| 140 | 4 | | (last) access time extra precision
954
968
| 144 | 4 | | Creation time
955
969
| 148 | 4 | | Creation time extra precision
956
970
| 152 | 4 | | [yellow-background]*Unknown (upper part of version)*
971
+ | 156 | 4 | | [yellow-background]*Unknown (i_projid)*
957
972
|===
958
973
959
974
[NOTE]
960
975
For a character and block device the first 2 bytes of the array of direct
961
976
block numbers contain the minor and major device number respectively.
962
977
978
+ The checksum, if checksum type is CRC-32C, contain a CRC-32 of:
979
+
980
+ * file system identifier in the superblock
981
+ * inode number
982
+ * NFS generation number in the inode
983
+ * data of the inode with the lower and upper part of the checksum set to 0-byte values.
984
+
985
+ The checksum is stored as 0xffffffff - CRC-32C.
986
+
963
987
[yellow-background]*TODO describe extra precision*
964
988
965
989
==== Notes
0 commit comments