5

I have a very small and quite old hard drive disk, about 32G.
On to this disk I have copied a largish tar file, about 5G.

When I run md5sum to generate a checksum on this file I repeatedly get different results (on the same machine and the same file). This obviously should not happen.

If I repeat the experiment with a much smaller file, as expected the checksum is the same each time. I can only assume that because the large file is spanning most of the disk, and it is an old drive, I am experiencing a lot of read errors on the hard drive - and it needs replacing? Could there be any other good reason for this? Something I can do to fix the problem other than buying a new disk?

Update: sha1sum also produces inconsistent results.

wzzrd
  • 10,269
  • 2
  • 32
  • 47
Joel
  • 459
  • 2
  • 6
  • 12
  • 5
    This file isn't /dev/random, right? :D – Kevin M Jul 07 '09 at 12:26
  • No! BTW - this is on a linux (debian) machine. – Joel Jul 07 '09 at 12:28
  • Are there any interesting messages in the logs ? – James Jul 07 '09 at 12:30
  • 5
    DO NOT HESITATE. Replace this drive immediately! – kmarsh Jul 07 '09 at 12:31
  • 8
    Browsing thru the questions this morning and coming upon this gave me a chuckle. The title reads something like "Smoke is pouring out of the windows of my house. Do you think I should do something?" I hate to make light of someone else's misfortune, but it just struck me as funny. I'm sick, I guess. – Evan Anderson Jul 07 '09 at 13:13
  • 1
    Yes, it's a crappy machine. I think it was stored outside for a while too. I can see rust on it. Infact - I'm always a little scared to touch it incase I get an electric shock. – Joel Jul 07 '09 at 13:23

8 Answers8

10

The only likely reasons are bad disk or bad RAM, and as the disk is old and you are not experiencing other issues it is less likely to be the RAM.

It could be a dodgey connector/controller: I once had an IDE->USB adaptor go bad resulting in corrupted transfers even thought the drive was perfectly fine.

David Spillett
  • 22,534
  • 42
  • 66
  • I, too, have seen the both the bad IDE connector/cable and the dodgy IDE to USB adaptor. Both situations nearly gave me heart attacks, but both were completely benign. – Evan Anderson Jul 07 '09 at 13:14
7

It may be worth running fsck (or the equivalent for whatever filesystem you're using) to fix disk errors. But, it could be the last thing this drive does if it's on its last leg.

spoulson
  • 2,173
  • 5
  • 22
  • 30
4

To be on the safe side I suggest you run memtest86+ over night to make sure that it finds no memory errors.

knweiss
  • 3,955
  • 23
  • 20
3

The root cause is that somehow your RAM is getting corrupted. It is probably a bad stick, but sometimes the devices like the video card can corrupt main memory.

Do not fsck until you verify that the memory is safe. Otherwise fsck is likely to corrupt everything.

Pull out drives, put in a known good system, and FSCK there while you fix this system.

  • 1
    This is a VERY late answer. Please keep an eye towards the date of the question when providing an answer, and do not rehash areas already covered by others. In this case. the question was posed nearly 3 years ago. I'm sure the problem has resolved itself in one fashion or another long since. – Magellan May 29 '12 at 02:37
1

Does sha1sum have the same behavior?

I would expect disk read errors before receiving phantom data that alters the hashing process. What platform are you running on?

spoulson
  • 2,173
  • 5
  • 22
  • 30
1

I once had this same problem as well. It turned out to be the hard drive controller on the motherboard.

However, in this case it definitely sounds like a dud hard drive. Hard drives tend to hang onto life by marking sectors bad, transparently, in the background. When sectors finally start to go bad at an OS level the drive ends up expiring very quickly.

Contango
  • 1,130
  • 5
  • 15
  • 31
0

Since data is different each time it is possible that md5sum is able to read less and less after each run. But failed reads should cause md5sum to quit and report input/output error.

It is very important to backup whatever data you have on this drive and shift to new drive. This drive can fail any time. Do not use this drive for any important work.

Saurabh Barjatiya
  • 4,643
  • 2
  • 29
  • 34
0

Is there any process or cron job that is set to automatically add or remove files from this tar file?

I'd also run a disk check. Make sure, as you said, that there aren't any problems with the disk itself.

Kevin M
  • 2,302
  • 1
  • 16
  • 21