Run Linux CD-DVD players

How to mount CD-ROM on Linux

CDs and DVDs use the ISO9660 file system. The aim of ISO9660 is to provide a data exchange standard between different operating systems. As a result, any Linux operating system can handle the ISO9660 file system. This manual describes how to mount / unmount the ISO9660 file system on Linux and thus enable the user to read data from CD or DVD media.

If you still have questions after reading this article, please visit our new Linux forum.

First, we need to find usable devices that can read ISO9660 data. In other words, we need to find CD / DVD drives available on our Linux system. To do this, we can use the "wodim" command and its --devices option. wodim scans and outputs symbolic device names that are located in the / dev / * directory:

# wodim --devices

If there is no wodim command available on your system, make sure the cdrecord package is installed on your system.

Debian and Ubuntu:

# apt-get install wodim OR DEPENDING ON YOUR VERSION # apt-get install cdrecord

RedHat, Fedora, CentOS:

# yum install cdrecord

Once you run the wodim command and have some CD / DVD device hardware available in your system, you should see output similar to the following:

$ wodim --devices wodim: Overview of accessible drives (1 found): ---------------------------------- --------------------------------------- 0 dev = '/ dev / scd0' rwrw- -: 'TSSTcorp' 'CD / DVDW SH-S183L' ------------------------------------- ------------------------------------

From the above output, we can see that our CD-ROM / DVD-ROM drive can be accessed under the symbolic location / dev / scd0.

It should also be mentioned that different systems may behave differently. For example, in Debian Linux, a user who runs the wodim command must belong to the cdrom group. Otherwise, the wodim command fails with an error message similar to the following:

wodim: No such file or directory. Cannot open SCSI driver! For possible targets try 'wodim --devices' or 'wodim -scanbus'. For possible transport specifiers try 'wodim dev = help'. For IDE / ATAPI devices configuration, see the file README.ATAPI.setup from the wodim documentation.

Your Linux system may already have created a mount point for you. Usually this is / cdrom, / media / cdrom, / media / cdrom0 or / mnt / cdrom. If not, you can create your own mount point. Having assembly points available is an absolute must! The mount point represents a location from which data on CD or DVD can be made accessible to the user.

# mkdir / media / cdrom

If you do not belong to the CD-ROM group and therefore do not have permission to mount the CD-ROM, switch to the root user and run the following command:

# mount -t iso9660 / dev / scd0 / media / cdrom mount: block device / dev / sr0 is write-protected, mounting read-only

Your CD-ROM is now mounted and accessible via the directory / media / cdrom. At this point, simply navigate to that directory to access your data.

Sometimes you want to listen to your favorite music and when you try to mount music CD with a command above you may encounter problems like:

linuxcareer.com # mount -t iso9660 / dev / hdc / media / cdrom0 /
mount: block device / dev / hdc is write-protected, mounting read-only
mount: wrong fs type, bad option, bad superblock on / dev / hdc,
missing codepage or other error
In some cases useful info is found in syslog - try
dmesg | tail or so

linuxcareer.com #

This is because music CDs do not contain a standard ISO9660 file system as such. In fact, the story is easier with music CD-ROMs than with data CD-ROMs that use the iso9660 file system.

To listen to a music CD, all you have to do is insert a music CD (Compact Dics) into the CD-ROM / DVD-ROM drive and start your favorite music CD player. The only thing to worry about is whether you have the kdemultimedia-kio-plugins package for KDE or the gnome-media package for gnome window manager installed. You can use these packages to listen to music CD content.

If you want to see some of the content of your music CD or want to convert some music tracks to MP3 / OGG format, just start "KONQUEROR" and enter the storage location:

audiocd: /

in Konqueror's navigation bar.

You can also allow users on the system to mount CDs or DVDs. To do this, edit your / etc / fstab file and add a line similar to the following:

/ dev / sdc0 / media / cdrom0 iso9660 ro, user, auto 0 0

There are several ways to remove / remove CD-ROMs.

# umout / dev / hdc
# eject

or you can just run:

# eject

If you cannot unmount your previously mounted CD-ROM, make sure that you are not in the directory where your CD-ROM is mounted or that another application is not using it.

If you continue to have problems unmounting your CD-ROM media, you can use the fuser command to kill all related processes with your device.

# fuser -mk / dev / hdc
# eject

NOTE: Never use the above command on devices that have read / write operations installed unless you are sure what you are doing.

Testing for ISO9660 support

While it is very unlikely that your system does not support that particular file system, here are some tips for testing ISO9660 presence in your Linux system.

If you run into problems, try using the lsmod command or by reading some of the contents of the / proc / filesystem file to check for loaded kernel modules:

# cat / proc / filesystems | grep iso9660

or

# lsmode | grep iso9660

The actual module is part of the libiso9660 package. Both commands should report the available ISO9660 file system.

If you get an error message that says: # wodim --devices wodim: Overview of accessible drives (1 found): ------------------------- ------------------------------------------------ 0 dev = '/ dev / sg1' rwrw--: 'VBOX' 'CD-ROM' ------------------------------- ------------------------------------------ # mount -t iso9660 / dev / sg1 / media / cdrom mount: / dev / sg1 is not a block device The command output is misleading. Instead, try the following command to identify the correct block device on your CD-ROM device: # ls -al / dev / cdrom * lrwxrwxrwx 1 root root 3 Nov 9 13:06 / dev / cdrom -> sr0

Something like that