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: kernel list <linux-kernel@vger.kernel.org>,
	linux-ide@vger.kernel.org, tj@kernel.org, mlord@pobox.com
Subject: Re: SATA hdd refuses to reallocate a sector?
Date: Sun, 23 Jun 2013 21:00:03 +0200	[thread overview]
Message-ID: <20130623190003.GA6714@amd.pavel.ucw.cz> (raw)
In-Reply-To: <CAJBHPoj5hgp97=JH8UKX+Ty8TF9_ySQUYU6AnqcRjuLy5A-PcQ@mail.gmail.com>

Hi!

> > ...Ok, lets try with dd.
> >
> > 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 :-(.

> You can try: hdparam --write-sector 961237188 /dev/sda

Thanks for the hint. (Insert rant about hdparm documentation
explaining that it is bad idea, but not telling me _why_ is it bad
idea. Can I expect cache consistency issues after that, or is it just
simple "you are writing to the disk without any checks"? Plus, I guess
documentation should mention what sector number is. I guess sectors
are 512bytes for the old drives, but is it 512 or 4096 for new
drives?)

...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?

root@amd:~# hdparm --yes-i-know-what-i-am-doing  --read-sector
  read-sector: bad/missing sector value
root@amd:~# hdparm --yes-i-know-what-i-am-doing  --read-sector
  961237188 /dev/sda

/dev/sda:
reading sector 961237188: FAILED: Input/output error
root@amd:~# hdparm --yes-i-know-what-i-am-doing  --write-sector
961237188 /dev/sda

/dev/sda:
re-writing sector 961237188: succeeded
root@amd:~# hdparm --yes-i-know-what-i-am-doing  --read-sector
961237188 /dev/sda | uniq

/dev/sda:
reading sector 961237188: succeeded
0000 0000 0000 0000 0000 0000 0000 0000
root@amd:~# sleep 10
root@amd:~# hdparm --yes-i-know-what-i-am-doing  --read-sector
961237188 /dev/sda | uniq

/dev/sda:
reading sector 961237188: succeeded
0000 0000 0000 0000 0000 0000 0000 0000
root@amd:~# sync
root@amd:~# hdparm --yes-i-know-what-i-am-doing  --read-sector
961237188 /dev/sda | uniq

/dev/sda:
reading sector 961237188: succeeded
0000 0000 0000 0000 0000 0000 0000 0000
root@amd:~# dd if=/dev/sda4 of=/dev/zero bs=4096
skip=$[8958947328/4096]
dd: reading `/dev/sda4': Input/output error
102+0 records in
102+0 records out
417792 bytes (418 kB) copied, 5.36697 s, 77.8 kB/s
root@amd:~# hdparm --yes-i-know-what-i-am-doing  --read-sector
961237188 /dev/sda | uniq

/dev/sda:
FAILED: Input/output error
reading sector 961237188: 
root@amd:~# 

Thanks,
									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-23 19:00 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 [this message]
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
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=20130623190003.GA6714@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).