From: Justin on
On 12/12/09 5:09 PM, Geoffrey S. Mendelson wrote:
> Justin wrote:
>
>> Error: Port md5sum not found
>> and
>> justin$ sudo port install md5
>> Error: Port md5 not found
>>
>> Snow Leopard already has md5 installed and the -r flag produces the
>> standard output most scripts expect.
>
>
> port search md5sum
> md5sha1sum @0.9.5 (sysutils)
> Hash utilites
>
> Geoff.


justin$ md5sum /dev/disk2
md5sum: /dev/disk2: Not a regular file

I'm guessing it can't be done.
From: Justin on
On 12/12/09 5:09 PM, Geoffrey S. Mendelson wrote:
> Justin wrote:
>> When I ran the md5 command on dev/disk2 the drive does not activate - it
>> is instant. So its not running an md5 on the disk.
>> God knows what its running the md5 hash on.
>
> The partition table?
>
> Geoff.
>

Unfortunately that doesn't do me any good.

From: Malcolm on
On 2009-12-12 18:57:39 -0500, Justin <justin(a)nobecauseihatespam.com> said:

> On 12/12/09 5:19 PM, Geoffrey S. Mendelson wrote:
>> Tom Stiller wrote:
>>
>>> Usually, one runs md5 on the downloaded image _before_ burning it to
>>> disk.
>>
>> Assuming of course that there may be something wrong with the download and
>> you want to check it. If you get the MD5SUM file from the original source and
>> not the mirror, you can also make sure it was not tampered with along the way.
>>
>> I expect that if anyone were to tamper with a disk image, they would adjust the
>> MD5SUM file on their mirror too.
>>
>> I expect he is doing to make sure the burning process is working.
>>
>> Geoff.
>>
>>
>>
>>
>
>
> Correct.
> The images I downloaded are OK, but I want to make sure the discs I
> burned are OK as well.

Enable "Verify" in Disk Utility when burning.

From: Justin on
On 12/11/09 3:04 AM, Justin wrote:
> How can I run the md5 command on a DVD?
> I tried $ md5 if=/dev/disk2
> md5: if=/dev/disk2: No such file or directory
>
> Basically I downloaded the FreeBSD ISOs and I must now verify the DVDs I
> burned are error free.
>
> I can run it on the iso file no problem.
> the -r flag produces standard md5 output.
> Justin$ md5 -r blahblah.iso
> 9bd9bb86fbaacda6862a89f24be80d85 blahblah.iso
>
> as opposed to
>
> Justin$ md5 blahblah.iso
> MD5 (blahblah.iso) = 9bd9bb86fbaacda6862a89f24be80d85
>
> So yeah, how can I get an md5 value from an actual DVD?
>

First I burned the image via diskutility
http://img94.imageshack.us/i/screenshot20091213at124.jpg/

(for some reason the ia64 install of FreeBSD is half the size of the
AMD64 of i386.)

Then one must unmount the media otherwise a device busy error will result.

justin$ sudo umount /Volumes/"CD or DVD volume name"

justin$ openssl md5 /dev/disk2
then the drive starts purring like a good little Snow Leopard.
At this point go get something to eat, make a few calls, work out -
depending on h0w big the media is this can take a while.

justin$ openssl md5 /dev/disk2
MD5(/dev/disk2)= 1637d61002cb6ac97f814d6d052cc4a4

justin$ openssl md5 8.0-RELEASE-ia64-dvd1.iso
MD5(8.0-RELEASE-ia64-dvd1.iso)= 6b8df7fb34d5960ecf91a291926a1e6f


They obviously don't match - but I know why.
The md5 was performed on the entire disc - 4.7G - not just the relevant
data.

So yeah - md5 is useless when it comes to verifying a burn.


From: Justin on
On 12/11/09 3:04 AM, Justin wrote:


I figured it out.
cds and dvds use 2k block sizes, and you have to cut it off at the end
of the iso because it will run the md5 on the entire disc - including
the random junk after your written data.
I used the ia64 of FreeBSD because it was the smallest - I'm not going
to use it for anything.

justin$ sudo umount /dev/disk2
Have to unmount of course.

justin$ ls -l | grep ia64
-rwxr-xr-x 1 justin staff *769736704* Dec 10 07:32
8.0-RELEASE-ia64-dvd1.iso
or

justin$ wc -c 8.0-RELEASE-ia64-dvd1.iso
*769736704* 8.0-RELEASE-ia64-dvd1.iso

Getting the filesize.


justin$ dd if=/dev/disk2 bs=2k | head -c 769736704 | openssl md5
6b8df7fb34d5960ecf91a291926a1e6f

the bs=2k is important, cds and dvds use 2k blocks and it will affect
the md5 hash.

justin$ dd if=/dev/disk2 bs=2k | head -c 769736704 | md5 -r
6b8df7fb34d5960ecf91a291926a1e6f

adding -r produces standard output that most md5 programs look for.
Why there isn't any difference this time is beyond me.

Justins-MacBook-Pro:~ justin$ md5 8.0-RELEASE-ia64-dvd1.iso MD5
(8.0-RELEASE-ia64-dvd1.iso) = 6b8df7fb34d5960ecf91a291926a1e6f

Justins-MacBook-Pro:~ justin$ md5 -r 8.0-RELEASE-ia64-dvd1.iso
6b8df7fb34d5960ecf91a291926a1e6f 8.0-RELEASE-ia64-dvd1.iso

Above you can see the difference between having the -r specified and not.