eject: unable to find or open device for: `cdrom' - but my cd is /dev/cdrom1
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
eject (Debian) |
Fix Released
|
Unknown
|
|||
eject (Ubuntu) |
Fix Released
|
Low
|
Ankit Sinha |
Bug Description
Binary package hint: eject
The eject command does not actually eject my cdrom, unless called as 'eject /dev/cdrom1'
The problem seems to be that the eject command's default device is set to "/dev/cdrom" specifically. Yet, udev will increment the drive name if new cdroms are added or even if you change the cable that the cdrom is connected to. See https:/
Anyway, as a workaround, I can set up a /media/cdrom symlink to the proper device and then it works. But that's a brittle solution since if I switched my cable back or changed cdroms, I'd have to manually adjust that link again.
Possibly eject could be modified to determine the default device by looking first for /dev/cdrom, and then if that's missing, look for /dev/cdrom[0-9]. (Make sure /dev/cdroms is not included in that list obviously.) If there's more than one cd device in the system, either bail out or bravely select the lowest numbered one.
The file /proc/sys/
This udev change is a generic problem that affects all utilities that interact with the cdrom. It is possible that this could be solved in a more general purpose way by some sort of little lib shared with xine and other cdrom users. In any case, those other tools may have already solved this problem and could be worth examining for code reuse.
Related branches
- Gianfranco Costamagna: Disapprove
- Sebastien Bacher: Needs Fixing
- Jamie Strandboge: Needs Fixing
-
Diff: 44 lines (+19/-0)2 files modifieddebian/changelog (+6/-0)
eject.c (+13/-0)
Changed in eject (Ubuntu): | |
status: | In Progress → Fix Committed |
status: | Fix Committed → In Progress |
Changed in eject (Debian): | |
status: | Unknown → New |
Changed in eject (Ubuntu): | |
status: | In Progress → Fix Committed |
Changed in eject (Debian): | |
status: | New → Fix Released |
The persistent names are stored in /etc/udev/ rules.d/ 70-persistent- cd.rules, so another workaround would be to edit that file and delete out all the extra added bits, so the /dev/cdrom device will be set properly. Again, this is a poor workaround since if I later changed the cdrom at all I'd have to revisit it.