[ltp] Re: What are people using for Dock/Undocking scripts for
their X60/61's?
Richard Neill
linux-thinkpad@linux-thinkpad.org
Sat, 07 Mar 2009 13:16:07 +0000
Henrique de Moraes Holschuh wrote:
> On Sat, 07 Mar 2009, Thomas Hood wrote:
>> Theodore Tso wrote:
>>> the problem is that right after you push the
>>> button, it disconnects the hard drive right away.
>> That is, pressing the undock button causes immediate (electronic)
>> disconnection. And this causes an immediate hang in the kernel.
>>
>> Assuming we want undocking to be as effortless as possible there
>> are two solutions.
>>
>> 1. Change Linux so that it does not hang when the Ultrabay Slim
>> drive disappears without warning.
>
> This is obviously a big bad bug, and needs fixing. libata has eject
> support, and that should be *ALSO* properly connected to the ACPI
> bay/dock driver if needed, so that dumb things don't happen.
>
What do we do if the disk is in use when it's ejected? Eg a mounted
DVD-ROM with open files, or even a hard-drive?
Seems that we should beep like crazy at the first stage of pulling out
the lever (there is a very loud sound available as one of the options in
echo X > /proc/acpi/ibm/beep where X is a number between 1-20.)
Hopefully, that will make the user stop for long enough to read a
message on screen (popup via hal/dbus?) about what's wrong, and
specifically which process has the device open.(fuser)
After that, we still need to cope(i.e. not crash) when the user blindly
removes a disk which is mid-way through writing data.
Richard