To eject a CD/DVD tray on a CentOS 7 system, you can use the eject command. With no arguments given to the command on the command line, i.e., a shell prompt, the tray will be ejected. To retract the tray, you can use
eject --trayclose
or -t
. You can
use -T
or --traytoggle
to open the drive,
if it is closed or close it, if it is open.
If you specify the -n
or
--noop
option, information on the device will be shown, but no
action is taken.
$ eject -n eject: device is `/dev/sr0'
You can use eject --default
to see the default name for the
device.
$ eject --default eject: default device: `/dev/cdrom'
[ More Info ]