Creating ISOs from a CD from Terminal

Interested in making a raw CD image or ISOunder BeOS? The easiest way to do so is by using Burn-It Now, a visual application. However, you can also create ISOimages via the Terminal with a little command called cat, which allows you to view the contents of any file and includes a few other little-known functions.
First open a terminal and cd to /dev/disk. Under disk their are three directories called scsi, virtual, and ide. This is where knowledge of your system hardware has to come in. Here is an example of creating an ISO from a CD-ROM drive connected to the primary ide channel as a slave device:

cat /dev/disk/ide/ata/0/slave/0/raw > ~/mycd.iso

As you can see, /ata is the IDE controller that the CD-ROM is connected to. After ata the directory under it 0 is the physical channel the CD-ROM is attached to. If your CD-ROM were connected to the secondary channel, then 1 would be used instead of 0. Slave is pretty much self-explanatory, but again, if the CD-ROM is the master on the chain then master would be used instead of slave. After slave comes 0 again and if I am correct 0 is the actual CD-ROM drive.
Finally, raw is the raw data in binary form on the cd. The output of the command is redirected to another file via the little arrow in the command above — in this case we output to mycd.iso under our home directory.
For SCSI users it is pretty much the same, e.g.

cat /dev/disk/SCSI/0/6/0/raw > /boot/home/mycd.ISO

is for a CD-ROM drive connected to the primary SCSI controller 0, set to id 6 on the chain with device name „0“.
In order to burn this ISO to CD, you have to use cdrecord which is covered in another tip. cat is a very powerful command and can do some damage if you experiment with it without caution. cat will overwrite disk partitions, which can be good or bad. I used cat to back up a 4MB Linux ext2 file system on an IA flash disk. I could then easily restore the Linux partition whenever I wanted to return the device back to normal operation.



No comments so far.

(comments are closed)