Umount and Eject CD Rom Tray or DVD Rom Tray using Linux eject Command

 

Umount and Eject CD Rom Tray or DVD Rom Tray using Linux eject Command.

 

   How to umount CD or DVD and eject the disk from the CD drive or DVD drive in one go...  On Linux system you can use the eject command to umount and then eject the CD or DVD drive.  The example below show the execution of eject command on Linux Fedora system.  But before you execute eject command to eject CD rom drive tray or eject DVD drive tray, make sure that you not in the mounted path of CD or DVD disk, other wise the eject command give you error message that say something like "device is busy"  ............. 

 

To umount and open CD rom or DVD rom tray, execute Linux eject command as show on example below.

Linux eject command to umount and open CD rom or DVD rom tray

[root@fedora /]# eject

[root@fedora /]#

 

To open and close CD rom tray or to open and Close DVD rom tray use eject command as show on example below.

Open and close CD rom tray or To open and Close DVD rom tray

[root@fedora ~]# eject -T

[root@fedora ~]#

 

The example of eject command to open DVD tray or CD Rom tray with verbose option.

Linux eject command to open dvd tray with verbose option

[root@fedora ~]# 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: checking if device "/dev/sr0" has a removable or hotpluggable flag

eject: `/dev/sr0' is not a multipartition device

eject: trying to eject `/dev/sr0' using CD-ROM eject command

eject: CD-ROM eject command succeeded

[root@fedora ~]#

 

Unable to umount CD Rom or unmount DVD.

 

The example of fail to un mount the CD or unmount the DVD rom.  Solution, use cd command to chanfg the directory path from mounted cd rom or dvd rom path as show on example below.

Unable to umount CD Rom or unmount DVD.

[root@fedora "FU 20090210 10 i386 DVD"]# eject

umount: /media/"FU 20090210 10 i386 DVD": device is busy.

        (In some cases useful info about processes that use

         the device is found by lsof(8) or fuser(1))

eject: unmount of `/media/"FU 20090210 10 i386 DVD"' failed

[root@fedora "FU 20090210 10 i386 DVD"]#

 

Solution: executu cd command and try umount the cd or dvd again...

[root@fedora "FU 20090210 10 i386 DVD"]#

[root@fedora "FU 20090210 10 i386 DVD"]# cd /

[root@fedora /]#

 

Linux eject command location.

 

The location of eject command on Linux Fedora system.  Use full path to execute the eject command if the the eject command not in your search path.

Linux eject command location.

[root@fedora ~]# whereis eject

eject: /usr/bin/eject /usr/sbin/eject /usr/share/man/man1/eject.1.gz

[root@fedora ~]#

 

Open eject manual page use:

 

Use command as show on example below to test other option that comes with eject command.

 

[root@fedora ~]# man eject

                or use

[root@fedora ~]# info eject

 

or open Linux eject command simple help files

Open Linux eject command simple help files

[root@fedora ~]# eject -h

Eject version 2.1.5 by Jeff Tranter (tranter@pobox.com)

Usage:

  eject -h                              -- display command usage and exit

  eject -V                              -- display program version and exit

  eject [-vnrsfqpm] [<name>]            -- eject device

  eject [-vn] -d                        -- display default device

  eject [-vn] -a on|off|1|0 [<name>]    -- turn auto-eject feature on or off

  eject [-vn] -c <slot> [<name>]        -- switch discs on a CD-ROM changer

  eject [-vn] -t [<name>]               -- close tray

  eject [-vn] -T [<name>]               -- toggle tray

  eject [-vn] -i on|off|1|0 [<name>]    -- toggle manual eject protection on/off

  eject [-vn] -x <speed> [<name>]       -- set CD-ROM max speed

  eject [-vn] -X [<name>]               -- list CD-ROM available speeds

Options:

  -v    -- enable verbose output

  -n    -- don't eject, just show device found

  -r    -- eject CD-ROM

  -s    -- eject SCSI device

  -f    -- eject floppy

  -q    -- eject tape

  -p    -- use /proc/mounts instead of /etc/mtab

  -m    -- do not unmount device even if it is mounted

Long options:

  -h --help   -v --verbose      -d --default

  -a --auto   -c --changerslot  -t --trayclose  -x --cdspeed

  -r --cdrom  -s --scsi         -f --floppy     -X --listspeed     -q --tape

  -n --noop   -V --version

  -p --proc   -m --no-unmount   -T --traytoggle -i --manualeject

Parameter <name> can be a device file or a mount point.

If omitted, name defaults to `cdrom'.

By default tries -r, -s, -f, and -q in order until success.

[root@fedora ~]#

 

Keywords:  eject cd rom, eject dvd rom, eject command, eject cd rom tray, eject dvd rom tray, eject cd, eject dvd