I've used Carbon Copy Cloner to copy one external SSD, which is currently about to die, to another one. I also have an online backup of the external drive, but I want to confirm that my cloned copy is exactly the same as the old one.

I can compare individual files using md5sum. Is there a tool I can use to compare every single file on two drives?

  • See this answer: apple.stackexchange.com/q/382345/119271
    – Allan
    Oct 20 '20 at 1:42
  • 1
    Doesn't CCC verify its copy anyway automatically?
    – nohillside
    Oct 20 '20 at 7:41
  • @nohillside I believe it does verify its copy but it is always good to be able to do an independent verification of your own!
    – Jason
    Oct 20 '20 at 17:15

I've found a way to use some command line tools to recursively check hashes of the individual files. Here's my commands:

  1. hashdeep -rel -r . > hashdeep-outout.txt

Hashdeep (which you can install via homebrew) will create a CSV file listing each individual file with various hashes including MD5 and SHA256. -rel lists the files with the relative path to the CWD, so I can run this command on both the old drive, and the new cloned drive, and the file names will be identical.

  1. sort --field-separator=',' --key=4 hashdeep-output.txt > hashdeep-sorted.txt

This sorts the CSV file by filename (the 4th field), so that when I compare the two files (for the old drive, and the new drive) everything will be in the same order.

  1. Then I use just diff to compare the sorted output files. If there is anything which was copied incorrectly, it will let me know because the hashes won't match up.
  • How can hashdeep get installed?
    – nohillside
    Oct 20 '20 at 7:42
  • @nohillside Through homebrew
    – Jason
    Oct 20 '20 at 17:15
  • Maybe you could mention that in your answer, not everybody is aware of this.
    – nohillside
    Oct 20 '20 at 17:35
  • CCC is an rsync client, which uses file checksums by default for file comparison during the copy. I usually run it a second time in case anything got corrupted. That's reassuring enough for me, but I understand why you might want to manually verify. I voted up your answer.
    – Jer
    Oct 21 '20 at 3:23

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .