Tuesday, May 3, 2011

Offline uncorrectable sectors

So my task was to figure out what's wrong with a server on a remote site that is still running but no longer accepting file transfer...hmm.

Device: /dev/sda, 1 Currently unreadable (pending) sectors
Offline uncorrectable sectors

Here is temp fix to get it going while planning to replace the drive.

1. smartctl -l selftest /dev/sda

Num Test_Description Status Remaining LifeTime(hours) LBA_of_first_error
# 1 Extended offline Completed: read failure 90% 2703 1113543272

2. fdisk -lu /dev/sda
Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *          63      208844      104391   83  Linux
/dev/sda2          208845  1953520064   976655610   8e  Linux LVM

Of course, it has to be /dev/sda2 since the LBA_of_first_error number is within the block range of sda2
Look for Start block # (208845  in my case)
Use this formular:  ((1113543272-208845)*512)/4096=139166803

3. dd if=/dev/zero of=/dev/mapper/VolGroup00-LogVol00 bs=4096 count=1 seek=139166803
My /dev/sda2 is a LVM drive so I use the mapper volume above. I assume that /dev/sda2 will still work. 


No comments: