linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@ucw.cz>
To: Marcus Overhagen <marcus.overhagen@gmail.com>
Cc: Mark Lord <mlord@pobox.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 14:28:02 +0200	[thread overview]
Message-ID: <20130624122801.GA21124@amd.pavel.ucw.cz> (raw)
In-Reply-To: <CAJBHPojcNeCu1MPd8uM19KPdtaypALDRLaWUt+oRUOeJ9erYPA@mail.gmail.com>

Hi!

> > > root@amd:~# dd if=/dev/sda4 of=/dev/zero bs=1 skip=8958947328
> > > > dd: reading `/dev/sda4': Input/output error
> > > > 0+0 records in
> > > > 0+0 records out
> > > > 0 bytes (0 B) copied, 5.05805 s, 0.0 kB/s
> > >
> > > I once noticed a similar problem. The trouble is that the kernel
> > > always seems to be doing a larger read access that failes for this
> > > sector, and the write is never executed.
> >
> > And returns success writing? That's pretty antisocial :-(.
> 
> On a second look i see that you have if and of reversed in the dd command.

Well, I was doing two dd commands, one to overwrite with zeros, one to
read...

> However, what I was referring to was that writing a single sector with dd
> will fail with a io error because the kernel first seems to do a
> larger read.

I see. But it seems that I'm not hitting this one.

> > ...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?
> 
> I used hdparm --write-sector successfully to fix a single sector where
> dd would fail, but I really don't know what going on with your disk. I
> guess your harddisk is having some more issues than this single
> sector. If you haven't done it yet, make a complete backup!

It looks like I went from ~10 bad sectors to ~2. But the last 2 seem
to be very persistent :-(.

> So assuming(!) that sector 961237184of sda  is logical block 17498759
> from sda4, you may need to write all sectors 961237184 to 961237193.
> 
> However, regarding the smart data, the drive still thinks that it's
> pretty healthy, only 3 reallocated sectors, and no pending.

Well, after remapping experiments, I'm up to 6 sectors reallocated,
and drive no longer thinks it is so healthy (see 187), but... still refuses.

  5 Reallocated_Sector_Ct   0x0033   100   100   036    Pre-fail  Always       -       6
  7 Seek_Error_Rate         0x000f   084   060   030    Pre-fail  Always       -       294493007
  9 Power_On_Hours          0x0032   068   068   000    Old_age  Always       -       28275
 10 Spin_Retry_Count        0x0013   100   100   097    Pre-fail  Always       -       0
 12 Power_Cycle_Count       0x0032   099   037   020    Old_age  Always       -       1024
184 End-to-End_Error        0x0032   100   100   099    Old_age  Always       -       0
187 Reported_Uncorrect      0x0032   001   001   000    Old_age  Always       -       162

> Perhaps writing the whole disk with dd and a larger blocksize would
> ill work? something like
> 
> dd if=/dev/zero of=/dev/sda bs=1M
> 
> You shouldn't have any partiton monted when doing so. All data ist
> lost after that is finished. then you can look into the smart data to
> see how many sectors were reallocated, and decide if you want to trash
> the disk.

Well, the disk is 500GB, in notebook, and it is my primary
machine. I'm running backups now, but "full backup" is not exactly
easy, and doing complete erase would be few days of work :-(.

Fortunately, affected area is in small, ~15G partition, I don't really
_need_.

But I'd really like to understand what is going on there. New hdd for
the notebook is not out of question, but... AFAICT I can expect cca
4MB per second from the disk (it would be USB->SATA copy), and that
would be 34 hours...
									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 12:28 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 [this message]
2013-06-24  7:14           ` Ondrej Zary
2013-06-24 11:06             ` Pavel Machek
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=20130624122801.GA21124@amd.pavel.ucw.cz \
    --to=pavel@ucw.cz \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.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).