I'm trying to copy files off of a drive that is failing. It hasn't failed yet :)
Basically it keeps disconnecting every 30 seconds. macOS then automatically remounts it, but Finder is having issues copying files.
So I'm trying to use rsync -a --progress
, but every time the drive disconnects rsync just "keeps going", and fills the rest of the file with… I dunno, something. I'd assume it'd write zeros, but it's writing actual data according to hexdump
. In any case, it's not accurate data.
I've been able to reproduce the behavior by rsync'ing from a random SD card. If I pull the card while copying a 4gb file rsync just zips through and writes a full 4GB file, even though that's nonsense.
How do I get rsync to stop copying phantom data when a drive is disconnected??
The problem is that in 2020, macOS ships with a version of rsync from 2006.