Compact Disk Recording Examples
NOTE THAT AS OF 08/18/2001 THERE ARE TWO VERSIONS OF MKISOFS INSTALLED;
ONE FROM CDRECORD (IN /USR/LOCAL/BIN) AND THE OTHER FROM SOLARIS
(IN /USR/BIN). The Solaris one can make hybrid disk images (ISO9660/JOLIET/HFS)
where as the Cdrecord one can only make ISO9660/JOLIET hybrids. We are making
both available until people report that the new Solaris one works okay.
The mkisofs examples below are from the cdrecord
version.
Examples
- cdrecord -scanbus Lists devices found on the SCSI bus.
- cdrw -l Lists CD-R and CD-RW drives attached to this workstation.
- cdrecord -inq -dev 1,2,0 Lists capabilities of the CD-R drive at
the specified address.
- cdrw -M Lists contents of CD-R and CD-RW drives. Handy for telling
you that the drive has no media in it or if a CD-RW disk is blank.
- cdrecord -dev 1,2,0 -eject Opens the CD tray on a specific drive.
- cdrecord -dev 1,2,0 -load Closes the CD tray on a specific drive.
- mkisofs -r -o my_iso_image mydirectory will make an ISO 9660 disk
image called my_iso_image from the directory tree mydirectory.
The -r flag says to make sure that all of the files and directories in the
image are world readable.
- mkisofs -J -r -o my_iso_image mydirectory same as above, but will
add Joliet file name information to the ISO 9660 information. This allows long
file names and more complicated directory structures than a plain ISO disk image.
- isoinfo -l -i my_iso_image will list the contents of my_iso_image
in a similar fashion to the "ls -lR" command run on a directory.
- dd if=/vol/dev/rdsk/c1t2d0/unnamed_cdrom#1 bs=64k of=/data1/titanium/CDR-SCRATCH/your_userid/disk.image.dd
This reads in the contents of a CD in the internal drive and writes it to a
disk file. Now you can list the contents of the disk image with isoinfo,
or mount the image as a file system with fbkmount or hmount, then use the
Solaris ls or the hfsutils hls commands to check the file lengths.
- dd bs=64k if=/data1/titanium/CDR-SCRATCH/your_userid/disk.image.dd |
cdrecord -dev 1,2,0 -speed=8 -
This reads in the disk file and passes it through a software pipe to cdrecord,
which writes it to the blank disk.
- dd if=/vol/dev/rdsk/c1t2d0/unnamed_cdrom#1 bs=64k | cdrecord -dev 1,2,0 -speed=8 -
(Note the trailing dash, which indicates that cdrecord should read data
from a pipe. And, that input file name was discovered with the eject -n
trick mentioned below. The path may be different for each CD!)
This reads data from the internal CD-ROM (read-only) drive on titanium
and passes it through a pipe to cdrecord, which writes it to the blank disk
in the CD-R (read-write) drive. This has been tried once and was successful.
Of course, one does not get a chance to examine the data before it is
written. Because the stream of data to a CD-R cannot be interrupted without
fatally damaging the new disk being created, you may not want to do this if
someone is keeping titanium very busy. On the other hand, our Plextor drive
has a large (4 megabyte) built-in RAM cache and the dd blocking factor (of
64 kilobytes) is fairly large. So even if there were short interruptions,
enough data should be in the caches to keep the laser well fed. Obviously,
when copying disks this method is twice as fast as reading the source CD to
a disk file, then writing the disk file to the blank CD.
- cdrecord -dummy Goes through all of the steps of the recording
process, but with the laser is turned off during the procedure. Of course
you need all of the other normal cdrecord arguments to specify the drive
and the writing speed and ...
This was only tested once. It was non-intuitive because the WRITE light
on the front of the Plextor went ON during the operation. But nothing was
actually written. And it reported an I/O error afterwards. However, using
this once might make you feel more comfortable that you have selected the
correct arguments.
- eject -n lists the nicknames one can use with the Solaris
eject command. This list of devices does NOT include the CD-R drive, which
is NOT managed by the vold Volume Management Daemon. However, it does tell
you what name vold has given to a CD inserted into the internal CD-ROM drive.
You can then use this pathname to read from the source CD (with dd for example).
A sample output line:
cdrom0 -> /vol/dev/rdsk/c1t2d0/unnamed_cdrom
- hmount /vol/dev/rdsk/c1t2d0/photodeluxe This mounts the HFS volume
(Macintosh) found on the specified CD (in the internal drive). Now it can be
browsed with the hls command. One needs to run the "humount" command afterward
to unmount the file system. hmount keeps info about the mounted volume
in the file $HOME/.hcwd. This might be helpful to someone if hmount gets
confused. You can also hmount a file on the hard disk, of course. Note that
the hls command requires the file system to be mounted first, unlike the
isoinfo program (for ISO 9660 images), which can be run on the raw file
system image file.
- cdda2wav -D1,2,0 -J Get some information about the tracks on a
music CD located in the CD-R drive! (It is not known if some
argument to cdda2wav can make it read music CD's inserted into the internal
CD drives on tungsten and titanium, which are not on a SCSI bus, but an IDE or ATAPI bus.
If you figure out such a command, let us know and we'll update this page!)
Warning: Unless used with the right arguements, cdda2wav might create audio
files in your current working directory. So watch out for that -- they are
quite large!
- cdda2wav -D1,2,0 -S 8 -B
Read in, at eight speed, all of the tracks of a music CD (in the Plextor
drive) to a series of au-formatted files in the current directory. The
-B stands for "bulk" The files are named audio_##.{au,inf}
- cdda2wav -D1,2,0 -S 8 -O au -t2 -q
Read in track 2 of a music CD (in the Plextor drive) to an au-format file
at 8 speed (so the task is accomplished quickly, not so the music is sped
up) in non-verbose mode. Two (one of them BIG) files will be
created in the current working directory: audio.au and audio.inf
One can use the audiotool program to play au files on Sun workstations
if you are logged in and therefore (temporarily) own the /dev/audio device.
- cdrecord -dev 1,2,0 -speed=4 -audio audio_01.au audio_02.au audio_03.au
This has been tested with a string of eleven AU files listed in a row. (Beware
of using a shell wildcard character like "*.au" because the shell might expand
the wildcard in a non-alphabetical order and your tracks would be written
in an order other than what you desired.) You also need to make sure that the
total of the tracks is less than 74 minutes, the capacity of a normal CD.
You can get the length of each track from the *.inf file.
This would have worked with WAV files too. It is unknown whether cdrecord
will correctly convert a mixed list of WAV and AU files. It would probably
work but try it at your own risk.