16

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
  • 9,973
  • 37
  • 104
  • 160

2 Answers2

17

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?

ewwhite
  • 194,921
  • 91
  • 434
  • 799
  • 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 08 '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](http://prefetch.net/blog/index.php/2012/02/13/installing-zfs-on-a-centos-6-linux-server/). 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 08 '12 at 23:42
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)

akostadinov
  • 1,118
  • 1
  • 9
  • 18