April 22, 2009
Circumventing My Own Retardation
Since I'm too lazy to upgrade my Mac to OS 10.5, I've been using JWZ's backup strategy. For those who don't want to click, it boils down to: Find new hard drives that match your internal drive's connection type and capacity (bigger is allowed). Place the internal drive into an encolsure to make it an external drive. Then, use rsync to copy your whole hard drive to the new drive, making a swap-in bootable backup.
One day, rsync reported a disk-full error and my Mac's hard drive was full. Really full -- the status bar actually said, "Zero KB available." But the backup drive had 200 GB free. What the hell?
After some rooting around, and copying some of my
pr0n important documents over to another external drive, I was able to run another backup.
The next morning, rsync had failed again and the drive was almost full again. Time to reformat the backup drive, I guess.
Call up Disk Utility and select the backup drive. Volume name: "Backup". Mounted at... "Backup 1"?!
Fire up the console and cd to /Volumes for a look-see. I get: Jason, Backup, and Backup 1. Backup 1 hasn't been updated since the fifth; Backup is current. OK, select Backup on the desktop (which is mounted to Backup 1 in the command line, remember), and "eject" it.
Crank off another ls -al and Backup 1 is gone. Backup is still there. OK, something ain't right here.
> umount /Volumes/Backup
/Volumes/Backup: not currently mounted.
So, nothing mounted at the mount point I'm staring at. Poke around in the ghost backup, and it's a full copy of my drive from the last successful backup. And my hard drive is almost full.
I form a hypothesis: At some point I ran rsync without actually having the backup disk mounted. Being utterly obedient (and running as root thanks to sudo) it dutifully created the directory /Volumes/Backup and filled my hard drive with... my hard drive. When I tried to mount the actual disk, it saw something in /Volumes taking up space with its name, and adapted as best it could. And since rsync runs from the command line it doesn't work around the goof-up like the UI does. It goes by the mount point, not the disk volume name.
Which leaves me at: I have a good, if outdated, backup on the external drive, and only one way to test the hypothesis.
> sudo rm -r /Volumes/Backup
A few minutes later when rm returned, I still had a functioning computer and 60 gigs of free space. Plugged the backup drive back in, and it mounted in the proper place. So I set off rsync and grabbed myself a beer.
So to recap:
- I attempted to run rsync to a drive that wasn't currently mounted.
- When rsync ran it did exactly what I asked even though it didnt have an external drive to write to and did the copy to another directory on the primary drive.
- This went on for three weeks, until my sparseimage got so big the primary drive couldn't store two copies of it. During this time my backup drive did absolutely nothing.
- Unmounting the drive showed the non-existent drive still present.
- Deleting everything on the drive reclaimed the space being taken up by the duplicates, and allowed the external drive to mount in the proper place.
I left out the steps that involved cussing and drinking, but that's the basic gist. Moral of the story: Your failing backups and your full hard drive are probably related.
Edit: And now that I've written that, one of the commenters on JWZ's page mentioned that exact same problem. Meaning (1) I'm not the only retard out there (2) Everything old is new again.
Edit, 4/29: Formatting to make the commands stand out a bit.