[ltp] handling UltraBay with hard disk

Simon Williams linux-thinkpad@linux-thinkpad.org
Mon, 04 May 2009 18:46:57 +0100


Peter F. Patel-Schneider wrote:
> Hi:
> 
> There are various how-to's to handle UltraBay HDD holders, but I can't
> seem to find one that should work in Fedora 10/11.  
> 
> Does anyone know of a solution to link the pre-eject udev signal to a
> script that will unmount the disk in an UltraBay HDD holder that works
> in a modern fashion?  If not, does someone know how the physical removal
> of an UltraBay HDD holder is handled?

Same as a CD drive. It's an IDE dev. It's possible to do it with hdparm 
manually, but it's a bit unsafe. Better to get hold of the hotswap 
package (sometimes referred to as debian hotswap) and use that. That 
will allow you to register/unregister the IDE device, but 
mounting/unmounting you'll need to deal with yourself. Also, after 
unregistering you should power down the ultrabay by:
"echo 1 > /sys/devices/platform/bay.0/eject"
(requires the IBM-ACPI kernel module).

And then you'll need to link that script to the ACPI events somehow. I 
never got round to this- it just run the script manually each time.
I would show you my script, but it's frankly disgusting, and hotswap 
handles all the hard stuff anyway - my script just does (un)mounting, 
etc for me.