We have Leopard Server running in our small software company, with user’s machines backed up to the server via Time Machine, and other important data stored on the server such as our intranet pages. So it is vital that we make backups of this server. That’s the easy bit – we can use Time Machine on the server itself, saving to an external drive, so that all changes are saved each hour, and Time Machine can restore files when required.

However, it is also important that we have offsite backups – in case the building catches fire, or the backup hard drive dies. This is where a rotating set of external hard drives would come in useful.

The Challenge

Time Machine easily backs up to an external USB or Firewire drive. The challenge is that Time Machine can only back up to a single drive. We could eject the drive, then plug in another, but Time Machine is still looking for the first drive so we’d have to manually change Time Machine settings to backup to this second drive. And then when we swap again, we’d have to do this all over again. That is too much work.

The Solution

Here is the solution I came up with. I’ll explain what I did first, then the limitations of this solution.

I started with the following: two 1TB external firewire 800 drives. The drives we bought were the Lacie 1TB Big Disk Extreme +.

I plugged the first drive in to the Mac Pro we are using (running Leopard Server). I changed its volume name to “Backup” and set it up as a Time Machine backup drive. I let Leopard Server do an initial backup.

Next I started the Terminal application, and from the command line looked at the contents of the backup drive, via “ls -a /Volumes/Backup“. The results were as follows:

Your drive will have a different number file name than the .001f5b310098 our drive has.

I copied this .001f5b310098 file to a temporary directory, and plugged in the other 1TB drive. When mounted, I changed its name to Backup, and created a directory structure to match the one on the first drive. I also copied the .001f5b310098 file over to this new drive.

Now I ejected both drives, and plugged in the second. Leopard assumed it was the same drive as the first, and used it for Time Machine backups. I ejected that drive, plugged in the first, and once again, Leopard assumed it was the same drive, and performed a Time Machine backup.

So basically, we now had rotating disks working with Time Machine. I could eject the drive each week, take it off site, and replace it with the other drive, then swap them again the following week.

Hot Swap

The trouble with the system so far is that I need to go to the machine and manually eject the backup drive each week, then plug the other drive in. That means I need to either ssh in, remote desktop in, or go to the machine itself in the server room and have a screen connected to it at all times. This is a server machine – I really want hot swappable drives.

The Lacie drives we bought have a shortcut button – a button you can push and usually (by default) it runs EMC Retrospect. I didn’t want to use EMC Retrospect, but I installed the software anyway as I had an idea. Not quite “hot swappable” drives, but close enough that I don’t need to have a keyboard or screen attached to swap the drives.

I created an AppleScript that the Lacie Shortcut software would run on pressing the shortcut button the drive, and installed it following the instructions that came with the drive (basically there is a system preference to do this once you install the software). The idea of the script is to eject the drive when I push the button, so that I can safely remove it and plug in the next drive in rotation.

But I wanted a bit more. First, I need to know it ejected it without issue, but I don’t want to have a monitor attached. So I made the script talk – telling me if there was an error, or if it ejected the drive without incident.

Second, most of the time the machine has the volume off. So I wanted it to increase the volume for the voice, then go back to the original volume – so we don’t hear beeps etc. when someone logs in remotely to the machine.

Third, if I made a mistake about ejecting the drive, I wanted a push of the button to remount the drive.

So, the following is the script I came up with. You can download the script here.

The result

So now, at the start of each week I can enter the office, go to the server, press the shortcut button, wait for the voice to say “Backup is now ejected”, safely remove the drive, then take the second drive, and plug it in. Leopard assumes it is the same drive, and continues doing incremental backups. The first drive now is taken away and is the offsite backup.

Limitations

There are some limitations to this solution.

First, anything backed up in the previous week will be on the offsite drive. The onsite drive will have a backup from that morning, and from one week ago, but any changes during the previous week are on the other drive. So, if someone needs a file from last week, you have to go and get it off the offsite drive.

For us, this isn’t as big an issue as it sounds. Most of the backups that people need access to are backups of personal files on their own machine, and those backups are stored within a backup store on the server. So they remain on the machine regardless of the backup drive. The “missing week” is only an issue for files that were changed on the server. So far that hasn’t been an issue for us, but depending on the way your company works, it could be a show stopper.

The second limitation is with Time Machine itself. Time Machine doesn’t backup an entire server so you can boot from the backup, or restore an entire system from the backup. If your system is completely hosed, you need to reinstall the operating system, then manually put all your files off the Time Machine backup back on to your server.

Conclusions

It all depends on what you want from your backups. This isn’t the ideal backup, but it is a convenient and easy to set up backup system with rotating disks. It also has great ease of use when it comes to restoring files, given the Time Machine interface. One thing you might like to consider is using some third party software to make an occasional full system backup to another drive that you can use for rebuild if disaster strikes. If you have other ideas, please add them to the comments.

Time Machine Backup to Rotating Disks

9 thoughts on “Time Machine Backup to Rotating Disks

  • August 25, 2008 at 9:01 am
    Permalink

    Nice of you to share, but this is probably of limited use to the general pubic (sic).

    What we’re all waiting for is your review of iDrum for the iPhone. Bring it on Beat Boy!

  • August 25, 2008 at 8:55 pm
    Permalink

    Thanks for sharing w910iROOLS. If you want me to review the iDrum, buy me a copy. :-)

  • August 25, 2008 at 8:55 pm
    Permalink

    Another limitation for those who are interested is that you must be logged in at all times for the AppleScript to trigger. If you log out, I don’t believe the script will run when you press the button.

    As I said, not the perfect solution. But still a nice solution I think.

  • August 26, 2008 at 10:13 am
    Permalink

    That’s a nice automated solution (and pretty useful to non-retards!!).

    I’d improve it (if you have the dollars) so that you have 5 disks, one for each day of the week. You could still keep just one off site if you need (or more) but it will give you daily incremental backups so you can recover the right version of that file you’ve been working on all week before MS Word trashes it and you don’t notice the mangling till 3 edits later ;)

  • Pingback:Recent Links Tagged With "timemachine" - JabberTags

  • Pingback:Curmi the Blog » Blog Archive » SMB, Windows, and Leopard Server

  • June 3, 2009 at 6:03 am
    Permalink

    So I’m very very interest in this cause I thought of the same thing. Then I realized it can’t work right. Since it seems to be working for you either I’m mistaken and am glad to know it or you are in for a nasty surpise when you try to restore!!

    here’s the issue I perceive. suppose I’m occasionally changing two files: A and B. in week 1 I edit A but not B. In week 2 I edit B and A. In week 3 I edit A again. The I decide I need to revert my home directory. when I do this I can’t get a coherent set of A and B: if I revert to the current time machine disk then I get last the B from 2 weeks ago and this weeks A.

    With just two files of course this is not a big deal but there’s hunderds of diles many I don’t even know about (e.g. preferences and application support) that won’t be self consistent with each other.

    to be clear by self consistent I mean that if I restore the files to a given date, then the restored image contains the files that were present on that date.

    I’m basing this on the assumption I made that if B got backed up last week then the OS marks B as “clean”. So it won’t get backed up this week (to the new disk).

  • June 3, 2009 at 6:37 am
    Permalink

    fumanchu: even though Time Machine does and incremental backup, all the files are there to recover. In your scenario of changing files A and B, if you restore you will get whatever was current, both files, from the backup. You might have an issue if you restore on the day the back up disk is changed.

    Ideally one would keep the same back up disk connected at all times. Have a second drive and use a program like SuperDuper or CCC to periodically duplicate the Time Machine drive to the second drive. If done weekly you essentially have the same level of back up but with no hacks. If you want an offsite backup, swap the secondary back up disk weekly.

  • Pingback:links for 2009-08-01 « Donghai Ma

Leave a Reply

Your email address will not be published. Required fields are marked *

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Anti-spam image