On Thu, 2005-01-27 at 12:58, Bill wrote:
> I'd suggest that it may be the drive if it is a different drive from that 
> used for the install.

The problem is not the drive, it's with a gray area in the POSIX
standards.

Drives with removable media don't have an end-of-file concept.  Thus,
you _can't_ stat /dev/cdrom and get the length of the disc image in
bytes from the st_size field, you get zero.  Quite literally, the kernel
doesn't know, even if the device drive does... and the stat call isn't
passed to the device driver to fill in.  Even if it was, it wouldn't
help for things like tape drives which don't know where the end is until
they go past it.

Typically, you have to seek within a device like this, reading a byte at
a time and seeing what you get back.  With a binary chop, you can
determine the size of the disc in the CD drive fairly quickly.  Once you
have the size, you can plug it into dd.  Or: you can read the iso9660
header and discover the exact length that way (it's a bug in mkisofs if
the two methods don't match).

The gray area is this: some device drivers report end-of-file when you
attempt to read a block past the end if the disc (read returns 0), while
others report I/O error (read returns -1 with errno set to EIO or
similar).  The dd command works just fine with the first form, but not
with the second form.  And device drivers run about 50/50 for what the
author chose to return.

-- 
Peter Miller <[EMAIL PROTECTED]>

Attachment: signature.asc
Description: This is a digitally signed message part

-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html

Reply via email to