LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 06-01-2016, 08:55 AM   #1
KenJackson
Member
 
Registered: Jul 2006
Location: Maryland, USA
Distribution: Fedora and others
Posts: 756

Rep: Reputation: 144Reputation: 144
MD5 of thumb drive is different than MD5 of image dd'ed onto it


I have tried both these commands. (The file is intended for this purpose.)
Code:
dd if=file.img of=/dev/sdb bs=1M
dd if=file.img of=/dev/sdb
Then I check the md5sum:
Code:
md5sum /dev/sdb
dd if=/dev/sdb bs=1M | md5sum
dd if=/dev/sdb | md5sum
In all cases the md5sum of the device is the same, but it's different from that of the file.

Shouldn't they match?
 
Old 06-01-2016, 09:25 AM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 22,257

Rep: Reputation: 4542Reputation: 4542Reputation: 4542Reputation: 4542Reputation: 4542Reputation: 4542Reputation: 4542Reputation: 4542Reputation: 4542Reputation: 4542Reputation: 4542
No. For example if the size of the image file is smaller then the flash drive you would expect the sum to be different because the dd command will not overwrite the entire drive.

The typical use for md5sum is to verify the integrity of the downloaded file. If the calculated sum matches the posted value then the file has not been changed due to the transfer process.
 
Old 06-01-2016, 11:40 AM   #3
KenJackson
Member
 
Registered: Jul 2006
Location: Maryland, USA
Distribution: Fedora and others
Posts: 756

Original Poster
Rep: Reputation: 144Reputation: 144
Ah! Good point.

This works. The count is the size of the file divided by 512. The result is the same as for the original file.
Code:
sudo dd if=/dev/sdb count=990915 | md5sum
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
[SOLVED] Image on thumb drive smturner1 Arch 3 09-26-2012 09:23 PM
md5 or dgst -md5 openssl bayanaa Linux - Newbie 1 05-26-2012 05:59 AM
need help unpacking hmac-md5 hash into md5 hash lynx5 Programming 3 02-02-2008 05:06 PM
difference between md5 shadow and md5 elsewhere? whysyn Linux - Security 5 12-11-2007 11:11 AM
using iso.md5 and iso.md5.asc Tyir Linux - Newbie 3 07-11-2004 12:45 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:40 AM.

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