SATA (hot) swapping for backup

Daniel Pittman daniel at
Fri Aug 4 05:18:06 UTC 2006

David Abrahams <dave at> writes:

> I recently bought a pair of SATA drives on which to do weekly backups
> of my server.  I also got a cool drive tray that allows me to pop the
> disks in and out of the machine easily:
> You can remove the drive from the machine by turning a key -- which
> powers it down -- and pulling on the handle.
> My problems: 
> 1. If I boot the server with no drive in the bay or with the drive
>    power off, it is never detected, even after powering it on.  Is
>    there a way to get that to work?

What you need is the other side of SATA hot-swap: you bought the
hardware, now you need the controller and kernel support to match.

These pages discuss the issue in general, but the short answer is
probably that your system will not (yet) support hot-swap SATA:

Sadly, none of that seems completely clear about what kernel release is
required for the various hot-plug and warm-plug options to work.  You
may be forced to resort to asking the linux-kernel mailing list if
someone else here can't chime in.

> 2. I'm not 100% sure that unmounting the drive, powering it off,
>    removing it, and putting a new disk in its place is legit.  Can
>    anyone confirm?  My motherboard *does* claim to support SATA
>    hotswap, but I'm not sure if Linux supports it.

Linux probably doesn't, save in the most recent kernels, and possibly
only with appropriate patches.  

> Lastly, if there's any standard way to automate backup jobs (mounting
> disks, rsync or whatever, unmounting, etc.) I'd appreciate a
> reference.  I can always use cron scripts but I imagine someone has
> probably come up with something better.

udev can fire off arbitrary code on insertion of a device.  You can use
that to trigger a script that will, basically, do all the work for you.

Digital Infrastructure Solutions -- making IT simple, stable and secure
Phone: 0401 155 707        email: contact at

More information about the ubuntu-server mailing list