How to get checksum data integrity on ext4?

13,226

Solution 1

Ext4 doesn't have an equivalent to a ZFS or btrfs "scrub", however, a recent feature is metadata checksumming. Using it would require a very new kernel and an updated e2fsprogs.

What distribution are you using?

Solution 2

@ewwhite answer is correct. I just want to stress that: NO - data cannot be checksummed in ext4 or XFS at this time. I also couldn't find anything related to checksumming for JFS. So the only reliable option so far is to check linux ZFS. BTRFS is not so stable at this time.

I'm writing the above because I've just hit bad silent write corruption on my router vs USB external drive and now I do not anymore trust USB as a reliable interconnect. So additional checksumming is required. (and I mean that the drive is completely healthy but router USB is flacky)

Share:
13,226

Related videos on Youtube

Sandra
Author by

Sandra

Updated on September 18, 2022

Comments

  • Sandra
    Sandra over 1 year

    On file systems like btrfs you can preform a scrub, which will go though all the data to see if the data still matches the file system checksum.

    I would like to check the data on ext4 if it is correct before a backup.

    Question

    ext4 doesn't have file system checksum, but can something similar be made?

  • Sandra
    Sandra over 11 years
    I had no idea that ext4 were being extended. Sadly I see that I would need to reformat the partition to get this feature. So maybe I should just make a script that will do a sha1sum of each file and store it in a yaml file... Using CentOS 6.
  • ewwhite
    ewwhite over 11 years
    @sandra But you also use ZFS (from your other questions)... Over the past few weeks, I've been using ZFS on Linux with my CentOS 6 systems using this guide. It's been solid in testing and I'm planning to move it into production. It may be an elegant solution for your use case.