LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 05-16-2014, 05:48 AM   #16
davcefai
Member
 
Registered: Dec 2004
Location: Malta
Distribution: Debian Sid
Posts: 788

Original Poster
Rep: Reputation: 43

Dump e2fs ran to completion. The relevant bit, I think is:

Code:
Group 402: (Blocks 13172736-13205503)
  Block bitmap at 13172736 (+0), Inode bitmap at 13172737 (+1)
  Inode table at 13172743-13173254 (+7)
  32253 free blocks, 16384 free inodes, 0 directories
  Free blocks: 13172738-13172742, 13173255-13203913, 13203915-13205503
  Free inodes: 6586369-6602752
The relevant block seems to be the only one in a large range which is not free. I'm writing this as I go along. I have just done:

Code:
davcefai:/home/david# hdparm --read-sector 144701458 /dev/sda

/dev/sda:
reading sector 144701458: FAILED: Input/output error
davcefai:/home/david#
As a cross check I tried the sectors before and after this one and I got a result.

I'm working "cookbook style" as this is new territory for me. -I remember doing this sort of thing in my DOS days but that was a long time ago and simpler!

So here goes: Writing the sector:

And the nanny personality kicks in!

Code:
davcefai:/home/david# hdparm --write-sector 144701458 /dev/sda

/dev/sda:
Use of --write-sector is VERY DANGEROUS.
You are trying to deliberately overwrite a low-level sector on the media.
This is a BAD idea, and can easily result in total data loss.
Please supply the --yes-i-know-what-i-am-doing flag if you really want this.
Program aborted.
davcefai:/home/david#
So I did:
Code:
davcefai:/home/david# hdparm --yes-i-know-what-i-am-doing --write-sector 144701458 /dev/sda

/dev/sda:
re-writing sector 144701458: succeeded
davcefai:/home/david#
I am posting this now and will post again after running the tests (and possibly restoring backups )

Thanks for the help.
 
Old 05-16-2014, 08:55 AM   #17
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: CentOS
Posts: 1,958

Rep: Reputation: 811Reputation: 811Reputation: 811Reputation: 811Reputation: 811Reputation: 811Reputation: 811
It is really weird that block 13203914 is (a) a regular data block, (b) not free, and (c) not claimed by any inode. I have no idea how that can happen on a filesystem with no structural errors, but overwriting a data block that is not free should corrupt the contents of a file somewhere. You might want to check whether your backup still matches what is on the disk.

Does "smartctl -A /dev/sda" show the expected changes in Reallocated_Sector_Ct and Current_Pending_Sector?
 
1 members found this post helpful.
Old 05-16-2014, 10:00 AM   #18
davcefai
Member
 
Registered: Dec 2004
Location: Malta
Distribution: Debian Sid
Posts: 788

Original Poster
Rep: Reputation: 43
Quote:
It is really weird that block 13203914 is (a) a regular data block, (b) not free, and (c) not claimed by any inode.
That is not surprising. Weird things happen to me. See other of my questions here with 0 replies

After writing the sector I fsck'd the partition with no errors reported (Using Knoppix)

On reboot I ran
Code:
davcefai:/home/david# smartctl -t long /dev/sda
smartctl 6.2 2013-07-26 r3841 [i686-linux-3.14-1-686-pae] (local build)
Copyright (C) 2002-13, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF OFFLINE IMMEDIATE AND SELF-TEST SECTION ===
Sending command: "Execute SMART Extended self-test routine immediately in off-line mode".
Drive command "Execute SMART Extended self-test routine immediately in off-line mode" successful.
Testing has begun.
Please wait 71 minutes for test to complete.
Test will complete after Fri May 16 16:07:03 2014

Use smartctl -X to abort test.
and the result of that was

Code:
davcefai:/home/david# smartctl -l selftest /dev/sda
smartctl 6.2 2013-07-26 r3841 [i686-linux-3.14-1-686-pae] (local build)
Copyright (C) 2002-13, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF READ SMART DATA SECTION ===
SMART Self-test log structure revision number 1
Num  Test_Description    Status                  Remaining  LifeTime(hours)  LBA_of_first_error
# 1  Extended offline    Completed without error       00%     48304         -
# 2  Short offline       Completed: read failure       60%     48224         144701458
# 3  Short offline       Completed: read failure       60%     48224         144701458
# 4  Short offline       Completed: read failure       60%     48164         144701458
# 5  Short offline       Completed: read failure       60%     48163         144701458
so the error has finally gone away.


You wrote
Quote:
That should make "smartctl -A /dev/sda" report "0" for the Current_Pending_Sector count, and the Reallocated_Sector_Ct will probably increase to "2". It would be best to run "e2fsck -f /dev/sda5" just to be sure you haven't stepped on something in use.
And the answer does not match the prediction!

Code:
197 Current_Pending_Sector  0x0008   253   253   000    Old_age   Offline      -       0
but
  5 Reallocated_Sector_Ct   0x0033   253   253   063    Pre-fail  Always       -       0
The Reallocated Sector count has been decremented which could make one think that the error was caused by smartctl itself.

Sadly, I still get
Code:
Warning! SMART Attribute Thresholds Structure error: invalid SMART checksum.
But I get the impression that this is a common message and ignorable. I get it on both hard drives which are identical Maxtor 160GB drives.

Many thanks for the invaluable assistance. I owe you a beer or 2 should you ever be in Malta!
 
Old 05-16-2014, 10:48 AM   #19
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: CentOS
Posts: 1,958

Rep: Reputation: 811Reputation: 811Reputation: 811Reputation: 811Reputation: 811Reputation: 811Reputation: 811
Quote:
Originally Posted by davcefai View Post
Code:
197 Current_Pending_Sector  0x0008   253   253   000    Old_age   Offline      -       0
but
  5 Reallocated_Sector_Ct   0x0033   253   253   063    Pre-fail  Always       -       0
The Reallocated Sector count has been decremented which could make one think that the error was caused by smartctl itself.
smartctl is just showing the numbers that the drive's firmware reports. Having a pending sector fixed by rewriting without being reallocated is not unusual. It just means that the drive tried rewriting that sector and was happy with the result. But, I've never seen a reallocated sector get magically corrected.

Quote:
Sadly, I still get
Code:
Warning! SMART Attribute Thresholds Structure error: invalid SMART checksum.
But I get the impression that this is a common message and ignorable. I get it on both hard drives which are identical Maxtor 160GB drives.
There's really nothing you can do about it. Perhaps it's related to the strangeness in the counts. Perhaps not.
 
1 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Bad sector in HardDisk Arun Kurian Linux - Hardware 3 11-11-2013 03:19 PM
Scan bad sector ust Linux - Newbie 5 01-19-2012 04:51 AM
bad sector problem ahmed gamal Slackware 2 08-18-2008 06:38 PM
Bad sector woes :S kevingpo Fedora 4 07-07-2005 02:57 AM
bad sector in HDD ??? hitesh_linux Linux - General 2 06-20-2003 03:54 PM


All times are GMT -5. The time now is 05:21 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration