I use USB drives with a combination of TimeMachine and a bootable disk clone for backup and disaster recovery. The bootable clone is there for when the disk drive crashes hard and I need to do work. The TimeMachine backup is there for when I say, "what ever happened to that file I deleted 2 months ago?" I use 2 identical external drives to safeguard against those "oh shit, my house blew up" moments.
I have a 200 GB drive in the macbook. I bought 2 500 GB drives and put them in USB enclosures. I partitioned both backup drives identically:
My 200 GB drive shows up as 186.3 GB in disk utility so I created one partition on the external that was 186.3 GB as GUID (not apple partition map). I immediately did a "Get Info", went to "Ownership and Permissions", and unchecked "Ignore ownership on this drive." This makes it bootable (GUID) and it maintains perms giving you a good, bootable clone of your internal drive.
Create a second partition that fills up the rest of the disk. This is where you will save your TimeMachine backups. My partition is 279 GB.
Configure TimeMachine to backup to the larger partition. Let it complete the first backup. (btw, I have TimeMachine set to OFF all the time. I only do backups when I want them... This is up to you.)
Open Terminal and cd to /Volumes to see how your external drive is mounted. Figure out which volume is the TimeMachine partition and which is your disk clone partition. My disk clone partition is called macBack500GB (not the best name, i should have called it macClone or something)
Anyway, once you figure it out, go ahead and clone your drive by running the following command.
sudo rsync -vaxE --delete --ignore-errors --progress / /Volumes/macBack500GB/
Beware of the slashes and be sure to change macBack500GB to whatever you called your clone partition. Make sure you don't accidentally type something wrong. this could destroy all your data and your TimeMachine backup if you screw up...
To test the clone, wait till the rsync is complete and reboot your machine. Hold the option key down as it starts and select the external drive. You will boot into your external drive and everything will look exactly like your main drive. great! shut down, unplug the drive. You're done.
Repeat the steps using the second backup drive. Take that drive to work and lock it in a drawer. You now have the offsite backup.
The next time you want to back up (sooner rather than later) simply plug in the drive and tell TimeMachine to do its magic. It should just work. When it finishes run the rsync command.
NOTE: If you're low on space the command might fail on large files. It does this because rsync makes sure the large file is completely copied before it deletes the original. In other words, you wind up with 2 copies of a large file for a second.
Mine fails on /var/vm/sleepimage and a 32 GB parallels VM file. Before I run rsync, i browse to my external partition and delete those files. I'm sure there are flags in rsync to fix this behavior, but I haven't bothered to figure them out.
tl;dr;
plug in the drive.
Tell TimeMachine to "Back Up Now."
delete the parallels VM from the external drive
delete var/vm/sleepimage from the external drive
sudo rsync -vaxE --delete --ignore-errors --progress / /Volumes/macBack500GB/
repeat for the second drive.
Special thanks to http://jwz.livejournal.com/801607.html for the tips on the rsync part.
UPDATE 20100707: after my laptop got stolen, i bought a new one with snow leopard. restoring it with Time Machine worked great. the next time I tried backing up the drive with rsync it hung. First on /private/var/vm/sleepimage then on others. After an hour or two of fighting with it I did a sudo port install rsync and everything works again. Apparently there's a problem with snow leopard's rsync.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment