Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Looks like my USB HDD is old and corrupted:

rsync: read errors mapping "path/to/file.jpg": Input/output error (5)

Syslog:

kernel: [58927.940676] sd 6:0:0:0: [sdb] Unhandled sense code
kernel: [58927.940683] sd 6:0:0:0: [sdb]  Result: hostbyte=invalid driverbyte=DRIVER_SENSE
kernel: [58927.940690] sd 6:0:0:0: [sdb]  Sense Key : Medium Error [current] 
kernel: [58927.940696] sd 6:0:0:0: [sdb]  Add. Sense: Unrecovered read error
kernel: [58927.940703] sd 6:0:0:0: [sdb] CDB: Read(10): 28 00 00 21 f2 df 00 00 08 00
kernel: [58927.940716] end_request: critical target error, dev sdb, sector 2224863

The strange thing is that FS is not spoilt: I can list all directories. However, reading the contents of about 10% files gives these errors. Adiitionally, most of small files are safe, however, large files are all spoilt (corruption threshold is ~5MB).

How can it be? What options do I have to investigate & rescue the files? Can it be a driver issue? I can't believe that HDD damage could miss the FS metadata!

P.S. this HDD is perfidious: I have always been doing backups, and it waited for the right moment to betray :-D

share|improve this question
6  
I'm sure you'd get more answers if you added a hat to your Gravatar. meta.serverfault.com/questions/2394/its-santa-time –  Ward Dec 17 '11 at 20:58
    
THE RESULT: ddrescue did the job, managed to minimize the number of errors –  kolypto Dec 29 '11 at 20:51

1 Answer 1

up vote 6 down vote accepted

Listing the directories does not mean that the filesystem is ok, you're just viewing metadata (which is a small percent of a filesystem).

  1. Create a backup of everything you can
  2. Run a filesystem check (fsck)
  3. Create another backup (in case fsck managed to save some more files)
  4. Replace the disk
share|improve this answer
    
True. However, I can't believe such massive "damage" (whatever) could miss the metadata :) Already trying your suggestion, 10x! –  kolypto Dec 17 '11 at 18:52
    
Metadata isn't spread out over the file system, it's a reserved place on the disk (I can't remember where right now) –  pauska Dec 17 '11 at 19:07
3  
I have no idea what you wrote, but I like your hat. –  Wesley Dec 18 '11 at 1:21

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.