Mount CD/DVD drive in RHEL/CentOS Linux Systems | Persistent Mount of optical drives



Mount CD/DVD drive in RHEL/CentOS Linux Systems | Persistent Mount of optical drives

Mount CD/DVD drive in RHEL/CentOS Linux Systems | Persistent Mount of optical drives

Let’s learn how to mount CD/DVD permanently in RHEL8 /CentOS8 so that it remains mounted in the next boots as well. Doing this will, you don’t have to mount the drive manually each time you reboot the system and you want to use the drive.
To list all the block devices, run lsblk command. The DVD drive of the system is listed as the sr0. To use the drive, you need to mount it to a directory, otherwise you can’t access any of it’s file. If you mount it to a directory with the mount command and the directory name, it’s mounted temporarily—until the next boot. Each time you power on this server and want to use the files of the DVD then you will need to mount it manually. But when you make it persistent you don’t have to mount it each time we reboot the server.

You can mount the DVD drive to a directory which is in my case is the root directory of the server and the directory name is /dvdinstall. You’ll have to create a directory if you don’t already have.
Run blkid and the dvd name as /dev/sr0. Copy the UUID, which can be seen inside the double quote. Note that don’t copy the double quote.
Then, open the fstab file which is inside /etc directory, with a text editor such as vi or vim. Go to the last line and go to the end of line. Press ‘i’ to switch into insert mode, press right arrow and press enter to go to the next line.
Here, type as UUID= ‘ paste the UUID’, /dvdinstall iso9660 defaults 0 0. Here, /dvdinstall is the mount point directory name. Press ‘escape’ key, type 😡 to save and exit from the file.
Now, if you run mount –a command, the drive is mounted on the mount point directory that we specified on the /etc/fstab file. To verify if it’s mounted, run lsblk command. As we can see the drive is mounted to the directory /dvdinstall.
Now let’s reboot the server and check back again. It should have been mounted automatically.
Okay, the system is rebooted. I log into it. To open the terminal, click on Activities and click on the terminal. Now, if you run lsblk command, we can see the drive sr0 is mounted on the directory /dvdinstall.

Comments are closed.