CD/DVD/ISO images, readcd adding extra bytes at EOF?
aluminumsulfate at earthlink.net
aluminumsulfate at earthlink.net
Tue Sep 19 08:56:01 EDT 2006
From: "Ben Scott" <dragonhawk at gmail.com>
Date: Tue, 19 Sep 2006 07:42:49 -0400
I made an image copy of the DVD using the readcd(1) command:
readcd dev=/dev/scd0 f=FC-5-i386-DVD-readcd.iso
-rw-rw-r-- 1 root pubadmin 3253698560 Sep 18 21:59 FC-5-i386-DVD-readcd.iso
-rw-rw-r-- 1 bscott pubadmin 3253669888 Sep 19 00:57 FC-5-i386-DVD.iso
Anyone know what that extra 30 KB or so at the end of the readcd
image is, and why this happens? Is there a way to have produce an
image without extra stuff at the end of it?
I too have seen something like this... ironically enough only on Red Hat 6.
When copying data cds using dd (with no count= argument), the image file
contained a few more zero (ASCII 0) sectors than the original medium. Ever
since then, I run an extra "dd skip=" just to make sure it got the right
device length.
$ ls -l image.iso
-rw------- 1 user group 671088640 Sep 19 07:07 image.iso
$ dd if=/dev/cdrom of=image.iso
1310720+0 records in
1310720+0 records out
$ dd if=/dev/cdrom skip=1310720 # should report 0 records in/out
$ dd if=/dev/cdrom skip=1310719 of=/dev/null # should report 1 record in/out
$ echo $((1310720 * 512)) # should match file size from ls
I don't know how readcd reads the cd, but I know that dd has a
"conv=sync,noerror" option. This tells dd, when it encounters a read
error, to pad the read sector with ASCII 0 and to try to keep reading.
But a device EOF should not be mistaken as a media error by ANY
program. So, maybe the actual spiral of pits pressed into the surface
of the disk is a few sectors shorter than the disc's table of contents
claims it is. Or it could just be one of tohse Red Hat things. :)
More information about the gnhlug-discuss
mailing list