"eject" command not working

11,066

Solution 1

Depending on your device and how it is set up one of those commands should work:

eject /dev/cdrom
eject /dev/cdrw
eject /dev/dvd
eject /dev/dvdrom
eject /dev/dvdrw

If none of these work then look for the correct device in the list generated by this command:

ls -l /dev | grep '\->'

You can also specify the raw device:

eject /dev/sda
eject /dev/hdd

Solution 2

Try $ eject -t

Solution 3

Try eject -T.

Edit:

You may need to name the device or mount point. It may be something other than the ones that it automatically tried. Look at the output of mount to see which ones might be it.

Share:
11,066

Related videos on Youtube

Abhijeet Rastogi
Author by

Abhijeet Rastogi

Linux Geek, Foodie, Biker!

Updated on September 17, 2022

Comments

  • Abhijeet Rastogi
    Abhijeet Rastogi over 1 year
    shadyabhi@shadyabhi-desktop:~$ eject -v
    eject: using default device `cdrom'
    eject: device name is `cdrom'
    eject: expanded name is `/media/cdrom'
    eject: `/media/cdrom' is a link to `/media/cdrom0'
    eject: `/media/cdrom0' is not mounted
    eject: `/media/cdrom0' is not a mount point
    eject: tried to use `/media/cdrom0' as device name but it is no block device
    eject: unable to find or open device for: `cdrom'
    shadyabhi@shadyabhi-desktop:~$
    

    The tray doesnt open.. How do I open tray using command line?

    I am using Ubuntu 9.10 64bit and I have no dvd inserted in the DVDROM...

  • Abhijeet Rastogi
    Abhijeet Rastogi about 14 years
    not working.. same error...
  • Abhijeet Rastogi
    Abhijeet Rastogi about 14 years
    not working. same error
  • Abhijeet Rastogi
    Abhijeet Rastogi about 14 years
    Actually, I have no DVD inserted, so there isnt anything mounted.. So, what can I do now?
  • Abhijeet Rastogi
    Abhijeet Rastogi about 14 years
    eject: unable to find or open device for: ******.. For all of them, same errors... And I want to make a point that I dont have any DVD loaded in the DVDROM.
  • lajuette
    lajuette about 14 years
    Do you know to wich device node your drive is bound?
  • Justin Smith
    Justin Smith about 14 years
    try this: ls -l /dev | grep '\->' if your dvd device is properly recognized by your system it will be on that list. On my system I get, along with some junk: 'dvd -> hda' and 'cdrw -> hda', eject /dev/dvd, eject /dev/hda, and eject /dev/cdrom all work
  • Abhijeet Rastogi
    Abhijeet Rastogi about 14 years
    cdrom2 -> sr0, cdrw2 -> sr0, core -> /proc/kcore, dvd2 -> sr0, dvdrw2 -> sr0... is the output.. I now did "eject /dev/dvd2"... And now it works.. Thanx..