eject: unable to eject, last error: Inappropriate ioctl for device

Bug #398670 reported by Ralf Hildebrandt
30
This bug affects 6 people
Affects Status Importance Assigned to Milestone
eject (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

When issuing an "eject" command on the console, I get:

$ eject
eject: unable to eject, last error: Inappropriate ioctl for device

$ dmesg
reports:

[ 149.469374] sr 1:0:0:0: [sr0] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[ 149.469380] sr 1:0:0:0: [sr0] Sense Key : Illegal Request [current]
[ 149.469385] sr 1:0:0:0: [sr0] Add. Sense: Illegal mode for this track
[ 149.469393] end_request: I/O error, dev sr0, sector 0
[ 149.469397] __ratelimit: 68 callbacks suppressed
[ 149.469400] Buffer I/O error on device sr0, logical block 0
[ 149.469403] Buffer I/O error on device sr0, logical block 1
[ 149.469407] Buffer I/O error on device sr0, logical block 2
[ 149.469410] Buffer I/O error on device sr0, logical block 3
[ 149.469412] Buffer I/O error on device sr0, logical block 4
[ 149.469415] Buffer I/O error on device sr0, logical block 5
[ 149.469417] Buffer I/O error on device sr0, logical block 6
[ 149.469419] Buffer I/O error on device sr0, logical block 7
[ 149.469422] Buffer I/O error on device sr0, logical block 8
[ 149.469424] Buffer I/O error on device sr0, logical block 9
[ 149.486612] sr 1:0:0:0: [sr0] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[ 149.486618] sr 1:0:0:0: [sr0] Sense Key : Illegal Request [current]
[ 149.486623] sr 1:0:0:0: [sr0] Add. Sense: Illegal mode for this track
[ 149.486630] end_request: I/O error, dev sr0, sector 0
[ 149.503096] sr 1:0:0:0: [sr0] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[ 149.503105] sr 1:0:0:0: [sr0] Sense Key : Illegal Request [current]
[ 149.503112] sr 1:0:0:0: [sr0] Add. Sense: Illegal mode for this track
[ 149.503121] end_request: I/O error, dev sr0, sector 0
[ 149.505347] sr 1:0:0:0: [sr0] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[ 149.505360] sr 1:0:0:0: [sr0] Sense Key : Illegal Request [current]
[ 149.505373] sr 1:0:0:0: [sr0] Add. Sense: Illegal mode for this track
[ 149.505390] end_request: I/O error, dev sr0, sector 0

Even if the CD cannot be read, I should still be able to eject it!

$ eject -v
eject: using default device `cdrom'
eject: device name is `cdrom'
eject: expanded name is `/dev/cdrom'
eject: `/dev/cdrom' is a link to `/dev/sr0'
eject: `/dev/sr0' is not mounted
eject: `/dev/sr0' is not a mount point
eject: `/dev/sr0' is not a multipartition device
eject: trying to eject `/dev/sr0' using CD-ROM eject command
eject: CD-ROM eject command failed
eject: trying to eject `/dev/sr0' using SCSI commands
eject: SCSI eject failed
eject: trying to eject `/dev/sr0' using floppy eject command
eject: floppy eject command failed
eject: trying to eject `/dev/sr0' using tape offline command
eject: tape offline command failed
eject: unable to eject, last error: Inappropriate ioctl for device

$ lsb_release -rd
Description: Ubuntu karmic (development branch)
Release: 9.10

$ apt-cache policy eject
eject:
  Installed: 2.1.5+deb1+cvs20081104-6
  Candidate: 2.1.5+deb1+cvs20081104-6
  Version table:
 *** 2.1.5+deb1+cvs20081104-6 0
        500 http://de.archive.ubuntu.com karmic/main Packages
        500 http://us.archive.ubuntu.com karmic/main Packages
        100 /var/lib/dpkg/status

Revision history for this message
Ralf Hildebrandt (ralf-hildebrandt) wrote :

It works using "sudo eject" :(

Revision history for this message
Marco Scannadinari (zheoffec) wrote :

Try this:

Steps:

1. 'sudo eject /dev/sr0'

2. 'file /dev/sr0'

3. 'sudo eject -i off'

Revision history for this message
monochromec (monochromec) wrote :

Can't confirm Ralf's comment. Running 12.04 on a MBP 8,1 and no method will eject the CD from the drive (FN-eject via pommed), "eject" as root or ejecting the cd from nautilus.

Revision history for this message
Ralf Hildebrandt (ralf-hildebrandt) wrote :

I'm on 12.04 (now) and "eject" as "normal" user is working now.

Revision history for this message
penalvch (penalvch) wrote :

Ralf Hildebrandt, this bug report is being closed due to your last comment https://bugs.launchpad.net/ubuntu/+source/eject/+bug/398670/comments/4 regarding this being fixed with an update. For future reference you can manage the status of your own bugs by clicking on the current status in the yellow line and then choosing a new status in the revealed drop down box. You can learn more about bug statuses at https://wiki.ubuntu.com/Bugs/Status. Thank you again for taking the time to report this bug and helping to make Ubuntu better. Please submit any future bugs you may find.

Changed in eject (Ubuntu):
status: New → Invalid
Revision history for this message
Alan Meyer (ameyer2) wrote :

Maybe closed too soon.

I'm running Ubuntu 12.04 and am experiencing the problem. I was copying a CD in the tray with Brasero. The source disc was in the tray. I went to dinner. I came back to find the copy stalled. I could not open the tray with the button. I tried all of the following without success:

Use the eject command in Brasero
Close and reopen Brasero
sudo eject
  eject: unable to eject, last error: Inappropriate ioctl for device
sudo eject cdrom
 eject: unable to eject, last error: Inappropriate ioctl for device
sudo eject /media/cdrom
 eject: unable to eject, last error: Inappropriate ioctl for device
sudo eject /dev/sr0
 eject: unable to eject, last error: Inappropriate ioctl for device
sudo eject -i off
 CD-Drive may be ejected with device button {but it can't}
Open drive with VLC
 VLC is unable to open the MRL 'cdda:///dev/sr0'. Check the log for details. {Haven't found the log file yet}
Tried Thunar and Nautilus
 Neither shows any contents of /media/cdrom

Rebooted and retried all of the above with the same results

Any other ideas?

Thanks.

Revision history for this message
Alan Meyer (ameyer2) wrote :

I booted up Windows 7 on the computer and it too was unable to open the drive door or read the disk. I turned off the machine for the night and, in the morning, booted up Ubuntu. Pressing the button during the boot process, the gate opened and the tray came out.

It's possible that the hardware is failing intermittently, or I perhaps the software under Ubuntu put the drive into a locked gate state which was not released by a reboot but was released by a complete power down. If the latter explanation is right, it would be wonderful if someone figured out how to fix it without powering down, for example by a change to what happens when 'sudo eject -i off' is run.

However, I don't know how anyone could reproduce this problem reliably, especially on another machine. So I could not, in good conscience, ask for the issue to be re-opened. If others do report the same problem and the issue is reopened, maybe the notes I've posted here and in comment #6 will be of use.

Thanks.

Revision history for this message
penalvch (penalvch) wrote :

Alan Mayer, if you have a bug in Ubuntu, the Ubuntu Kernel team, Ubuntu Bug Control team, and Ubuntu Bug Squad would like you to please file a new report by executing the following in a terminal while booted into a Ubuntu repository kernel (not a mainline one) via:
ubuntu-bug linux

For more on this, please read the official Ubuntu documentation:
Ubuntu Bug Control and Ubuntu Bug Squad: https://wiki.ubuntu.com/Bugs/BestPractices#X.2BAC8-Reporting.Focus_on_One_Issue
Ubuntu Kernel Team: https://wiki.ubuntu.com/KernelTeam/KernelTeamBugPolicies#Filing_Kernel_Bug_reports
Ubuntu Community: https://help.ubuntu.com/community/ReportingBugs#Bug_reporting_etiquette

When opening up the new report, please feel free to subscribe me to it.

Please note, not filing a new report would delay your problem being addressed as quickly as possible.

No need exists to comment here at this time. After reading the above documentation in it's entirety, if you have further questions, you are welcome to redirect them to the appropriate mailing list or forum via http://www.ubuntu.com/support/community/mailinglists , or you may contact me directly.

Thank you for your understanding.

Revision history for this message
Christian Kujau (christiank) wrote :

This just happened here with eject-2.1.5, but using "eject -i off" as suggested by zheoffec in comment #2 helped - thanks!

Revision history for this message
Andrea Croci (andrea.croci) wrote :

Just for what it's worth, I recently had the same problem and it turned out to be a faulty SATA data cable. People affected by this error message may want to check on that before filing other bug reports or buying new drives.

Revision history for this message
frankster (wtfrank) wrote :

Also for what it's worth, I was experiencing "eject: unable to eject, last error: Inappropriate ioctl for device", and it turned out that I had an object blocking the tray so it couldn't fully open. When I removed the object, the error went away.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.