Creating ISO images in a CDRWless laptop

duncan brown duncanbrown at linuxadvocate.net
Fri May 14 14:37:26 UTC 2004


David Colomer said:
> Fist of all my apologies for my lack of knowledge, but I am planning to
> move my laptop from FC1 to FC2. I have a large amount of information
> that I want to put into CDs before to move to FC2.

for posterity, i'm going to paste in the cdrecording faq/howto i've been
working on into this email.  hopefully it'll help it get some
distribution.

there's still more work i want to do on it, but here you go:

everything you've ever wanted to know about cd burning but were afraid to ask

in this article, i'm going to breeze through many cd burning methods and ways
to interact with disc images.

------------------------------------------------------------------------------

creating a basic iso disc image from local files

one of the things you have to ensure before creating an iso for burning is
that you're not exceeding the 650/700MB limit of your media.

let's say that what you want to burn is in the directory ./files and we want
to check the size.

  # du -sh ./files

now, we want to create our iso image, microsoft requires joliet (-J)
information
on the disc to properly render the long filenames, and rock ridge (-R) for
long
filenames under linux/unix.

  # mkisofs -RJ -o image.iso ./files

extremely easy.  no muss, no fuss.

------------------------------------------------------------------------------

creating an iso disc image from a cd-rom

let's assume that your cd drive with the cd-rom is located at /dev/cdrom and
it is NOT mounted.

now, we want to use dd to make an exact copy of the disc to an .iso file.
please note that this does not work if the disc you're working with is a
multi-session disc (audio and data).

  # dd if=/dev/cdrom of=image.iso

again, extremely easy.  no muss, no fuss.

------------------------------------------------------------------------------

burning an iso image to a blank cd

first, we need to find out what scsi id your cd writer is.  linux uses a scsi
emulation layer for all ide cd burners, usb key drives and firewire.

  # cdrecord -scanbus

there will be a line with your cd burner pretty clearly labeled.  the first
bit (with 3 numbers seperated by commas) is what you're looking for.  let's
assume that it reported that your cd burner is located at 0,0,0

  # cdrecord -v speed=40 dev=0,0,0 image.iso

let's think about what we just read:

-v is telling cdrecord to give us moderately verbose output, otherwise we'll
be clueless about the progress of the burn until it is completed.

speed=40 is telling the cd burner to burn at 40x, you can temper this to the
speed of your cd burner.  it's best not to get too nuts with this number on a
machine with a limited amount of ram (256 megs or less) and a slower
processor
(around 400mhz).  if you're one of the unfortunate, keep it down to 4-8x.

the dev=0,0,0 is the scsi id we were returned with -scanbus

and, of course, image.iso is the image we're trying to burn.

------------------------------------------------------------------------------

checking the validity of the iso you just downloaded

typically, an .iso file will come with a file containing md5sums of the
image,
this is typically called MD5SUMS or something similar.

to get the md5sum of an image, use this command

md5sum image.iso

now, md5sum also has a -c option to check md5sums against a file, but many
distributions sign the md5sum file with gpg/pgp, so you'll need to edit out
that information first and just leave the lines containing the md5sum and the
file.

an md5sum line looks like this:

a6330a9a07c592d15d291929d142e64f  image.iso

now, check the isos against the md5sum file

  # md5sum -c MD5SUMS

md5sum will go through each file in the MD5SUMS file and check the signature
of each, reporting an OK for each file that passes the test.

------------------------------------------------------------------------------

blanking a cd-rw disc

as before, use the following command to find out your cd-rw drive's scsi id

  # cdrecord -scanbus

now we take scsi id that was returned (let's say 0,0,0) and we want to blank
this disc quickly (who has time to putz around?)

  # cdrecord blank=fast dev=0,0,0

now, let's pretend that it didn't work.   let's try a little harder.

  # cdrecord blank=all dev=0,0,0

ok, let's pretend it's being really ill tempered.  let's try one last tactic
before throwing away the disc and adding to the waste dumps.

  # cdrecord blank=all -force dev=0,0,0

------------------------------------------------------------------------------

copying from one disc to another

first, we'll place our source disc in our /dev/cdrom drive

now, we've used the following command

  # cdrecord -scanbus

and found our scsi id (let's say it's 0,0,0).  let's copy that disc with the
following command.

  # cdrecord -v dev=0,0,0 -isosize /dev/cdrom

let's take a look at we just did

-v is for verbose output

dev=0,0,0 tells cdrecord to use the device at scsi address 0,0,0

-isosize tells cdrecord use the limits of iso discs and specifications while
burning this file (something that mkisofs already takes care of)

------------------------------------------------------------------------------

copying an audio cd

here we'll introduce a new command, cdparanoia.  this program will rip the
contents of your audio cd to your hard-drive in several formats and is one of
the tools used in my own cd2ogg cd ripping and encoding script.

first, create a temporary directory to store our .wav files

  # mkdir ./audio_temp
  # cd audio_temp

now we'll run this command

  # cdparanoia -d /dev/cdrom -w 1-

what'd we just type?

-d /dev/cdrom tells cdparanoia to use /dev/cdrom, you can specify any drive
with an audio cd in it.

-w tells cdparanoia to create .wav audio files

1- instructs the program to rip from track 1 and up

and now for the final step, burning the cd with cdrecord

  # cdrecord -v dev=0,0,0 speed=12 -audio -pad *.wav

-v is ver verbose

dev=0,0,0 specifies our cd device

speed=12 specifies the recording speed we want

-audio tells cdrecord that we're recording audio tracks not disc images

-pad tells cdrecord to pad the audio files if necessary to conform to cd
specs

------------------------------------------------------------------------------

mounting a cd image

this is relatively easy, and as with everything else in this article, you
must
be root to perform the actions.  keep in mind that this will be read only and
you will not be able to make changes to the image.

first, we have to make a mount point

  # mkdir ./mountpoint

now, we mount the disc image on ./mountpoint

  # mount -o loop image.iso ./mountpoint

-o loop tells mount to create a temporary /dev device called /dev/loopX where
is is one higher than the number of the last created loop device.

image.iso is our image file

./mountpoint is where we're mounting it





+( duncan brown : duncanbrown at linuxadvocate.net )+
+(  linux "just works" : www.linuxadvocate.net  )+

--------------------------------------------------
Understatement of the century:
"Hello everybody out there using minix - I'm doing
a (free) operating system (just a hobby, won't be
big and professional like gnu) for 386(486) AT
clones"
         - Linus Torvalds, August 1991
--------------------------------------------------






More information about the fedora-list mailing list