CD-ROM drives in Unix
This page gives instructions on how to read from the CD-ROM drives on
Unix machines. The various methods are outlined below. Keep in mind that
the Solaris machines use different methods than do the Linux machines.
If one way doesn’t work, try another. For more complete
documentation of these commands, view the man pages on your machine.
-
Load your CD into the CD-ROM drive.
-
Run
volcheck to mount your CD (might not be necessary).
(thetick) % volcheck
-
Check to see where your CD was mounted.
(thetick) % /usr/sbin/mount | grep cdrom
You should see something similar to the following:
/cdrom/new on /vol/dev/dsk/c0t2d0/new read only\
/nosuid/maplcase/noglobal/rr/traildot/dev=16c0009 \
on Sun May 4 15:59:20 2003
This tells us that the CD is now mounted on /cdrom/new, and is
usable just like other read-only partitions.
To change to that directory, type:
(thetick) % cd /cdrom/new
To copy the file foo.txt from the CD to your home directory, type:
(thetick) % cp /cdrom/new/foo.txt ~/
-
When you are done using your CD, type the following command to
eject it from the drive:
(thetick) % eject cdrom
For more information see the Sun Product Documentation for
volcheck and
Managing Removable Media
Gnome automatically mounts CD media on the Ubuntu1 platform.
For Ubuntu machines the cd can be mounted using the 'pmount'
method, detailed on the
USB Drives help page,
with the device '/dev/cdrom'.
-
Load your CD into the CD-ROM drive.
-
Use the
mount command to mount your CD.
user@lind24-3 (~) % mount /cdrom
The CD is now mounted on /cdrom, and is usable just like other
read-only partitions.
To change to that directory, type:
user@lind24-3 % cd /cdrom
To copy the file foo.txt from the CD to your home directory, type:
user@lind24-3 % cp /cdrom/foo.txt ~/
-
When you are done using your CD, type the following command
to eject it from the drive:
user@lind24-3 % eject /cdrom
or
user@lind24-3 % umount /cdrom
user@lind24-3 % eject cdrom
If you try to play an audio CD and it seems like it isn’t playing,
this is because Dell no longer usually packages the audio cable with
new CD-ROM drives. To fix this problem you can use XMMS which can
digitally extract the audio and play it back over the sound card.
If you are using Ubuntu1 platform and Gnome:
-
Go to the menu bar (upper left-hand corner) and choose
Computer->Desktop Preferences->Removable Storage
-
Change the audio CD command to: xmms /media/cdrom
On all platforms:
-
Launch XMMS. Either type 'xmms' in a terminal or choose
Applications->Multimedia->XMMS or Applications->Sound &
Video->XMMS from the Gnome menus.
-
Press <ctrl>-<p> while focused on the XMMS window.
-
Change your output plugin to ALSA.
-
Choose the CD Input Plugin and press configure.
-
Insert '/dev/cdrom' in Device
-
Insert '/media/cdrom' in Directory
-
Choose Digital Audio Extraction
-
Press OK
-
Press OK
-
Either insert a CD and it will start playing for Gnome,
or run 'xmms /media/cdrom'.
The cdtool package allows you to play and catalog audio CD-ROMs on
CD-ROM drive(s). It includes the following commands:
cdadd
cdeject [-V|-?|-h]
cdir -n [-r|-s|-t|-V|-?|-h]
cdinfo [-a|-r|-s|-t|-v|-V|-?|-h]
cdpause [-V|-?|-h]
cdplay [start [stop]]
cdplay [+|- number]
cdplay [start|stop|resume|eject|info|dir]
cdplay [-V|-?|-h]
cdstop [-V|-?|-h]
cdvolume [-V|-?|-h|level]
cdshuffle [-V|-?|-h]
-
[-h|-?] Print out help for the command.
-
-V Print out version information and build information.
-
The
cdadd command is a shell script which
uses cdir -t and assists users in adding a new entry
to the ~/.cdtooldb database file. It allows the user
to edit a blank template database entry for the current
compact disc, and then appends it to the file.
-
The
cdeject command ejects the current compact disc.
-
The
cdir command lists information about the currently
loaded audio compact disc. In particular, it lists the
lengths of all tracks. It also references the database files specified
in the CDTOOLPATHDB environment variable and the
~/.cdtooldb file. If one of these files contains an entry
for the current compact disc, cdir will print title,
artist, and track name information.
-n |
|
Do not look up any information in the database files. |
-s | |
Print information in a short format: only author,
title, and current track, all on one line.
|
-t |
|
Print a template for the current cd, including title, artist,
and track name information if available. If blank lines are filled in,
this can be appended to the ~/.cdtooldb file.
|
-
The
cdinfo command, with no option used, will print
out the audio status (playing, etc.).
-a |
|
Print out the absolute disc time. |
-r |
|
Print out the relative track time. |
-s |
|
Print out the audio status. |
-t |
|
Print out the current track. |
-v |
|
All info: status track absolute relative. |
-
The
cdpause command pauses the currently playing compact disc.
Resume by using cdplay with no arguments.
-
The
cdplay command plays the compact disc.
If called with one argument, this is the starting track number.
If called with two arguments, these are the starting and stopping track numbers.
If the first argument is a + or - then skip the number of tracks given by
the second argument forward or backward. If no second argument is give, skip one.
A 0 as first argument or no argument replays current track.
-
The
cdstop command stops the compact disc, if it is
playing.
-
The
cdvolume command sets the output volume level of
the CD player. The level is an integer from 0 to 255.
-
The
cdshuffle command plays the audio tracks on the
disc in random order
For more information, see the
cdtool home page.
If you would like a more complete description of these commands, or if you
are using a machine with multiple CD-ROM drives, please view the man pages
on your machine:
man <command>
If you have any trouble with these procedures, please contact the the
Systems Operator for assistance.
|