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.


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


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?

  • 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. – Sandra Dec 8 '12 at 23:40
  • 1
    @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. – ewwhite Dec 8 '12 at 23:42

@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)

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.