[ltp] hotswaping UltraBay devices (R51)
Michael Gaber
linux-thinkpad@linux-thinkpad.org
Fri, 16 Dec 2005 23:46:54 +0100
This is a cryptographically signed message in MIME format.
--------------ms030008030601090601060507
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit
Laurent Gilson wrote:
> Hello
>
> I want to change my CD/DVD-ROM w/o rebooting. (R51 with Combo-drive)
>
> "echo eject > /proc/acpi/ibm/bay" turns off the bay, but does not
> unregister the IDE-device (i think this is a BIG problem, as the device
> is not tristated before turning off the power. I don't want to fry the
> drive or bay...).
>
> hdparm -U /dev/hdc gives me the hdparm-help-text. hdparm does not react
> at all to -U ... ??
>
> -x 0 fails with "HDIO_TRISTATE_HWIF failed: Invalid argument".
>
>
> So ... how to do it right ?
>
> Thanks,
> Gilson Laurent
> --The linux-thinkpad mailing list home page is at:
> http://mailman.linux-thinkpad.org/mailman/listinfo/linux-thinkpad
>
>
try this:
#eject:
/sbin/idectl-ibm-acpi 1 off
echo eject > /proc/acpi/ibm/bay
#insert:
/usr/bin/sleep 2
/sbin/idectl-ibm-acpi 1 on
/sbin/idectl-ibm-acpi 1 rescan
straight copied from my acpi-script reacting to the acpi-events thrown
by pulling out / thrusting in the handle
but remember: after swapping your device will run without dma, i haven't
found a way to turn it back on, since hdparm won't let me.
(idectl-ibm-acpi is the idectl file from the ibm-acpi package)
--------------ms030008030601090601060507
Content-Type: application/x-pkcs7-signature; name="smime.p7s"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="smime.p7s"
Content-Description: S/MIME Cryptographic Signature
MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIIJ8DCC
BPQwggLcoAMCAQICAwFGqjANBgkqhkiG9w0BAQQFADB5MRAwDgYDVQQKEwdSb290IENBMR4w
HAYDVQQLExVodHRwOi8vd3d3LmNhY2VydC5vcmcxIjAgBgNVBAMTGUNBIENlcnQgU2lnbmlu
ZyBB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