Lt hotswap

Contents

lt_hotswap

The lt_hotswap kernel module enables hot-swapping of UltraBay disk drives under Linux, with DMA support on machines with an old kernel where you might still be required to use piix+ide-disk. With 2.6.2x or better, you should use the new driver, ata_pixx with native hotswapping support.:

Features

enable hotswapping of UltraBay drives if you have to use the old piix/ide-disk drive instead of ata_piix which supports hotswap natively. On new kernels, you should not bother with piix+ide-disk+lt_hotswap and just use ata_piix. See the How to hotswap UltraBay devices page for more detaoils on ata_piix vs iix+ide-disk+lt_hotswap

At least for a thinkpad T41p with a 2.6.15 kernel I recommend to use version 0.2 of lt_hotswap - the latest version reproducable produces oopses and kernel crashes for me.

Script to eject an optical ultrabay drive

I configured my system to automatically eject my optical drive in battery mode, because it saves about 500mW which is about 5% when my system is idle.
But when the drive is in use, issuing an eject will result in a kernel ooops/crash.
So the problem is: How do I check if the device is still in use, either by the kernel or by some other process?
The trick is to compile "cdrom and ide_cd" as modules. If the unload of ide_cd failes some other process is still using the device.
<bash>