Subject: how many bytes on a CD?
To: None <email@example.com>
From: Steve Bellovin <firstname.lastname@example.org>
Date: 01/03/2002 12:29:48
Is there any way to tell how many bytes are actually on a CD?
I've written a small C program to copy a CD to a .iso file. It works,
but I'd rather not get ugly console messages about check conditions.
In theory, I would think I could look at the disk label. But I haven't
found any rational relationships between the number of bytes I can
read and the values that disklabel reports. For example, on one test
CD there are 10518528 bytes, both according to my program and according
to 'dd' on the cooked device with a blocksize of 512. Disklabel says
disklabel: can't read master boot record: Invalid argument
total sectors: 11906
headswitch: 0 # microseconds
track-to-track seek: 0 # microseconds
# size offset fstype [fsize bsize cpg/sgs]
a: 47624 0 ISO9660 # (Cyl. 0 - 476*)
d: 47624 0 ISO9660 # (Cyl. 0 - 476*)
disklabel: boot block size 0
disklabel: super block size 0
disklabel: partition a: partition extends past end of unit
disklabel: partition d: partition extends past end of unit
(Some of the values are larger for a bigger CD I checked.)