linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: How to force rewrite of a smart detected bad block with raid5: checkarray?
@ 2011-01-19 18:36 Richard Scobie
  2011-01-19 18:49 ` Marc MERLIN
  0 siblings, 1 reply; 11+ messages in thread
From: Richard Scobie @ 2011-01-19 18:36 UTC (permalink / raw)
  To: Linux RAID Mailing List; +Cc: marc

Marc Merlin wrote:

 > Also, I didn't find anything about sync_action, check, and repair in
 > the mdadm man page (a pointer to
 > https://raid.wiki.kernel.org/index.php/RAID_Administration
 > would me useful).
 > Actually the above page still says that you can't check just a range
 > of blocks.

 > Is there more up to date documentation that I should be reading
 > somewhere?

The kernel source, Documentation/md.txt.

Regards,

Richard

^ permalink raw reply	[flat|nested] 11+ messages in thread
* How to force rewrite of a smart detected bad block with raid5: checkarray?
@ 2011-01-19  7:04 Marc MERLIN
  2011-01-19  7:42 ` Mikael Abrahamsson
  0 siblings, 1 reply; 11+ messages in thread
From: Marc MERLIN @ 2011-01-19  7:04 UTC (permalink / raw)
  To: linux-raid

I couldn't quite find the answer to this with a search.

Smart reported a bad block (pending).
I confirmed it with:

hdrecover /dev/sdk
(...)
Sector 3907017780 (99%) ETR: 0 seconds
Error at sector 3907029168
Attempting to pounce on it...
Attempt 1 from sector   3219409027: FAILED
Attempt 2 from sector   1546846730: FAILED
(...)
Attempt 19 from sector   3837517549: FAILED
Attempt 20 from sector   2281104567: FAILED
Couldn't recover sector 3907029168
The data for this sector could not be recovered. However, destroying the
contents of this sector (ie writing zeros to it) should cause the hard disk
to reallocate it making the drive useable again
Do you really want to destroy the data in sector 3907029168?     [ (y)es / (n)o / (a)ll / (q)uit ]:^C

Now, hdrecover had no idea that /dev/sdk is part of a raid5, so I'm not going to
use it to rewrite the bad block.

I know I can remove /dev/sdk1 from my array and put it back in, but that's
unsafe because if during a rebuild another block from another drive happens
to be bad, I'm then left with a double raid failure.

So, I tried this: /usr/share/mdadm/checkarray md7

md7 : active raid5 sdi1[0] sdh1[5] sdl1[3] sdk1[2] sdj1[1]
      7814045696 blocks super 1.2 level 5, 512k chunk, algorithm 2 [5/5] [UUUUU]
      [>....................]  check =  0.0% (447616/1953511424) finish=28435.6min speed=1144K/sec

But I couldn't quite find documentation on what the kernel does in this case.

Does this actually do what I want? Try all the blocks on each drive and if
one block is unreadable, it forces a rewrite on the bad drive using the n-1
other ones to recreate it?

Thanks,
Marc
-- 
"A mouse is a device used to point at the xterm you want to type in" - A.S.R.
Microsoft is to operating systems & security ....
                                      .... what McDonalds is to gourmet cooking
Home page: http://marc.merlins.org/  

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2011-01-20  0:30 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-19 18:36 How to force rewrite of a smart detected bad block with raid5: checkarray? Richard Scobie
2011-01-19 18:49 ` Marc MERLIN
2011-01-19 20:01   ` NeilBrown
2011-01-19 20:57     ` Marc MERLIN
2011-01-20  0:30       ` Richard Scobie
  -- strict thread matches above, loose matches on Subject: below --
2011-01-19  7:04 Marc MERLIN
2011-01-19  7:42 ` Mikael Abrahamsson
2011-01-19  9:41   ` NeilBrown
2011-01-19 17:31     ` Marc MERLIN
2011-01-19 20:58       ` NeilBrown
2011-01-19 21:03         ` Marc MERLIN

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