Tell me more ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

SMART is stating one pending sector on of my server's hdd. I've read lot's of articles recommending using hdparm to "easily" force the disk to relocated the bad sector, but I can't find the correct way to use it.

Some info from my "smartctl":

Error 95 occurred at disk power-on lifetime: 20184 hours (841 days + 0 hours)
  When the command that caused the error occurred, the device was active or idle.

  After command completion occurred, registers were:
  ER ST SC SN CL CH DH
  -- -- -- -- -- -- --
  40 51 00 d7 55 dd 02  Error: UNC at LBA = 0x02dd55d7 = 48059863

  Commands leading to the command that caused the error were:
  CR FR SC SN CL CH DH DC   Powered_Up_Time  Command/Feature_Name
  -- -- -- -- -- -- -- --  ----------------  --------------------
  c8 00 08 d6 55 dd e2 00  18d+05:13:42.421  READ DMA
  27 00 00 00 00 00 e0 00  18d+05:13:42.392  READ NATIVE MAX ADDRESS EXT
  ec 00 00 00 00 00 a0 02  18d+05:13:42.378  IDENTIFY DEVICE
  ef 03 46 00 00 00 a0 02  18d+05:13:42.355  SET FEATURES [Set transfer mode]
  27 00 00 00 00 00 e0 00  18d+05:13:42.327  READ NATIVE MAX ADDRESS EXT

 SMART Self-test log structure revision number 1
 Num  Test_Description    Status                  Remaining  LifeTime(hours)        LBA_of_first_error
 # 1  Extended offline    Completed: read failure       90%     20194         48059863
 # 2  Short offline       Completed without error       00%     15161         -

With that "bad LBA" (48059863) in hand, how do I use hdparm? What type of address the parameters "--read-sector" and "--write-sector" should have?

If I issue the command hdparm --read-sector 48095863 /dev/sda it reads and dumps data. If this command was right, I should expect an I/O error, right?

Instead, it dumps data:

$ ./hdparm --read-sector 48059863 /dev/sda

/dev/sda:
reading sector 48059863: succeeded
4b50 5d1b 7563 a932 618d 1f81 4514 2343
8a16 3342 5e36 2591 3b4e 762a 4dd7 037f
6a32 6996 816f 573f eee1 bc24 eed4 206e
(...)
share|improve this question
1  
The proper thing to do is to send the drive back to its manufacturer and get a warranty replacement. – Michael Hampton Dec 27 '12 at 16:58

1 Answer

Based on this answer and this answer in How do I easily repair a single unreadable block on a Linux disk?, you want to use hdparm to write to the sector. Assuming /dev/hda is your device and 48059863 is the LBA of the sector:

hdparm --write-sector 48059863 /dev/sda

That will blow away whatever data is in that sector. You'll need to add '–yes-i-know-what-i-am-doing' to get it to actually write. Note the dire warning before proceeding.

According to the second answer I linked, the drive will recover the sector if it can and remap it (if there is enough ECC correct the problem). If it can't get a good read on the data, it won't, since it doesn't know what to write and won't write garbage data. You're getting a successful read with --read-data, so I'd think the drive would eventually remap the sector on it's own if there is really a problem. Maybe it was a one time glitch and the sector is actually fine?

share|improve this answer
So that's the strange part and the reason of my question. If I issue a test with smartctl it will stop at LBA 48059863, and right after, If I issue the hdperm using the same LBA address it will read the sector with no errors. We are missing something here, it does not seem to be a temporary problem. – Nino Dec 27 '12 at 21:12

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.