Eliminating Annoying Backup Drive Spin-Up

Do you suffer from spin-up wait times as OS X’s Finder attempts to access your idle external backup drive when you open up a file selection dialog box? Those seconds can add up – but wait no more, a solution is at hand!

I have SuperDuper! (recommended!) scheduled to do a nightly backup of my primary drive onto an external Seagate FreeAgent drive. The drive conveniently spins down to reduce wear and power consumption after being idle for a few minutes. However, since it is left mounted for the backup to run, the Finder feels the need to access it occasionally, incurring a few seconds of spinning beach-ball time.

The solution is to leave the external drive unmounted, and mount it only while the backup is running. You’re also free to mount it yourself whenever you like using the Disk Utility application.

The first thing you’ll need to do is to figure out what the UUID of the backup volume is. Run “diskutil list” from the Terminal’s command line, and find the volume you’re interested in. In my case the one I was looking for was the second partition, /dev/disk1s2:

   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *1.0 TB     disk1
   1:                        EFI                         209.7 MB   disk1s1
   2:                  Apple_HFS FreeAgent Drive         999.9 GB   disk1s2

Now get the volume’s UUID with “diskutil info /dev/disk1s2” – you’ll see a “Volume UUID” line with a large hexadecimal number like this:

   Volume UUID:              01234567-890A-BCDE-F012-34567890ABCD

In the example above, the value “01234567-890A-BCDE-F012-34567890ABCD” is what we’re looking for.

In order for OS X (this post refers to 10.6) to ignore the backup drive on startup, you’ll have to tell it not to mount it. Even though it doesn’t create the file by default, OS X will use mount parameters from the file system table in the old familiar /etc/fstab file. The one we want is “noauto” and you can specify the disk to apply it to with the UUID you found above. Create the /etc/fstab file and add a line like the following to it:

UUID=01234567-890A-BCDE-F012-34567890ABCD none hfs rw,noauto

Here we’re specifying the backup volume with the UUID, “none” is the mount point so that OS X will mount it in /Volumes where you’re used to seeing it, and “hfs” is the filesystem type. The mount parameters “rw” and “noauto” specify that the volume is to be mounted writable, but not to mount it automatically at boot time.

The final step is to tell the backup system to mount and unmount the volume prior to and following the backup. OS X’s diskutil can mount disks using the UUID, so to mount the drive:

/usr/sbin/diskutil mountDisk 01234567-890A-BCDE-F012-34567890ABCD

and to unmount it:

/usr/sbin/diskutil unmountDisk 01234567-890A-BCDE-F012-34567890ABCD

SuperDuper! has an “advanced” option to run shell scripts before and after the backup is run, so that’s where I put those commands.

Now you can unmount your backup drive and you’ll no longer have to suffer through that agonizing few seconds of waiting for the Finder to uselessly spin it up! Not only that, but you’ll save wear and tear on your backup drive because it isn’t constantly spinning up and down.

About this entry