Re: CDrom, nodisc, eject

From: Ricky Beam (jfbeam@bluetopia.net)
Date: Mon Apr 10 2000 - 15:44:01 EST


On Fri, 7 Apr 2000, Wakko Warner wrote:
>open("/dev/scd5", O_RDONLY|O_NONBLOCK) = 3
>ioctl(3, CDROMEJECT, 0xbffffaac) = 671088642
... --> 0x28000002 (CHECK CONDITION)

What was the error from the kernel? (I need the sense data.) The kernel
should not be sending a TEST UNIT READY for the eject call.

Try "my-eject" from:
        http://beaker.bluetopia.net/~jfbeam/stuff/my-eject

Someone else had problems getting a CD to eject, so I whiped that out.
(it will release any reservation/lock and eject the disk -- in theory.)

>Why does CDROMEJECT return some odd number and not actually eject the drive?

That's not "some odd number"... it just has no meaning to you :-)

>The kernel complains that there's no disc in the drive. It seems to be drive
>dependant. I have a Nakamichi changer (MJ-5.16 scsi) which will eject
>(open) when the eject command is sent.
>
>Which is broken?

I'm guessing it's the drive. The SCSI-2 spec doesn't say anything about when
STOP START UNIT is supposed or allowed to report an error. Some hardware
follows the text to the letter -- queue the command along with everything
else and spin down and/or eject as requested -- others refuse to eject if
the door is locked (PREVENT ALLOW). I've never seen one complain about not
having any media loaded.

WARNING:
'my-eject' is submitting commands directly to the drive. The kernel does
not know what you are doing. It makes no attempt to tell what the kernel
or other programs may be doing. If you './my-eject -stop /dev/sda', your
hard drive _will_ spin down and will remain that way until it's told to
spin back up -- the kernel only does this as part of the bus scan.

[ttya3]beaker(ttyp0:S.3):~/html/stuff/[4:41pm]:./my-eject
Start/Stop Unit, The "Everything Ejector"
Usage: my-eject [-load/start] [-eject/stop] <device>

(device is the "raw" device, not a scsi-generic creature.)

[This version also tortures^Wworks on ATAPI devices.]

--Ricky

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sat Apr 15 2000 - 21:00:15 EST