Bad Sector won't go away
On a Debian system - Unstable, AMD 10 6800K CPU, 4 GB RAM, 2 x 160GB SATA HDDS, 2 SATA DVD writers - I am getting the daily message:
Quote:
Code:
smartctl -t short -d sat /dev/sda Code:
smartctl -l selftest /dev/sda Quote:
Quote:
However, booting with Knoppix and running Code:
e2fsck -c -f -k -p /dev/sda5 Should e2fsck have cured this? Help appreciated. |
Your hard drive is a toast, it is not passing the test. Order a new one NOW. And make sure your backups are current.
|
Please post the output from "smartctl -A /dev/sda". The problem could be a simple as a single bad sector which just needs to be written to so that the drive can reallocate it to a spare sector. That is _only_ going to happen when a write to that sector occurs unless at some point the drive does manage to get a correct read from that sector and so can reallocate it on its own. Bad sectors that are pending reallocation will cause some offline tests to fail.
Assuming that the problem is just some small number of bad sectors, the Bad Block HOWTO shows the procedure for finding them, determining what file they are (or are not) part of, and making the drive reallocate them. If there are just a small number of bad sectors and this number is not increasing with time, then the drive is OK to use. There are various events such as vibration or power supply glitches that can cause a sector to become bad without being a warning of impending doom. Good backups are, of course, always important. Drives can and do fail without warning. |
Code:
Num Test_Description Status Remaining LifeTime(hours) LBA_of_first_error Code:
smartctl --all /dev/sda | grep -e "Reallocated_Sector_Ct" -e "Current_Pending_Sector" -e "Offline_Uncorrectable" -e "UDMA_CRC_Error_Count" -e "Hardware_ECC_Recovered" |
Feedback as requested:
Quote:
Code:
davcefai:/home/david# smartctl -A /dev/sda |
@ Emerson
This is the output of the command you suggested. Does it look that bad that the drive needs to be dumped? OK, good excuse to get a bigger drive, meads I don't need to dump a lot of Beethoven to DVD :-) Code:
davcefai:/home/david# smartctl --all /dev/sda | grep -e "Reallocated_Sector_Ct" -e "Current_Pending_Sector" -e "Offline_Uncorrectable" -e "UDMA_CRC_Error_Count" -e "Hardware_ECC_Recovered" |
The problem is #197, Current_Pending_Sector. That is just one bad sector, and the drive otherwise looks fine. A bad sector that is pending reallocation is visible to the OS (will cause an I/O error if read) and will cause the offline test to fail at that location. Follow the steps in the Bad Block HOWTO to get that sector reallocated. Parameter #5, Reallocated_Sector_Ct, should then increase to 2, and the offline tests should then pass. That drive hasn't been used much, just under 170 power-on hours, and you should expect it to have a normal lifetime.
The steps in the HOWTO aren't as hard as they look (it covers several different cases -- you will be concerned with just one), but if you don't want to do that, the ham-fisted approach would be to back up the files on the affected partition, clear the partition with "dd if=/dev/zero of=/dev/sda5 bs=64k", then remake the filesystem and restore the backup. Of course if you just want a bigger disk, by all means go ahead and get one. BTW, when you post output please use [CODE]...[/CODE] tags and not [QUOTE]...[/QUOTE] tags so that formatting is preserved. |
The attributes look fine, except of course for the bad sector, which is not good. You could try zeroing the HDD like rknichols suggests as this may repair soft errors. Obviously backup before doing this.
|
Quote:
|
Apologies anf thanks for the format fix.
|
I have tried following the Badblocks Howto but have run into a snag. Here follows a blow by blow account in the hope that somebody will point out where I went off the straight and narrow path.
Step 1: Find error: Code:
davcefai:/home/david# smartctl -l selftest /dev/sda ----------------------------------------------------------------------------------------------- Step 2: Locate Partition where the error is: Block number = 144701458 x 512 / 4096 = 18087682.25 Code:
davcefai:/home/david# fdisk -lu /dev/sda Step 3: Find Mount Point and fs type looking in /etc/fstab I find: Code:
# /dev/sda1 = / Step 4: Confirm the Block Size: Code:
davcefai:/home/david# tune2fs -l /dev/sda1 | grep Block Step 5: Now to locate the inode: Code:
davcefai:/home/david# debugfs |
LBA is in 512-byte sectors. "fdisk -u" gives addresses in 512-byte sectors. (The "Blocks" column shows 1024-byte blocks.) So, your bad block is in sda5, as you first suspected.
(144701458-39070143)/8 = 13203914.375 Block 13203914 of the filesystem, 3rd sector of that 4K block. |
Quote:
Code:
davcefai:/home/david# debugfs Could I trouble you a little longer? Thanks. |
Quote:
Code:
dumpe2fs /dev/sda5 | less Code:
Group 4: (Blocks 131072-163839) Code:
hdparm --read-sector 144701458 Code:
hdparm --write-sector 144701458 You did say you had backups for this filesystem, right? ;) |
Quote:
|
All times are GMT -5. The time now is 04:49 PM. |