Should I verify copied files and with which software?

Solution 1:

This discussion seems to suggest that Finder verifies copied files when copying across media (but not otherwise). This means that you don't have to verify it yourself. The only problem is I can't find proof or official confirmation that this is true. So I wouldn't 100% trust it.

In any case, if you want to make sure manually, there are two kinds of tools you can use.

Option 1: Use tools that tell you whether you copied successfully. This QA shows you how to use diff tools (command-line or GUI, your choice) to do it. stuffe's answer to your question shows a quick and dirty way to be reasonably sure the copy operation was ok: just check the total folder sizes.

Option 2: Use rsync. Rsync is a tool that can find differences between the copy source and destination, and update the destination to reflect the source. It's different from cp -R because (1) it tells you if there are differences, so it kind of does that diff does and (2) it only needs to copy over the differences, which makes it faster when the destination is almost up to date.

There are three common ways you might want to use rsync:

  • rsync --dry-run (aka rsync -n) to tell rsync to display what files need to be updated without doing anything. This is basically like diff.
  • Just use rsync to copy files over, and run it again to verify and fix differences.
  • Some people say that Finder copies faster that rsync. You can use Finder to do the initial copy, then use rsync once to verify and fix differences.

Important rsync flags to know:

  • -v, verbose, makes rsync print what is being copied. This is good for the verification step, so you see what didn't get copied right earlier.
  • -a, archive, sets a bunch of other flags that tell rsync to preserve modification time, permissions, etc. If you only want to preserve a subset of file metadata, read the rsync man page to see which flags you want to set.
  • Some people are saying that the version of rsync included with Mac OS does not support copying HFS extended file attributes, which store things like whether the file extension is shown, "Open with…" settings", spotlight comments, tags, etc. To get the latest copy of rsync, install Homebrew and brew install homebrew/dupes/rsync.

Solution 2:

rsync is the tool you want it will do the verify whilst doing the copy and if you are interrupted it can be restarted

Note that OSX's rsync is old and it you care about extended attributes you need a newer version

Solution 3:

If the copy operation is successful, then there should be no need to verify. However, a quick sanity check is to highlight all the files from the top level of the drive, and use Option+cmd+i

Do this for source and destination, and check the number of files matches, and the total file size (doesn't matter if the size on disk differs, this can change depending on your drive configuration).

enter image description here