From: "Helmut Hullen" <Hullen@t-online.de>
To: linux-btrfs@vger.kernel.org
Subject: Re: read error: how to fix?
Date: 17 Oct 2011 05:35:00 +0200 [thread overview]
Message-ID: <Bw0YSZ7T1uB@helmut.hullen.de> (raw)
In-Reply-To: <1318793530.2588.28.camel@nayuki.kepstin.ca>
Hallo, Calvin,
Du meintest am 16.10.11:
>> I don't like to throw away a disk if it has (perhaps) repairable
>> read errors. I'd like to use a tool like "badblocks".
> Well, lets take a look at the state of your drive. Install
> smartmontools, and run 'smartctl -A /dev/sdX'. One a properly
> operational drive, you'll see these:
> ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE
> UPDATED WHEN_FAILED RAW_VALUE
> 5 Reallocated_Sector_Ct 0x0033 200 200 140 Pre-fail
> Always - 0
> 197 Current_Pending_Sector 0x0032 200 200 000 Old_age
> Always - 0
Here (WDC WD20EARS):
5 Reallocated_Sector_Ct 0x0033 200 200 140 Pre-fail
Always - 0
197 Current_Pending_Sector 0x0032 200 200 000 Old_age
Always - 26
198 Offline_Uncorrectable 0x0030 200 200 000 Old_age
Offline - 25
-------------------
> First things first. If the VALUE of Reallocated_Sector_Ct is less
> than or equal to THRES, then your drive is garbage; all of the
> reallocation space has been used. This means many errors have
> occured, and more will keep happening. Get it replaced ASAP.
There may be hope ...
> The Current_Pending_Sector value is interesting. It counts the number
> of sectors which have had read errors, but have not been remapped
> internally in the drive, because it couldn't recover the data using
> error correction. These result in Read errors in the OS - this is
> probably what you are seeing.
> If you have pending sectors, causing the drive to reallocate them is
> very simple. Write data (any data) over the sector in question - the
> drive will then remap it onto the spare area to do the write. (The
> easiest way is to do something like dd if=/dev/zero of=/dev/sdX; but
> if you know the exact sector number, "hdparm --write-sector" can
> remap it quickly.)
Ok - I'll take a try.
> Keep in mind, though - if you have a single reallocated sector on a
> drive, it means that the drive medium is deteriorating. It's very
> likely that you will have additional failures in the future,
> resulting in more IO errors and lost data. For your sanity, I
> recommend replacing a drive as soon as you see any one error on it.
In the past most (nearly all) such problems came from a bad power supply
and/or bad cables, "dd if=/dev/zero" or "badblocks" fixed them ...
Viele Gruesse!
Helmut
next prev parent reply other threads:[~2011-10-17 3:35 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-07 16:51 read error: how to fix? Helmut Hullen
2011-10-10 11:48 ` David Sterba
2011-10-10 13:28 ` Helmut Hullen
2011-10-10 14:07 ` Jeff Mahoney
2011-10-10 15:58 ` Helmut Hullen
2011-10-14 19:47 ` Jeff Mahoney
2011-10-15 18:47 ` Martin Steigerwald
2011-10-15 19:59 ` Helmut Hullen
2011-10-16 19:32 ` Calvin Walton
2011-10-17 3:35 ` Helmut Hullen [this message]
2011-10-18 15:33 ` Helmut Hullen
2011-10-21 9:40 ` Helmut Hullen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Bw0YSZ7T1uB@helmut.hullen.de \
--to=hullen@t-online.de \
--cc=helmut@hullen.de \
--cc=linux-btrfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox