Keeping a Hot Backup of Your Mac Hard Drive

Disk UtilityYou don’t really understand the importance of backups until your hard drive crashes. With most backups, you’ll need to reinstall the operating system and then restore all of your data. OS X comes with a handy tool that will let you create a live copy of your hard drive that can be started up and run just like it is your computer.

My Powerbook had to go in for some repairs a few months ago, but I couldn’t afford to be without my computer for 3 days. By creating a live bootable copy of my entire computer to an external drive, I was able to ship off my laptop, plug my hard drive into an old G3 iMac, and continue working just like I was on my Powerbook. It was slower of course, but I still had access to all of my data, programs and settings. When the Powerbook came back, I simply copied the external hard drive over my laptop hard drive, rebooted and continued working with very little downtime.

This feature is part of the Disk Utility application stored in your Application > Utilities folder. It is simple to use, but you have to pay attention to make sure you are copying your data in the correct direction–you don’t want to accidentally copy an old backup over your working data.

Drive ListingWhen you launch Disk Utility, it will show you a list of the available drives on your computer. In the example, I have my internal hard drive (a 74.5 GB hitachi) with a single partition called Macintosh HD. My 232 GB LaCie drive has three partitions, Test, Backup, and Storage. The Backup directory is where I want to put my data.

In the right hand side of the application, I’m going to select the Restore tab. I’m going to “restore” my internal drive into the Backup partition on my external drive. This will make the Backup partition into an exact copy of my local drive–even changing its name to Machintosh HD.

With the Restore tab selected I simply drag Machintosh HD into the source and Backup into the destination and tell it to erase the destination. At this point I always double check carefully to make sure my source and destination are correct and that I’m not accidentally going to overwrite important data.

Source and Destination

Clicking on the Restore button starts the process. It isn’t particularly fast. Ideally you should make the partition you are restoring to as close in size to the original in order for the transfer to be as efficient as possible.

Startup Disk

If you ever need to bootup the drive on another computer simply tell that computer to start using the external drive as the startup drive. This is done from the System Preferences using the Startup Disk icon.

Once you reboot the system, it should boot up using the external hard drive as if it is the system you backed up originally.

To restore from your hard drive, you’ll simply perform the restore process, but this time moving the data from your external drive back to your computer’s internal drive.

If you found this article interesting you might like the article about backing up DVDs to your hard drive: Travelling with Movies on your Mac.

This Post Sponsored by:

92 thoughts on “Keeping a Hot Backup of Your Mac Hard Drive”

  1. Does anyone know a way a automate this process, so that it could happen regularly in the background on a schedule? I’m the kind of person that would start something like this, do it for a few days, then forget about it, until my hard drive crashed.

  2. I’m working on a solution for this because I have the same problem. Once I get it figured out, I’ll post another article detailing how to do it. Basically, it will be a script that is run by cron every night. I’m hoping I can make it check for the presence of the external hard drive and only do the backup if it is online.

  3. Use Carbon Copy Cloner to automate this process. Or SuperDuper or any of the other drive cloning software out there. CCC is free, thats why I recommend it. I run a backup every Wednesday and Sunday on schedule with CCC.

  4. My method is a terminal job that runs at login, which is a simple saved rsync command. I just back up my user folder, but in principle this could be extended to the whole drive (I assume). Rsync has the advantage that it only moves those files which have changed – usually the script is done in a couple minutes.

    The command takes the form of

    sudo rsync -rlptv –delete /Volumes/(internal hard drive)/Users/ /Volumes/(external hard drive)/Users/

    I just save that command as a .term file and add it to my login items.

  5. I recommend using rsync to keep the firewire-drive update. The benefits of rsync, a Unix command line app: It copies only files changed since last restore. So it speeds up things a lot after the first complete backup.

    I’m using it once a week to backup my data. It’s nice to have a 1:1 copy of your OS at hand. Restoring after a HD crash takes maybe 30mins – 1hr, not more. Every settings you made will be present again. Nice, ain’t it?

  6. Another alternative is to use rsync (or rsyncX) to create a clone without copying every file, every time.

    Also, instead of using cron, an daily backup command can simply be added to /etc/daily.local. This will include “custom” commands in the pre-existing scheduled process. Results will be written to /var/log/daily.out.

  7. Or automate it using rsync. Once you have made the backup once, use rsync to copy over _just the changes_. Do you really want to be duplicating your entire Music/Photo/Video library each time?

  8. Try this :


    #!/bin/sh

    echo “#########################”
    echo “### Server backup”
    echo “### `date`”
    echo ” ”

    if [ -d “/Volumes/Mac OS X 1” ] ; then
    echo “!!! Error : Something went wrong the last time”
    echo “### ”
    echo “### `date`”
    echo “### Backup failed”
    echo “#########################”
    echo ” ”
    exit 1
    fi

    if [ -d “/Volumes/Sauvegarde” ] ; then
    echo “### destination volume /Volumes/Sauvegarde found”
    else
    echo “!!! Error : Destination volume absent”
    echo “### ”
    echo “### `date`”
    echo “### Backup failed”
    echo “#########################”
    echo ” ”
    exit 1
    fi

    /usr/sbin/asr -erase -noprompt -source /Volumes/Mac\ OS\ X -target /Volumes/Sauvegarde

    /usr/sbin/diskutil rename /Volumes/Mac\ OS\ X\ 1 Sauvegarde

    echo “### `date`”
    echo “### End of backup”
    echo “#########################”
    echo ” ”
    You have to rename the disk at the end, because asr does a plain clone, including the volume name.

    The check for Mac OS X 1 is because one day something went wrong in the middle of the backup, and the machine rebooted. As there were two Volumes named Mac OS X , one of them was labelled Mac OS X 1 internally. AND IT WAS THE BOOT VOLUME !!! I could get it fixed before my script would have renamed the internal disk to “Sauvegarde” and backed up the bacup to the internal disk at the next run.
    This problem is mainly because my backup-disk is firewire, and I have two of them (even and odd days) and therefore I can’t use /dev/diskxx sthle addressing, because it’s never the same address when I swap disks.

    Hope this helps.

    Rainer

  9. Ah yes, and the major advantage of using asr this way is you can do it using crontab, and you don’t need a user being logged in (as with SuperDuper AFAIK ?)

    Rainer

  10. I’ve designed a script for using Rsync to automate backups on our mac xserve systems. I’ve tried all the methods as it is my job to do so and nothing beats this for a live system. The only way you will get a true mirror using these applications (diskutil, superduper, ccc, etc) is to put your drive into target mode.

    You will get a working functional copy of the drive, but not a 100% mirror image.

    To the top poster (B-Bone):
    Use Automator and iCal to create a script that will do these things for you. Once you create the script in automator simply save it as an application then use the alarm in iCal to schedult the process to be run nightly.

  11. “without needing to restart or “boot to dos” like you usually have to in Windows.”

    yes, windows is bad, blah blah blah. Interesting article but this sort of statement is just lame. I work with four OSes both professionally and for fun and all have their strengths and weaknesses. In the case of Apple the main weakness probably are the religious nuts.

  12. Once you do this, Backup is now called “Macintosh HD”, so you have two “Macintosh HD”s, right? So do you rename the external copy back to “Backup”? What system do you use to keep it straight in your head?

  13. Is there a way to get Carbon Copy CLoner to wake the computer from sleep mode to do schedued backups? I have it set for 3AM but the backups never happen cause the comps asleep.

  14. Even better, if you don’t mind taking some time to set it up, is to use the external drive to set up a mirrored RAID set. That way, the external drive is always an exact mirror of the internal drive, and the internal drive can fail completely with no disruption or loss of data (in fact, you might not even notice).

    I did this a few months ago on my Mac at home, and it has worked flawlessly. I can unplug the external drive, and when I plug it back in my computer automatically starts re-copying the internal drive. Completely transparent.

    I wrote about this on my blog: here.

  15. Use ditto and cron to automate this on the cheap
    ditto -c $SOURCEDISK_ROOT – | ( cd $DSTDISK_ROOT; ditto -x – )

    I used ditto for the same purpose as the author above ..

    Cheers
    Reimer

  16. open a terminal and type “man asr”. This will show the documentation for the “asr” command. Disk Utility is a GUI for the asr command. You can script the asr command.

  17. I have found rsync to be invaluable for doing backups of my data. It will save off incremental copies (files that change every day, for instance) if you want and is completely automatable. Not only that, but it can also work over a network, allowing you to keep a copy of your backup onto a seaparate system (which doesn’t HAVE to be a Mac). This makes the concept of a “backup server” possible–a system dedicated to storing the backups of many systems at once.

    On the down side, it does take some knowledge of rsync and shell scripting (or perl) to actually do the backups. But what I get in return is the ability to recovery any accidentally deleted document, or a previous version of a document (which I may have overwritten a number of times since an important change was made).

    –lar3ry

  18. I second using SuperDuper. SuperDuper allows smart updates (only updates the files that have changed) and you can set up complex backup schedules easily (ie. – backup nightly but alternate between two different backup partitions every two weeks giving you a larger window to find and recover corrupted files that may have become seated in the daily backup schedule).

  19. I use Deja Vu and it creates a perfect clone and it will do incramental backups and you can schedule them for anytime you want.

  20. There is a tool called Carbon Copy Cloner that will do the same sort of thing; I prefer it in a lot of cases. It uses the ditto command which is a fail safe copy (if CCC encounteres a file it can’t copy it just skips it and keeps going) It also has the option to set up an automatic backup schedule. One warning I should give: OS updates can sometimes overwrite the schedule requiring that it be set up again.

    http://www.bombich.com/software/ccc.html

  21. Why not just make a raid array with the external drive? When the computer is unplugged, the drive works just fine. When you plug it back in, it catches up automatically.

  22. Couldn’t you make the folder on the computer to automaticly update by using a folder action? Something like, when the file is written here, copy it to the live backup folder there?

    I do not currently have a Mac, but the power of scripting and automatic folders seems like it is a no brainer to me.

    LW_Will

  23. I’ve used Carbon Copy Cloner and SuperDooper to back up and they both work very well. I personally like SD better because of its interface and ease of use.

  24. SuperDuper has one other benefit, besides doing this drop dead easily.
    It lets you creat yet another version of your Mac OS on yet another partition, but this one is tiny- about 12 gigs.
    You name it “sandbox” and it shares all your apps and files with you main hard drive. All that’s on it is the OS itself. You can boot to it whenever Apple issues a new OS update or you want to try out some new application that you’re concerned might screw up your system and then install the program onto the Sandbox drive. Then see how things run for a couple of days. If everything’s oK, reboot into your main drive and install there too. If it’s a nightmare, no problem, go back to your main drive, which is pristine. GREAT IDEA!!
    I love my superduper. Best $20 I’ve ever spent.

  25. we have been using ChronoSync for a year and it too has been great.

    We actually use it to clone our servers (incrementaly) every night.

    we also use rsync to backup over the net… but have problems with resource forks… so beware!

  26. I used to use Lacie’s Silverkeeper, but after a disk loss when I had to restore from a backup disk I discovered that (as some ex-users have reported) it does not reliably copy updated files to the backup disk, even when it reports success. This is an EXTREMELY dangerous failure, in that the user beleives it has been successful; the simplicity, speed, and clarity of the command-line rsync ultimately proved best for me. It’s built into the OS and is extremely confirgurable.

  27. Anyone using rsync should look at rsnapshot, which is a wrapper around rsync. By using Unix hard-links it is able to keep multiple backups available (hourly, daily, weekly and monthly) without using very much disk space.

  28. 2 questions…
    How do you restore the backup, with/without working OS?
    Does this work on OSx86 PC installs OK?
    thnx

  29. Once you do this, Backup is now called “Macintosh HD”, so you have two “Macintosh HD”s, right? So do you rename the external copy back to “Backup”? What system do you use to keep it straight in your head?

    The external drive shows up as orange and the internal one shows up as silver. So far that has been the easiest way to tell them apart, but you can also rename the external drive.

  30. Couldn’t you make the folder on the computer to automaticly update by using a folder action? Something like, when the file is written here, copy it to the live backup folder there?

    I do not currently have a Mac, but the power of scripting and automatic folders seems like it is a no brainer to me.

    That would probably be useful for backing up your documents folder, but my goal was to create a bootable HD that I could use in place of my computer and then copy back later. If there is a way to use folder actions and keep the drive bootable, Ii’d be interested to hear about it.

  31. Even better, if you don’t mind taking some time to set it up, is to use the external drive to set up a mirrored RAID set. That way, the external drive is always an exact mirror of the internal drive, and the internal drive can fail completely with no disruption or loss of data (in fact, you might not even notice).

    That is an interesting idea. I’m going to definately have to try that because it would be much faster.

  32. “without needing to restart or “boot to dos” like you usually have to in Windows.”

    yes, windows is bad, blah blah blah. Interesting article but this sort of statement is just lame. I work with four OSes both professionally and for fun and all have their strengths and weaknesses. In the case of Apple the main weakness probably are the religious nuts.

    Ok…. I don’t see anywhere that I said that OS X is better than Windows. I use both regularly along with Linux and a few different t ypes of Unix. You are correct that both have their strengths and weaknesses. I’ve done a lot of work with imaging computers so I thought it was pretty impressive that I could just image my hard drive while I was still actively using the OS and then I could take the drive and boot it up on pretty much any other Apple.

    Everyone needs a way to backup their system. I personally think the built in tools in OS X are better than what you can do with any of the built in tools on Windows. If you feel differently then you could post an intelligent comment explaining your view. Otherwise your comments make you appear more like a (to borrow your vocabulary) “religious nut” than anything else.

  33. I used to use Lacie’s Silverkeeper, but after a disk loss when I had to restore from a backup disk I discovered that (as some ex-users have reported) it does not reliably copy updated files to the backup disk, even when it reports success. This is an EXTREMELY dangerous failure, in that the user beleives it has been successful; the simplicity, speed, and clarity of the command-line rsync ultimately proved best for me. It’s built into the OS and is extremely confirgurable.

    Yikes. That is good to know. The best thing about LaCie is the way the way their hard drives look. I’ve had several fail on me. It sounds like their software is built the same way.

  34. You could always use rsync, combined with ssh ofcourse.
    rsync -a –delete –delete-excluded –exclude=”Movies/*” -e ssh /Users/shortname/ username@host:/home/username/backup
    That command rox 🙂

  35. I use http://www.decimus.net/synk/ – it is free for academic use and cheap for others, it is easy to use and it does incremental backup so it works faster than copying the whole disk. The Silverkeeper program does incremental as well but it doesn’t work for impremental backup if your disks are the same size and you have one folder that is larger than the remaining free space.

Leave a Reply