Programming and Scripting :: Making CD/DVD images



Am I assuming right if it's this simple:
Code Sample
cat /dev/cdrom >> cdimage.iso
or
Code Sample
cp /dev/cdrom cdimage.iso


Or as compressed:
Code Sample
bzip2 /dev/cdrom >> cdimage.iso.bz


Is any of those the right way?

it's generally done either with dd or mkisofs.  Using the methods you mention (with the exception of cat, perhaps?) do not properly keep the filesystem and file permissions/ownership intact, so you're essentially just making a backup of the files themselves.

"dd if=/dev/cdrom of=cdimage.iso" is probably the simplest way.

Ok.
So with command dd it's for sure. dd makes exact copies?

So..
Code Sample
dd if=/dev/cdrom | bzip2 >> cdimage.iso.bz2
Is the best/easiest way to make it compressed?

Actually 7zip would be the best to archive best compression.
http://warp.povusers.org/ArchiverComparison

As far as I can tell you, dd makes exact copies.
I've only used it maybe 6 or 7 times in my life, but it seems to be pretty much a cloning tool

Your code sample looks like it should work as expected.

Some things in UNIX world just are more simple than in Windows world. =)

But on to next question:
Let's say:
I have my hard disk image named hd.iso.
I want to put all the data back from it to hda.
I have made the image like this:
Code Sample
dd if=/dev/hda of=hd.iso

If I do this:
Code Sample
cat hd.iso >> /dev/hda
I belive it writes all the data back to it (boot sector, partition table, contents, etc...)?

But if I create image from a partition (for example /dev/hda1) it includes only the contents of that partition (excluding partition info, bootsector; but including file permissions)?

Back in the days when I used Macintosh I could create CD:s with partitions more than one. So if I had 650Mb hard disk around here divided to two or more partitions and I make image of it. Then burn to CD. The CD would have those partitions? If so, how would the partitions be shown in /dev?

Next Page...
original here.