Linux-kernel mailing list archive 2000-15,: Re: CDrom, nodisc, eject

# Re: CDrom, nodisc, eject

Ricky Beam (jfbeam@bluetopia.net)
Mon, 10 Apr 2000 16:44:01 -0400 (EDT)

- Messages sorted by: [ date ][ thread ][ subject ][ author ]
- Next message: Stuart Lynne: "Re: FW: press release - new network driver architecture"
- Previous message: Michael Cornwell: "Re: Corrupt Hard Disk?"

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/

- Next message: Stuart Lynne: "Re: FW: press release - new network driver architecture"
- Previous message: Michael Cornwell: "Re: Corrupt Hard Disk?"