CDs and DVDs are slowly becoming irrelevant, but they are still efficient data storage devices. They can store data in a large quantity for long periods of time. In this article, we will discuss the mounting process of CD-ROM on CentOS 8 step-by-step. The method we will perform in this article will also work if you want to mount an ISO file on CentOS 8 system.

Step 1: Login as a Root User

In case you’re not a root user or do not have Sudo privileges, please use the command below to log in as a root user:

<img data-lazy-src="https://kirelos.com/wp-content/uploads/2021/07/echo/word-image-137.png" height="61" src="data:image/svg xml,” width=”273″>

You will be asked to input the root password. In case you fail to provide the password, you will not be able to mount the CD-ROM using the commands given in this article since this requires Sudo privileges.

Step 2: Know the Block Device Name

Now that you have logged in as a root user, you will be able to use the blkid command to look at the contents of block devices. Block devices are storage devices like CD ROMs, Hard Drives, and Floppy Disks.

The output will look something like the screenshot attached below:

<img data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/07/echo/word-image-138.png" data-lazy- height="169" src="data:image/svg xml,” width=”728″>

My CD is not showing here, as I have not inserted it yet.

Now, if I use the blkid command again after inserting the CD, the output will have an additional device in the list of block devices:

<img data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/07/echo/word-image-139.png" data-lazy- height="205" src="data:image/svg xml,” width=”726″>

The device in this example is named /dev/sr0.

Please note the block device name you want to mount and its UUID.

Step 3: Create a Mount Point Directory

We need to make a new directory that will act as the mount point for your CD/DVD. Therefore, create a new directory using the mkdir command (any arbitrary directory).

In this example, we will use /media/mount:

<img data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/07/echo/word-image-141.png" data-lazy- height="42" src="data:image/svg xml,” width=”438″>

Step 4: Mount CD/DVD Drive

Now, we have everything to mount a CD/DVD on our CentOS 8 system. We will use the mount command to mount the CD/DVD on CentOS 8 Operating system:

# mount /dev/sr0 /media/mount/

<img data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/07/echo/word-image-143.png" data-lazy- height="56" src="data:image/svg xml,” width=”659″>

After mounting, you will be able to access all the files on your CD/DVD drive.

You can use the ls command followed by the mount point directory of CD/DVD to check whether the operation was successful or not.

<img data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/07/echo/word-image-144.png" data-lazy- height="129" src="data:image/svg xml,” width=”713″>

You can also mount your CD/DVD drive permanently.

Mount CD/DVD Drive Permanently

To mount a CD/DVD drive permanently, use the nano command followed by /etc/fstab to open the fstab file in the nano editor.

Fstab is a system configuration file in CentOS 8 located in the /etc directory:

<img data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/07/echo/word-image-146.png" data-lazy- height="525" src="data:image/svg xml,” width=”752″>

Add the following entry in the fstab file to mount CD/DVD Drive permanently:

UUID=2021-04-2816515826 /media/mount/ iso9660 ro,user,auto 0 0

Change the UUID and mount point according to your need. UUID stands for the universally unique identifier.

<img data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/07/echo/word-image-148.png" data-lazy- height="572" src="data:image/svg xml,” width=”770″>

Save and exit the file using the keyboard shortcut “CTRL S” and “CTRL X” and return to the terminal. Now, you can use the “mount” command to mount your CD/DVD drive permanently:

# mount /dev/sr0 /media/mount/

<img data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/07/echo/word-image-150.png" data-lazy- height="73" src="data:image/svg xml,” width=”724″>

That’s it, Congratulations! You have permanently mounted a CD drive.

Conclusion

This article has a comprehensive guide on how to mount a CD/DVD ROM on a CentOS 8 system. This method given above can be used to set up any block device on your system.

About the author

<img alt="" data-del="avatar" data-lazy-src="https://kirelos.com/wp-content/uploads/2021/07/echo/7011409B3A384F43A8417D1DAC68D179-150×150.jpg60e8c5690bda5.jpg" height="112" src="data:image/svg xml,” width=”112″>

Shehroz Azam

A Javascript Developer & Linux enthusiast with 4 years of industrial experience and proven know-how to combine creative and usability viewpoints resulting in world-class web applications. I have experience working with Vue, React & Node.js & currently working on article writing and video creation.