Today, we will walk you through how to insert and eject CD-ROM / DVD-ROM through command line in linux system. Yes! this is also true that you do not have to touch CD/DVD ROM eject switch.
Basically eject command allows removable media to be ejected under software control. Here, software control is your operating system and removable media it is referring to DVD-ROM, CD-ROM, floppy disk, tape, or JAZ or ZIP disk.
eject command ejects the CD-ROM or DVD-ROM. Corresponding to name we can also eject that particular device. The name can be a device file or mount point, either a full path or with the leading “/dev”, “/media” or “/mnt” omitted
To eject the DVD-ROM and CD-ROM tray use the given below command.
To put back the DVD-ROM and CD-ROM tray,use given below command.
Note: Putting back of DVD-ROM and CD-ROM tray depends upon its types.It mostly works with Desktop’s DVD-ROM or CD-ROM
Examples: Eject removable media
Here some of the examples we have written here for some removable device.
1. Don’t eject, just show device found
2. Eject DVD-ROM or CDROM
eject -r ## OR eject /dev/cdrom
3. Eject SCSI device
4. Eject floppy
5. Eject hardware tape or backup tap drive.
6. Eject 4th IDE device
7. Eject first SCSI device
Important Note: In case when you only use the command –
Actually by default it tries -r, -s, -f, and -q in order until get success.
Hence, when you only hit the command
eject mostly DVD-ROM/CD-ROM opens the tray because in order -r is first which represent to CD-ROM.
Hi, apart from eject command to eject the dvd drive, is there any possible way to insert the dvd drive tray into the hardware? I mean opposite of eject 🙂
Sharad Chhetri says
Mostly we have used the eject command. Other commands sometimes do not work .
I understand to use eject command to eject.
But my question is to “insert” the cdrom-tray back into the server, can be done by any command instead of manually pushing the tray? 🙂
Sharad Chhetri says
The answer is
eject -t, we have mentioned in our Post. But now a days the Modern CD/DVD ROM need physical force to push back the tray so it will not work for example in Laptop’s CD/DVD ROM.
harish khan says