ISO file size in bytes?

Matt Domsch Matt_Domsch at dell.com
Thu Oct 25 03:29:30 UTC 2007


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...

Thanks,
Matt

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


#!/bin/bash

DEVICE=/dev/cdrom

let i=0

while [ 1 ]; do

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

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




More information about the fedora-devel-list mailing list