linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@ucw.cz>
To: Ondrej Zary <linux@rainbow-software.org>
Cc: Mark Lord <mlord@pobox.com>,
	Marcus Overhagen <marcus.overhagen@gmail.com>,
	kernel list <linux-kernel@vger.kernel.org>,
	linux-ide@vger.kernel.org, tj@kernel.org
Subject: Re: SATA hdd refuses to reallocate a sector?
Date: Mon, 24 Jun 2013 13:06:34 +0200	[thread overview]
Message-ID: <20130624110634.GA18185@amd.pavel.ucw.cz> (raw)
In-Reply-To: <201306240914.29502.linux@rainbow-software.org>

Hi!

> > > For ATA, use the "logical sector size".
> > > For all existing drives out there, that's a 512 byte unit.
> >
> > I guessed so. (It would be good to actually document it, as well as
> > documenting exactly why it is dangerous. Is it okay to send patches?)
> >
> > > > ...but it does not do the trick :-(. It behaves strangely as if it was
> > > > still cached somewhere. Do I need to turn off the write back cache?
> > >
> > > No, it works just fine.  You probably have more than one bad sector.
> > > After you see a read failure, run "smartctl -a" and look at the error
> > > logs to see what sector the drive is choking on.
> >
> > Well, I definitely have more than one bad sector, but I did try to
> > read exactly the same sector and it failed. See below.
...
> > Thanks for support,
> > 									Pavel
> 
> Being tired of using hdparm manually, I created a simple hdd_realloc utility
> that reads the disk in big blocks (1 MB). When there's a read error, it reads
> the failed block sector-by-sector and tries to rewrite the sectors that fail
> to read. It work fine for disks with just a couple of pending
> sectors.

Thanks! This should really be part of distribution... And it does
O_DIRECT, O_SYNC...

It seems to have reallocated one more sector (I'm on 6 now).. but
there are still some underlying problems. I guess I should try stock
kernel from Debian?

Or perhaps give up and avoid Seagate in future :-(.

root@amd:/data/pavel/misc# ./hdd_realloc /dev/sda4 8958947328
Position: 8958947328 B (8543 MiB, 8 GiB, sector 17497944), rate 0
MiB/s
Read error: Input/output error
Examining 8958947328
Unable to read at 8959366144, rewriting...OK
Unable to read at 8959366656, rewriting...OK
Unable to read at 8959367168, rewriting...OK
Unable to read at 8959778816, rewriting...OK
Unable to read at 8959779840, rewriting...OK
Position: 8959995904 B (8544 MiB, 8 GiB, sector 17499992), rate 0
MiB/s
Read error: Input/output error
Examining 8959995904
Unable to read at 8960192512, rewriting...OK
Position: 12548222976 B (11966 MiB, 11 GiB^Csector 24506200), rate 10
MiB/s
root@amd:/data/pavel/misc# ./hdd_realloc /dev/sda4 8958947328
Position: 8958947328 B (8543 MiB, 8 GiB, sector 17497944), rate 0
MiB/s
Read error: Input/output error
Examining 8958947328
Unable to read at 8959366656, rewriting...OK
Unable to read at 8959367168, rewriting...OK
Position: 9^C6042624 B (9389 MiB, 9 GiB, sector 19230552), rate 11
MiB/s
root@amd:/data/pavel/misc# 

(s2ram to give disk a chance to reboot).

root@amd:/data/pavel/misc# ./hdd_realloc /dev/sda4 8958947328
Position: 8958947328 B (8543 MiB, 8 GiB, sector 17497944), rate 0
MiB/s
Read error: Input/output error
Examining 8958947328
Unable to read at 8959366656, rewriting...OK
Unable to read at 8959367168, rewriting...OK
Position: 14^C5529088 B (13928 MiB, 13 GiB, sector 28526424), rate 21
MiB/s
root@amd:/data/pavel/misc# ./hdd_realloc /dev/sda4 8958947328
Position: 8958947328 B (8543 MiB, 8 GiB, sector 17497944), rate 0
MiB/s
Read error: Input/output error
Examining 8958947328
Unable to read at 8959366656, rewriting...OK
Unable to read at 8959367168, rewriting...OK
Unable to read at 8959779840, rewriting...OK
Position: 9356357056 B (8921 MiB, 8 GiB, sector 18272088), rate 15
MiB/s

									Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

  reply	other threads:[~2013-06-24 11:06 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-23 10:19 SATA hdd refuses to reallocate a sector? Pavel Machek
2013-06-23 11:21 ` Pavel Machek
2013-06-23 13:16   ` Marcus Overhagen
2013-06-23 19:00     ` Pavel Machek
2013-06-23 21:27       ` Mark Lord
2013-06-23 21:51         ` Pavel Machek
2013-06-23 22:35           ` Mark Lord
2013-06-24  6:19             ` Marcus Overhagen
2013-06-24 12:28               ` Pavel Machek
2013-06-24  7:14           ` Ondrej Zary
2013-06-24 11:06             ` Pavel Machek [this message]
2013-06-24 12:18             ` Mark Lord
2013-06-26  3:04               ` James Bottomley
2013-06-26  6:11                 ` Ondrej Zary
2013-06-29 18:47             ` Henrique de Moraes Holschuh
2013-06-29 23:02               ` Mark Lord
2013-06-30 14:34                 ` Henrique de Moraes Holschuh
2013-06-30 16:49                   ` Pavel Machek
2013-07-01 13:28                     ` Henrique de Moraes Holschuh
2015-04-30 19:01         ` Pavel Machek
2013-06-24 12:48 ` Zdenek Kaspar
2013-06-24 13:08   ` Ondrej Zary

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=20130624110634.GA18185@amd.pavel.ucw.cz \
    --to=pavel@ucw.cz \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@rainbow-software.org \
    --cc=marcus.overhagen@gmail.com \
    --cc=mlord@pobox.com \
    --cc=tj@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;
as well as URLs for NNTP newsgroup(s).