[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: ISO file size in bytes?

On Wed, Oct 24, 2007 at 09:03:45PM -0600, Jerry Williams wrote:
> Would it be possible to list the iso file size in bytes in the SHA1SUM file?
> The reason that I ask it is that I had a DVD with Fedora 7 on it and needed
> a copy of the iso file.  So I did a dd on the DVD, but the file ended up
> being bigger than the original iso file.  I had to know the size so I could
> enter the number of blocks to copy.
> It is much quicker to do an ls -l than it is to run sha1sum on a file.
> If the size is right then run the sha1sum.
> Or is the size listed on some web page some place?
> Everywhere I have looked I end up with an estimate.

When reading a the file itself with isoinfo, it'll tell you:

$ isoinfo -d -i F-7-x86_64-DVD.iso 
Logical block size is: 2048
Volume size is: 1683582

If you're reading a physical CD or DVD, you can do the same thing.
Here's a little script I use all the time for getting the size right.
It prompts you for the name of the ISO you want to create, then reads
the media using dd; repeat until Ctrl-C.

IIRC there was something about using -pad when writing media, but I
haven't had to do that for a while...


Matt Domsch
Linux Technology Strategist, Dell Office of the CTO
linux.dell.com & www.dell.com/linux



let i=0

while [ 1 ]; do

echo "Please insert a disc.  What do you want it named?"
BLOCKS=`isoinfo -d -i ${DEVICE} | grep "Volume size" | awk '{print $4}'`

dd if=${DEVICE} of=${FILENAME} bs=2k count=${BLOCKS}
md5sum ${FILENAME}

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]