How to mount CD-ROM drive in Linux

Last updated on August 11, 2020 by Dan Nanni

In order to use CD-ROM/DVD drive in Linux, you first need to mount the drive. The following post describes how you can mount CD-ROM/DVD drive in Linux.

The first step is to identify the device name of your CD-ROM or DVD drive. To do so, you can use dmesg output, which indicates the device name for your CD-ROM or DVD drive.

$ sudo dmesg | grep -i 'cdrom|dvd|cd/rw|writer'
hdd: PIONEER DVD-RW DVR-106D, ATAPI CD/DVD-ROM drive

In the example output above, the device name associated with a local DVD drive is /dev/hdd. Verify that /dev/hdd actually exists.

Now go ahead and mount the identified device using mount command.

$ sudo mount /dev/hdd /media/cdrom

I assume that the mount point /media/cdrom already exists. Note that if the drive is empty or the media format of an inserted CD is not supported, the mount command will fail with the error message:

mount: No medium found

While in the above example I use the root permission to mount a CD-ROM drive, you can actually allow non-root users to mount a CD-ROM drive, by adding the following line in /etc/fstab:

$ sudo vi /etc/fstab
/dev/hdd     /media/cdrom   iso9660 ro,user,noauto  0       0

In the above, the user option in the fstab entry for /dev/hdd allows normal users to mount and unmount the corresponding device.

Support Xmodulo

This website is made possible by minimal ads and your gracious donation via PayPal or credit card

Please note that this article is published by Xmodulo.com under a Creative Commons Attribution-ShareAlike 3.0 Unported License. If you would like to use the whole or any part of this article, you need to cite this web page at Xmodulo.com as the original source.

Xmodulo © 2021 ‒ AboutWrite for UsFeed ‒ Powered by DigitalOcean