This article is available in: English Castellano ChineseGB Deutsch Francais Nederlands Turkce Korean |
by Yao Feng 关于作者: He is a Linux fan besides working in a campus network center. Hobbies:hamradio, swimming. Using Linux as a normal user for one year, doing system administration on Linux/Unix for another year. Finishing the graduate thesis on billing systems with a Linux based proxy server. 正文: |
摘要:
This article gives a short but useful description on how to use your CD-ROM under Linux. It describes how to find the CD-ROM device, mount (make available) the CD-ROM, read the contents, umount it and gives some hints for troubleshooting.
$ dmesg |more
. . . hda: QUANTUM FIREBALL CR8.4A, ATA DISK drive hdc: CD-ROM CDU701, ATAPI CDROM drive ide0 at 0x1f0-0x1f7,0x3f6 on irq 14 ide1 at 0x170-0x177,0x376 on irq 15 hda: QUANTUM FIREBALL CR8.4A, 8063MB w/418kB Cache, CHS=16383/16/63, (U)DMA hdc: ATAPI 14X CD-ROM drive, 128kB Cache Uniform CDROM driver Revision: 2.55 . . . |
$ dmesg |more
. . . Detected SCSI removable disk sdc at scsi0, channel 0, id 5, lun 0 Vendor: PLEXTOR Model: CD-ROM PX-12TS Rev: 1.03 Type: CD-ROM ANSI SCSI revision: 02 Detected scsi CD-ROM sr0 at scsi0, channel 0, id 6, lun 0 scsi : detected 1 SCSI cdrom 3 SCSI disks total. . . |
The 'hdc: CD-ROM CDU701, ATAPI CDROM drive' line tells us that you have a CD-ROM IDE/ATAPI-CD drive attached on the computer. Linux assign it a device name-'hdc' for access later on. The name of device depends on the hardware type and it is hdc in the first case and sdc in the case where you have SCSI CD-ROM.
#mount /dev/hdc -t iso9660 -r /cdrom |
in case of a scsi cd-rom this is #mount /dev/sdc0 -t iso9660 -r /cdrom |
The device name of the CD-ROM is the one that was shown
in the output of the dmesg command.
$ df
Filesystem 1024-blocks Used Available Capacity Mounted on /dev/sda1 2974519 1516768 1303931 54% / /dev/sda3 2686158 2378788 153548 94% /home /dev/hdc 603646 603646 0 100% /cdrom |
Now you can now access your cd-rom like a normal directory at /cdrom.
#umount /cdrom or alternatively you can type #umount /dev/hdc |
In case of the scsi cd this is: #umount /dev/sdc0 |
When you are logged in as root you can do anything but you
can also accidently do more than you wanted to. It is therefore better to
make the cdrom mountable for ordinary users. To give the privileges to
mount a drive to any user you must first log in as root and
do 3 things:
To make the directory /cdrom world writable you type (while no cdrom is mounted!):
#chmod 777 /cdrom |
To make the device world writable you type (use the device name as described in the first chapter):
for the ATAPI cdrom: #chmod 666 /dev/hdc |
for the SCSI cdrom: #chmod 666 /dev/scd0 |
Now you must edit /etc/fstab and give the permission to mount the cdrom to any user. This is done by inserting the line following line:
/dev/hdc /cdrom iso9660 ro,noauto,user 0 0 |
In the case of the scsi cdrom this looks like:
/dev/sdc0 /cdrom iso9660 ro,noauto,user 0 0 |
Save the fstab file and log in as normal user. Now insert a CD into the drive and mount it with the command:
$mount /cdrom |
|
主页由LinuxFocus编辑组维护
© Yao Feng, FDL LinuxFocus.org Click here to report a fault or send a comment to Linuxfocus |
2001-01-01, generated by lfparser version 2.4