I am new to linux (my windows system drive died and I can't reinstall windows, so trying a ubuntu live usb)

I am trying to clear a drive so I can install ubuntu properly, so I have copied a directory full off stuff to back up from the drive to another drive, now all I want to do is verify this copy has worked (by reading both copies and making sure they match byte for byte - don't care about metadata)

As I'm running off a live usb, I want as little setup as possible,

I have tried the top answer here: https://stackoverflow.com/questions/1657232/how-can-i-calculate-an-md5-checksum-of-a-directory

And it does not work, for some reason the scan (and du for that matter) just skips a bunch of files in one of the copies (both drives are NTFS btw)

I can't get diffmerge to install, I tried installing meld and that just hung (its 57 gig of data)

Either a direct compare of data, or something that will checksum a directory (file contents, but not meta data) like the sha tools that come with 7zip on windows is fine.

  • The top answer in the Stack Overflow link doesn't mention du. – dsstorefile1 Aug 12 at 22:31
  • 1
    Yeah the du weirdness was a separate issue I had when trying other things. – matt Aug 15 at 2:28
  • I think the reason that SO answer didnt work is because it fails if 2 different files have the same md5 (which I guess would happen if you have copies of the same file in different locations, or 0 length files). In the end I just output the list of files with their hashes to a txt file, then diffed the txt files, ignoring 'moved lines' – matt Aug 15 at 2:29

Use the command above:

diff -r path/to/source-folder path/to/your-copy-folder

Output will tell you are folders diffrent or identical.

  • I don't think this checks the file contents byte for byte tho? – matt Aug 15 at 2:27
  • 1
    @matt no, it checks byte-for-byte – Vlad Gavriuk Aug 15 at 12:36
  • 1
    Thanks! it appears you are right, it seemed to be running very quickly when I ran it on two 60GB folders though, thats why I assumed it didn't. will double check – matt Aug 15 at 23:50

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.