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

Re: Partial success and strange partial failure -was [Re: Physically have install DVD set. Want ISO's from which they came.]



Hi,

> Hmm, I thought the 'count=' stuff was only needed for CD-ROMs. Again, I 
> prefer to keep things simple and would rather use just:
> 
>     md5sum /dev/sdb

This will not give you the MD5 of the image that was copied to
the beginning of the storage device, unless the image size is
exactly the same as the storage device size.

An isohybrid ISO with partition offset 0 has a chance to deliver
the right amount of data from /dev/sdb1.
Debian netinst images for i386 have offset 16. The ones for amd64
have partiton offset 0. So with the latter it could work.

But for the general case (including GRUB2 compliant partitioning
and ISOs without any hard disk partition table), the safe way is
to determine the original size of the .iso file from which the
published MD5 was computed.
E.g.

  blocks=$(expr $(du -b isoimage.iso | awk '{print $1}') / 2048)

  dd if=/dev/sdb bs=2048 count=$blocks | md5sum

Note that this still assumes that the .iso is aligned to 2K blocks.
dd has a performance problem with bs=1. So if you ever encounter
an unaligned image file, you need patience or a different program
for cutting the stream to the desired size.

If the size of the original file cannot be determined, then the
next best guess is the filesystem size as told by programs like
"isosize".
(It can be done entirely by vanilla shell commands, too. See
   http://people.debian.org/~danchev/debian-iso/check_debian_iso
)


Have a nice day :)

Thomas


Reply to: