Jump to content

How to Mount CD-ROM on CentOS 8


Linux Hint

Recommended Posts

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:

$ su

word-image-137.png

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.

# blkid

The output will look something like the screenshot attached below:

word-image-138.png

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:

# blkid

word-image-139.png

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:

# mkdir /media/mount

word-image-141.png

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/

word-image-143.png

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.

# ls media/mount

word-image-144.png

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:

# sudo nano /etc/fstab

word-image-146.png

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

UUID=2021-04-28-16-51-58-26 /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.

word-image-148.png

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/

word-image-150.png

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.

View the full article

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...