Ronald F. Guilmette
rfg at tristatelogic.com
Wed Sep 30 20:19:35 UTC 2015
For some time now I've been using rsync on FreeBSD to make my system
backups. Recently, I accidentally rm'd some files from one directory
and I had to go and fetch copies off of my backup drive. After I had
done so, I found that about 1/5 of them were corrupted. (They were
all .jpg files, by the way.)
To be clear, I most certainly *do not* attribute the apparent corruption
to rsync. My backup drive is itself slightly dubious... a retired
(so-called ``refurbished'') WD Black 1TB drive which the S.M.A.R.T.
info showed already had well more than 30,000 hours on it before I
ever laid hands on it. Also, and separately, I've been trying to use
it... and others like it... in one of these open-on-the-top slot
loading external/powered SATA to USB3 adapters. As I have learned
recently, 2.5" drives are generally no problem to use with such
adapters, but unless you have a utility fan pointing right at it,
3.5" drives that are placed into one of those adapters can pretty
quickly get REALLY hot... a fact which, taken alone, may actually be
the root cause of the file corruption on my backup drive.
So anyway, I have a 1TB backup drive now that is chock full of
files that I placed on it previously (using rsync)... the majority
of which, by volume, are binary media files (i.e. mp3 songs, JPEGs,
movies, etc.) and now I'd like to carefully check them all to see
which ones may have gotten corrupted.
So, my question: How best to do this?
Looking at the rsync man page, I see a couple of options that may
perhaps be relevant, specifically:
-c, --checksum skip based on checksum, not mod-time & size
-n, --dry-run perform a trial run with no changes made
Can I use these to, in effect, check all of my backup files for integrity?
Please note that the options I have been using to make my backups are
-v -t -axHAXS --delete --fileflags --force-change
I don't imagine that either the -n or -c options will interact badly with
any of those, correct?
More information about the rsync