LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > *BSD
User Name
Password
*BSD This forum is for the discussion of all BSD variants.
FreeBSD, OpenBSD, NetBSD, etc.

Notices


Reply
  Search this Thread
Old 06-02-2004, 09:59 PM   #1
NiallC
Member
 
Registered: Feb 2003
Distribution: Suse 8.1
Posts: 102

Rep: Reputation: 15
MD5 of device...how to?


Hi there,

I have a USB thumb drive device (da0) and I wish to run an md5 sum on the device itself.

Is it possible to do this? or is there any other way to accomplish this task?

I need to verify the has of the device before and after making a dd bit copy.

TIA for any pointers.....

Niall.
 
Old 06-03-2004, 01:22 AM   #2
chort
Senior Member
 
Registered: Jul 2003
Location: Silicon Valley, USA
Distribution: OpenBSD 4.6, OS X 10.6.2, CentOS 4 & 5
Posts: 3,660

Rep: Reputation: 76
You're not trying to MD5 the "device", you want the MD5 of the entire contents of the device, right? You could always write a find statement to crawl through the directory tree and MD5 everything, then compare the list of checksums. I also heard of a project call "md5deep" or "deepmd5" or something like that, which will actually do the crawl through the directories for you. I can't remember if it gave an MD5 of every file that it found, or just created an md5 on the directory and file tree.
 
Old 06-03-2004, 04:53 AM   #3
NiallC
Member
 
Registered: Feb 2003
Distribution: Suse 8.1
Posts: 102

Original Poster
Rep: Reputation: 15
Quote:
Originally posted by chort
You're not trying to MD5 the "device", you want the MD5 of the entire contents of the device, right?
Hi chort,

No, actually I want the device.

In linux, let's say you have a device attached, /dev/hda. You can issue the following command

Code:
md5sum /dev/hda
And it will return an MD5 hash for the device.

Now, if you want to be sure you have a bit-image copy, you dd, then run the MD5 again on the dd'd file and be sure the two match.

That's what I'm trying to do.

Basically image a USB DRIVE in its entirety, and verify after I've imaged that I've actually got a forensically sound copy.

md5deep is a project by Jesse Kornblum that's a fairly neat little tool to recursivle do MD5 hashing. However, I want the device hashed at this stage, not the contents.

Am I being clear? if not, just ask!

Thanks

Niall.

P.S. I don't care if the hash is SHA, or CRC, or whatever, just so long as I can verify afterwards what it is I have done.
 
Old 06-08-2004, 10:55 AM   #4
cnjohnson
Member
 
Registered: Nov 2002
Location: Nashville
Distribution: FreeBSD, Linux, OS-X
Posts: 544

Rep: Reputation: 30
What error message do you get when you do the md5 hash against /dev/hda (or whetever device it is)??

Cheers--
Charles
 
Old 06-08-2004, 12:46 PM   #5
Stack
Member
 
Registered: Oct 2003
Distribution: FreeBSD
Posts: 325

Rep: Reputation: 30
Well i am not sure if i am getting the md5 of the file /dev/ad1 (i would assume so) but perhaps it is the drive? You can do as root 'md5 /dev/ad1'
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Md5 hlinux Fedora 2 06-28-2005 10:21 PM
md5 RDove Programming 3 03-07-2005 10:22 AM
How to use md5 case23_69 Linux - Newbie 4 11-17-2004 09:01 PM
using iso.md5 and iso.md5.asc Tyir Linux - Newbie 3 07-10-2004 11:45 PM
md5? juggernaught *BSD 1 03-28-2003 03:43 PM

LinuxQuestions.org > Forums > Other *NIX Forums > *BSD

All times are GMT -5. The time now is 06:46 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration