HowTo mount cdrom in linux
|
|
From Linux Config Wiki
CD's and DVDs are usinf iso9660 filesytem. As any other Operating systems Linux is also able to read data from standart iso9660 filesystem. Lets see how we can mount cd.
Contents |
Media
Detecting CD-ROM/DVD-ROM drive
If we are not sure which block device is our DVD-ROM or CD-ROM we can find out simply by running command:
# wodim -devices
If the wodim command is not available on your system make sure that package cdrecord is installed. After running wodim command you should get output similar to one below:
Well, now its clear that my CD-ROM drive is know by my system as block device /dev/hdc
Testing for iso9660 compatibility
Lets see of my current kernel supports iso9660 filesystem.
# cat /proc/filesystems
This command should report available iso9660 filesystem.
Creating mount point
Probably there is already mount point on you system. Usually it is /cdrom, /media/cdrom, /media/cdrom0 or /mnt/cdrom . If this not you case create mount point now.
# mkdir /media/cdrom0
Mounting CD
As a root issue command:
# mount -t iso9660 /dev/hdc /media/cdrom0/
your CD is now mounted as /media/cdrom0/. Navigate to this directory to see its content.
Mounting Audio CD's
Sometimes you would like to listen to your favorite music and when you try mount music cd with a command above you can get problems like:
linuxconfig.org# 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
linuxconfig.org#
This is because music CD's does not contain standard iso9660 filesystem. In fact the story with music cd's is easier as a story with data CD's with iso9660 filesystem. In order to listen to music CD just insert it into CD-ROM/DVD-ROM drive and fire up you favorite music CD player.
Only think you need to be concern about is if you have "kdemultimedia-kio-plugins" for KDE or in case of gnome "gnome-media" packages installed which also helps you to browse CD content. In case you would like to see content of music CD just start "KONQUEROR" and enter location:
audiocd:/
Altering /etc/fstab
To allow users on the system mount CD's or DVD's you can alter your /etc/fstab by add line similar to this:
/dev/hdc /media/cdrom0 iso9660 ro,user,noauto 0 0
Unmount and eject CD
There are couple ways how to remove CD/DVD from a drive.
# unmout /dev/hdc # eject
or you can simply run
# eject
If you are unable to unmount, make sure, that you are not in mount point directory of device you are trying to unmount or some other application is not using it. If still you have a problem to unmount desired drive you can use fuser command to kill all related processes in regards to your drive.
# fuser -mk /dev/hdc # eject




