0

I've been studying ext4 file system contents and stumbled upon this paragraph:

https://ext4.wiki.kernel.org/index.php/Ext4_Disk_Layout#Checksums

It says how blocks of data for different structures are used to generate a checksum through crc32c algorithm. For example:

Ingredients for superblock checksum: The entire superblock up to the checksum field. The UUID lives inside the superblock.

I've decided to check it. Created 1020-bytes binary file containing an entire superblock (1024 bytes minus last 4 bytes that represent an already computed checksum) and ran it through crc32c algo which gave me a checksum different from the one that comes at superblock's tail.

Does anyone happen to know how these checksums are supposed to be calculated (including more complex ones like UUID + inode number + inode generation + the entire inode)? Thanks!

--

P.S. Perhaps, little-endian structures should be inversed to big-endian?

--

The superblock I used:

0031000050C30000C40900000BA90000
F5300000010000000000000000000000
00200000002000000007000000000000
F1CF835C0000FFFF53EF010001000000
F1CF835C000000000000000001000000
000000000B000000800000003C000000
C20200006B0400009AE38F96B26A4909
945E08AFC18DCE2C0000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000001
00000000000000000000000000000000
080000000000000000000000644443C5
9E8640FFA7934FF94A3C626D01014000
0C00000000000000F1CF835C0AF30100
04000000000000000000000000100000
01400000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000004000
00000000000000000000000000000000
01000000000000000000000000000000
00000000040100006911000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000079B7BABE

The hash in the superblock's tail is 79B7BABE

The crc32c hash I got is 41454886

  • 2
    Have you tried looking at the source? – RalfFriedl Mar 9 at 16:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.