Hot swapping SATA drives

Peter Steele psteele at maxiscale.com
Tue Nov 25 08:53:43 PST 2008


I've done some searches regarding FreeBSD's 7 support for the hot
swapping of SATA drives and the general consensus appears that it *is*
supported, but not necessarily with all drive models/brands. In our own
testing, we've discovered that our Seagate 250GB drives cannot be hot
swapped in our servers. The system appears to sense when they are
removed but not when they are reinserted, and we've had numerous panics
experimenting with them.

 

We also have some Western Digital drives, and these fare much better.
FreeBSD appears to recognize when these drives are removed and inserted.
If we have a WD configured as part of a geom mirror, the geom driver
automatically re-inserts a previously configured drive as soon as it is
plugged in. It isn't even necessary to do an atacontrol attach/detach.

 

However, even with the Western Digital drive, there are issues. In
particular, if there are any mounted file systems on a drive when it is
removed, attempting to unmount the file systems after it has been
removed usually leads to a kernel panic, not necessarily immediately but
shortly afterwards. I've tried the latest 7.0 patch level, p6, and the
panics appear to have been fixed, but there are still problems.

 

If a drive dies on us, we want to be able to close existing file handles
and allow the new drive to take over. But what we've experienced is that
even a "umount -f" will not umount a file system if the drive has been
pulled. And as I type this, I have a system in the lab that is
completely frozen after a drive pull test. No panic, no reboot, it's
just hung up solid.

 

Why does FreeBSD panic/freeze instead of simply issuing an I/O error,
and why is there no way to force open file handles to close when a drive
is pulled. The implication is that if a drive was to suddenly die on a
live system, even if we have gmirror configured for HA, the system will
likely panic or freeze and we'll have to reboot. We have software that
detects when a drive disappears, but if the system is going to end up
having to be rebooted, our detection code isn't going to do us much
good.

 

Is there any solution to this? Can a server be built around FreeBSD that
supports hot swappable SATA drives?

 



More information about the freebsd-hackers mailing list