From: Justin on
On 12/13/09 12:00 PM, Warren Block wrote:
> Justin<justin(a)nobecauseihatespam.com> wrote:
>> Hi folks, I downloaded all of the freebsd 8.0 isos.
>> I'm running Snow Leopard on this machine and I would like to verify my
>> burn is correct.
>> Here is what I tried
>>
>> justin$ openssl md5 8.0-RELEASE-ia64-dvd1.iso
>
> Okay, there are a couple of problems there. First is that your Mac
> almost certainly isn't IA-64 (Itanium), but rather the standard Intel
> 64-bit. For that, you need the AMD64 release. Yes, AMD64 works on
> Intel, AMD got there first so that's the name. Intel calls it "Intel
> 64", but they're not fooling anybody.
>
> You could also run the i386 (32-bit) version of FreeBSD.

I am not installing it on this machine.
This machine will stay Snow Leopard forever.
I'm also using the ia64 version for this example because it is the
smallest of the images - takes lest time to calculate the md5sum.


>
> Secondly, you should be able to use the standalone md5 command without
> going through openssl.


I installed md5sum and it will not run on devices like the dvd-drive as
shown below.
justin$ diskutil list
/dev/disk0
#: TYPE NAME SIZE
IDENTIFIER
0: GUID_partition_scheme *250.1 GB disk0
1: EFI 209.7 MB disk0s1
2: Apple_HFS Macintosh Hard Disk 249.7 GB disk0s2
/dev/disk1
#: TYPE NAME SIZE
IDENTIFIER
0: FreeBSD_Install *4.7 GB disk1
/dev/disk2
#: TYPE NAME SIZE
IDENTIFIER
0: Apple_partition_scheme *499.4 GB disk2
1: Apple_partition_map 32.3 KB disk2s1
2: Apple_HFS justin 499.4 GB disk2s2


justin$ md5sum /dev/disk1md5sum: /dev/disk1: Not a regular file
justin$ md5 /dev/disk1
MD5 (/dev/disk1) = d41d8cd98f00b204e9800998ecf8427e

The second command looks like it worked, but it didn't. The drive
didn't twitch and it took less than a second. It isn't running the md5
hash on the disc's data - maybe its running it on the boot sector.

But when I do a
justin$ openssl md5
the drive spins up and it takes a while for it to give me an answer.

I just think the md5 implementation is different on SL.

>
>> MD5(8.0-RELEASE-ia64-dvd1.iso)= 6b8df7fb34d5960ecf91a291926a1e6f
>
> Let's pretend that's 8.0-RELEASE-amd64-dvd1.iso for the rest of this
> message.
>
>> justin$ wc -c 8.0-RELEASE-ia64-dvd1.iso
>> 769736704 8.0-RELEASE-ia64-dvd1.iso
>
> ls -l should be adequate.
>
>> justin$ dd if=/dev/disk2 | head -c 769736704 | openssl md5
>> a6980ae1ab5098826830271534870df1
>
> CDs and DVDs use 2K block sizes:
>
> dd if=/dev/disk2 bs=2k | md5
>

I will try the above.
thanks!

From: Justin on
On 12/13/09 2:00 PM, Justin wrote:

>
> I will try the above.
> thanks!
>

It worked! Thanks Warren.
justin$ dd if=/dev/disk2 bs=2k | head -c 769736704 | openssl md5
6b8df7fb34d5960ecf91a291926a1e6f
Justins-MacBook-Pro:~ justin$ openssl md5 8.0-RELEASE-ia64-dvd1.iso
MD5(8.0-RELEASE-ia64-dvd1.iso)= 6b8df7fb34d5960ecf91a291926a1e6f
From: Warren Block on
Justin <justin(a)nobecauseihatespam.com> wrote:
> On 12/13/09 12:00 PM, Warren Block wrote:
>>
>> Secondly, you should be able to use the standalone md5 command without
>> going through openssl.
>
>
> I installed md5sum and it will not run on devices like the dvd-drive as
> shown below.

md5sum is a Linuxism. md5 is correct.

> justin$ md5sum /dev/disk1md5sum: /dev/disk1: Not a regular file

Right, and it's not.

> justin$ md5 /dev/disk1
> MD5 (/dev/disk1) = d41d8cd98f00b204e9800998ecf8427e
>
> The second command looks like it worked, but it didn't. The drive
> didn't twitch and it took less than a second. It isn't running the md5
> hash on the disc's data - maybe its running it on the boot sector.

No, it's running on just the device node, not the contents of the
device.

> But when I do a
> justin$ openssl md5
> the drive spins up and it takes a while for it to give me an answer.
>
> I just think the md5 implementation is different on SL.

They might be different in how they act when given a device node to
read. If the data read is the same, the md5 should be the same.

--
Warren Block * Rapid City, South Dakota * USA
From: Warren Block on
Justin <justin(a)nobecauseihatespam.com> wrote:
> On 12/13/09 2:00 PM, Justin wrote:
>
>>
>> I will try the above.
>> thanks!
>>
>
> It worked! Thanks Warren.
> justin$ dd if=/dev/disk2 bs=2k | head -c 769736704 | openssl md5
> 6b8df7fb34d5960ecf91a291926a1e6f
> Justins-MacBook-Pro:~ justin$ openssl md5 8.0-RELEASE-ia64-dvd1.iso
> MD5(8.0-RELEASE-ia64-dvd1.iso)= 6b8df7fb34d5960ecf91a291926a1e6f

The head -c command should be unnecessary and might cause that line to
lie to you. If the data read from disk doesn't match the ISO file,
there's an error. Does dd if=/dev/disk2 bs=2k | md5 give a different
result?

--
Warren Block * Rapid City, South Dakota * USA
From: Justin on
On 12/13/09 4:06 PM, Warren Block wrote:
> Justin<justin(a)nobecauseihatespam.com> wrote:
>> On 12/13/09 2:00 PM, Justin wrote:
>>
>>>
>>> I will try the above.
>>> thanks!
>>>
>>
>> It worked! Thanks Warren.
>> justin$ dd if=/dev/disk2 bs=2k | head -c 769736704 | openssl md5
>> 6b8df7fb34d5960ecf91a291926a1e6f
>> Justins-MacBook-Pro:~ justin$ openssl md5 8.0-RELEASE-ia64-dvd1.iso
>> MD5(8.0-RELEASE-ia64-dvd1.iso)= 6b8df7fb34d5960ecf91a291926a1e6f
>
> The head -c command should be unnecessary and might cause that line to
> lie to you. If the data read from disk doesn't match the ISO file,
> there's an error. Does dd if=/dev/disk2 bs=2k | md5 give a different
> result?
>

Yes, because it is running the hash on the entire disk - including the
random junk outside the bounds of what I burned.
however I ran into something else

justin$ dd if=/dev/disk2 bs=2k | head -c 7771521024 | md5 -r
head: *illegal byte count* -- 7771521024
d41d8cd98f00b204e9800998ecf8427e