All of lore.kernel.org
 help / color / mirror / Atom feed
From: Roman Mamedov <roman@rm.pp.ru>
To: Janek Kozicki <janek_listy@wp.pl>
Cc: linux-raid@vger.kernel.org
Subject: Re: raid5 failed while rebuiling - classical problem
Date: Sat, 3 Jul 2010 03:36:59 +0600	[thread overview]
Message-ID: <20100703033659.0cffc6ad@natsu> (raw)
In-Reply-To: <20100702231854.105b8612@atak.bl.pg.gda.pl>

[-- Attachment #1: Type: text/plain, Size: 1345 bytes --]

On Fri, 2 Jul 2010 23:18:54 +0200
Janek Kozicki <janek_listy@wp.pl> wrote:

> I need to overwrite the bad sector with zeros.

There isn't really a need to overwrite the whole drive for that -- you can
either get that block's address from the LBA number in dmesg errors, or by
running a read-only badblocks test. Then make sure it is really the sector you
want (try reading it with dd -- it will fail with an I/O Error), and overwrite
using dd if=/dev/zero of=/dev/hda seek=NNNNNNNNN bs=512 count=1
Several times if needed, checking if the drive has remapped the sector already
(instantly, or after some repeats it should become readable).

> I have a free hdc3, which I am going to use for that:
> 
>   # dd bs=512 if=/dev/hda3 of=/dev/hdc3 conv=noerror,sync
> 
> The noerror tells dd to continue, even if it cannot read, and sync
> tells to write zeros on hdc3 in that place (at least I hope that I
> got the manpage right).

There is the dd_rescue program, made specifically for that purpose:
http://www.garloff.de/kurt/linux/ddrescue/

> Then I will have an almost exact copy of bad hda3 on hdc3. 
> <...> maybe I could just --add hdc3 in place of hda3 ?

Yes, you could, and that would be the most logical thing to do (as hda might
continue failing and developing more bad sectors).

-- 
With respect,
Roman

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

  reply	other threads:[~2010-07-02 21:36 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-02 14:31 raid5 failed while rebuiling - classical problem Janek Kozicki
2010-07-02 21:18 ` Janek Kozicki
2010-07-02 21:36   ` Roman Mamedov [this message]
2010-07-03 11:47     ` Roman Mamedov
2010-07-03 13:51       ` Janek Kozicki
2010-07-04  8:18         ` Janek Kozicki
2010-07-04 12:36           ` Daniel Pittman

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=20100703033659.0cffc6ad@natsu \
    --to=roman@rm.pp.ru \
    --cc=janek_listy@wp.pl \
    --cc=linux-raid@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.