Can't eject CD/DVD after warm reboot?

Michael ODonnell michael.odonnell at comcast.net
Thu Aug 27 15:32:18 EDT 2009



>> Is there some trick (maybe some kernel commandline option or some program
>> executed during shutdown) that will leave the drive willing to eject the
>> media ("unlock" it?)  without us having to power-cycle these machines?
>
>Take a look at hdparm -L.  Is that what you're looking for?

No, it looks like hdparm uses ioctls that aren't supported for the devices
in question, but digging into that put me onto the sg_* set of programs
and this one:

   sg_prevent --allow /dev/cdrom

...appears (most of the time) to be unlocking the drive as we'd like.
Still too early to tell if it's reliable enough to be the workaround we
need, but your clue got us that much closer - thanks.

Those sg_* programs are definitely in "The Rotating Knives, yes?!"
category but since the SATA drives are presented via the SCSI midlayer
it appears they're what's required in this case.  There's approx a dozen
related tools in that family (at least on the SysRescueCD) and here, for
example, is how you can force the DVD tray to open once you've unlocked
it as shown:

   sg_raw /dev/cdrom 1b 00 00 00 02 00

...and we're also shipping a box of paper-clips with every system.
 


More information about the gnhlug-discuss mailing list