LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 01-12-2008, 11:45 AM   #1
shortname
Member
 
Registered: Dec 2004
Location: Georgetown, DE
Distribution: Gentoo (Kernel-2.6.18-gentoo-r5, customized :))
Posts: 101

Rep: Reputation: 15
Totally baffling md5sum behaviour


Hello all,

I am switching an old Gentoo machine over to Kubuntu for my father to use, and since I had a 500Gb external drive available to me at the time, I decided to use dd to make a complete copy of his harddisk first. I used the following command:

dd if=/dev/hda of=dbackup.img bs=1M

The copy went just fine, with dd reporting no errors.

I then checksummed both the harddisk I had just imaged and the backup image. The checksums were different!

I did md5sum /dev/hda > disk.txt for the harddisk, and md5sum dbackup.img > backup.txt for the image.

Thinking it to be a fluke, I ran md5sum again with ">>" in place of ">" to append to the checksum files I already had.

Lo and behold, the harddisk returned a DIFFERENT CHECKSUM! But the backup image reported the same checksum as before.

I tried this twice more, and each time the backup image came out with the same checksum, and the HDD came out with a different one!

What on earth could this be? I ran badblocks on the harddisk, and it reported no problems in non-destructive read-only mode, and I know it can't be a memory problem or the checksum of the image wouldn't come out the same each time.

The behavior is the same in binary mode, in case you are wondering.

Any ideas?

Thanks,
Jeremy
 
Old 01-12-2008, 11:51 AM   #2
Emerson
Senior Member
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~
Posts: 3,177

Rep: Reputation: Disabled
If your HDD was mounted then it's probably the journal playing tricks on you.
 
Old 01-12-2008, 12:18 PM   #3
shortname
Member
 
Registered: Dec 2004
Location: Georgetown, DE
Distribution: Gentoo (Kernel-2.6.18-gentoo-r5, customized :))
Posts: 101

Original Poster
Rep: Reputation: 15
Hmmm...well knoppix isn't indicating that it is mounted. No partitions on /dev/hda show up when I type "mount." So I *think* I'm all right.

Any other ideas?

[edit]

I feel I should also mention that Knoppix does not show any of my harddisk partitions on the desktop, which is unusual behavior for knoppix, yet it lets me do "cat /dev/hda" successfully.

[/edit]

Last edited by shortname; 01-12-2008 at 12:24 PM.
 
Old 01-12-2008, 12:50 PM   #4
shortname
Member
 
Registered: Dec 2004
Location: Georgetown, DE
Distribution: Gentoo (Kernel-2.6.18-gentoo-r5, customized :))
Posts: 101

Original Poster
Rep: Reputation: 15
Okay, another update:

doing the same thing with cksum instead of md5sum gives me cksum checksums which differ only in the first half of the checksum. The second half is the same.

Now I'm really confused.

I'm burning a brand new knoppix CD, rebooting the machine to ensure it has no errors (memory/hdd), and starting this process over once I can "see" my HDD partitions on the desktop in knoppix. If none of this helps, I'm going to make a dd image and hope its good, then install Kubuntu anyway. There isn't much in the way of critical data on this machine anyhow.

Still, any hypotheses as to why I'm seeing this strange behavior are appreciated.

Thanks,
Jeremy
 
Old 01-12-2008, 02:19 PM   #5
shortname
Member
 
Registered: Dec 2004
Location: Georgetown, DE
Distribution: Gentoo (Kernel-2.6.18-gentoo-r5, customized :))
Posts: 101

Original Poster
Rep: Reputation: 15
Okay, using a newer copy of Knoppix (version 5.1.1) with a newer copy of md5sum and some kind of drive mapping (part of Knoppix now), I got the same damn problem!

Hopefully someone will stumble upon this post at some point and tell me what's up. I have never had an issue like this before, and hopefully I never will again.

In the meantime, I am going to make a "hopefully" functional image of the harddisk, completely wipe the disk clean with derik's boot and nuke, and install Kubuntu. Wish me luck.

Jeremy
 
Old 03-08-2008, 01:53 AM   #6
Dr Adel
LQ Newbie
 
Registered: Apr 2006
Location: Alexandria - Egypt
Distribution: debian testing
Posts: 2

Rep: Reputation: 0
Same Problem with md5sum and sha1sum

Dear Jeremy,

I have the same weird md5sum behavior, it gives different results for same files either on single file testing or in batch mode.

sha1sum seem to have same ailment.

I first noticed that in numerous occasions after downloading a distro through jigdo, it says that file seems to be corrupt but after I checked with md5sum it gave the right result.

After downloading the whole set (28 Cds), I performed a 'batch' md5sum check using MD5SUMS. To my horror it gave 4 mismatches ...

Running md5sum on each of the 4 mismatched files individually several times gave paradoxical results..

Unmounting and re-mounting of the volume and even rebooting did nothing.

I thought this was a bug in the md5sum program itself, but trying sh1sum gave same inconsistencies.

To be frank, I never experienced that before while burning my iso images using k3b.

Hope somebody has an answer.

Thanks.
Adel
 
Old 03-08-2008, 02:27 PM   #7
shortname
Member
 
Registered: Dec 2004
Location: Georgetown, DE
Distribution: Gentoo (Kernel-2.6.18-gentoo-r5, customized :))
Posts: 101

Original Poster
Rep: Reputation: 15
Dr Adel,

I never did figure out what it was...I notice the same problems when imaging the same CD on different computer systems. Perhaps it is a file system/architecture dependent thing? One machine is x86_64 and the other is x86. Both have ext3 root partitions though... Strange indeed.
 
  


Reply

Tags
checksum, error, inconsistency, md5sum


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
baffling error in mandriva one 2008 dukeinlondon Mandriva 12 10-16-2007 04:27 AM
Massive Baffling Issues with NTP Gold_Country Linux - Software 11 10-05-2007 10:46 AM
Baffling Remote X problem daleman Slackware 9 03-24-2005 07:58 AM
martian source baffling me? Pcghost Linux - Networking 3 04-01-2003 08:43 PM
Baffling reboot/shutdown issue... tisource Linux - General 12 03-31-2003 03:08 PM


All times are GMT -5. The time now is 01:41 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration