Mount CD-ROM in Linux

by on May 6, 2011 · 2 comments· LAST UPDATED May 19, 2014

in , ,

How do I mount a CD-ROM or DVD drive on a Linux operating system using command line bash shell based options?

You need to use the mount command to mount a CD-ROM or DVD disk under a Linux operating systems. First, you need to insert the CD or DVD in the server / laptop or desktop drive. Next, type the following mount command as the root use to mount discs.
Tutorial details
DifficultyEasy (rss)
Root privilegesYes
RequirementsNone
Estimated completion time2m

Finding out your CD/DVD names in Linux

Use the following command to find out the name Of DVD / CD-ROM / Writer / Blu-ray device on a Linux based system:
# lsblk

OR

# dmesg | egrep -i --color 'cdrom|dvd|cd/rw|writer'
Sample outputs (/dev/sr0):

[    5.437164] sr0: scsi3-mmc drive: 24x/24x writer dvd-ram cd/rw xa/form2 cdda tray
[    5.437307] cdrom: Uniform CD-ROM driver Revision: 3.20

Syntax to mount DVD / CDROM in Linux

The syntax is:
# mount -t iso9660 -o ro /dev/deviceName /path/to/mount/point
Create a mount point, type mkdir command as follows:
# mkdir -p /mnt/cdrom
Mount /dev/cdrom or /dev/sr0 as follows:
# mount -t iso9660 -o ro /dev/cdrom /mnt/cdrom
OR
# mount -t iso9660 -o ro /dev/sr0 /mnt/cdrom
Verify that CD/DVD mounted at the /cdrom or /mnt/cdrom, enter:

 
mount
df
 

/cdrom or /mnt/cdrom represents the mount point of the CD or DVD. To view or browse CD or DVD, enter:

 
ls -l /cdrom
cd /cdrom
ls
 

To copy a file called foo.txt to the /tmp, enter:

 
cd /cdrom
cp -v foo.txt /tmp
 

OR

 
cp -v /cdrom/foo.txt /tmp
 

How do I unmount CD-ROM or DVD on Linux?

Type the following command as the root user:
# umount /cdrom
OR
# umount /dev/cdrom
OR
# umount /mnt/cdrom

TwitterFacebookGoogle+PDF versionFound an error/typo on this page? Help us!

{ 2 comments… read them below or add one }

1 Joe Corneli August 27, 2013 at 2:40 pm

Sometimes the relevant device is

cdrw

, not cdrom.

Reply

2 sarav May 19, 2014 at 7:19 am

sometimes it is even /dev/sr0
It all depends on your linux flavour

Reply

Leave a Comment

Tagged as: , , , , , , , , , , , , , , , ,

Previous Faq:

Next Faq: