Docs/SysAdmin/Config/ISOwriting
From Mandriva Community Wiki
Contents |
[edit] Bad Md5sums? (maybe not)
Just burned a CD from an ISO image and the md5sum doesn't match? The CD may be just fine... what you may be experiencing is padding which alters the md5sum. Before throwing away the CD and cursing, try this:
$ cmp /dev/cdrom ISO_image
For example, I got a bad md5sum from my 9.2beta1 CD1:
$ dd if=/dev/cdrom | md5sum 1333216+0 records in 1333216+0 records out e82309091ad6b44a1218dc6f33c3b058 -
It should be:
7a0479dc917d35bd822cecb558c8d432
So, I tried:
$ cmp /dev/cdrom /ISO/Mandrake/MandrakeLinux-9.2beta1-CD1.i586.iso cmp: EOF on /ISO/Mandrake/MandrakeLinux-9.2beta1-CD1.i586.iso
The EOF on the ISO image means that the CD image is an EXACT copy PLUS padding. An EOF on /mnt/cdrom would have meant the CD was incomplete.
Just to prove the CD was really OK, I issued this piped string of commands:
$ dd if=/dev/cdrom | head -c 682575872 | md5sum 1333162+0 records in 1333161+0 records out 7a0479dc917d35bd822cecb558c8d432 -
Got the correct md5sum... :^) BTW, 682575872 is simply the length of that particular ISO image.
So, more generically, we can use this pipe stream:
$dd if=/dev/cdrom | head -c `stat --format=%s ISO_image` | md5sum
i.e.,
$ dd if=/dev/cdrom | head -c `stat --format=%s /ISO/Mandrake/MandrakeLinux-9.2beta1-CD1.i586.iso` | md5sum 1333162+0 records in 1333161+0 records out 7a0479dc917d35bd822cecb558c8d432 -
For the purists, the size can be passed as an argument to dd like this (not verified):
$ dd if=/dev/cdrom bs=`stat --format=%s ISO_image` | md5sum
It's also possible for the ISO image file to be larger than the data stored on the CDROM. For example, all the Mandriva 10.1 ISO image files are padded at the end with a block of 2048 zeros. When k3b is used to burn a CDROM, the last block of zeros doesn't get written. So one can compensate with
$ dd if=/dev/cdrom ibs=2048 ; dd if=/dev/zero ibs=2048 count=1 ) | md5sum
[edit] Is NRG the same as ISO?
You've got a lot .NRG files from your friend and you don't want to dualboot with Windows just to burn then from Nero CD burning tool? There's no need for that. You can simply convert them to standard ISO format. How?
NRG2ISO tool
Just type :
$ nrg2iso image.nrg image.iso
and the progress bar will show you the status of the conversion.
[edit] Links
[edit] Using dd
If you cannot download nrg2iso you can always use dd command:
$ dd if=image.nrg of=cdrom.iso bs=512 skip=600
You can always try to use Mount ISO image for KDE, which is supposed to convert BIN/Cue/NRG images to ISO format on the fly, and then mount it. Though I haven't tried it.
Personally I'd recommend using nrg2iso tool.