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.