linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Robin Hill <robin@robinhill.me.uk>
To: linux-raid@vger.kernel.org
Subject: Re: Safe disk replace
Date: Tue, 4 Sep 2012 16:33:42 +0100	[thread overview]
Message-ID: <20120904153342.GA26999@cthulhu.home.robinhill.me.uk> (raw)
In-Reply-To: <alpine.DEB.2.00.1209041423250.13902@uplift.swm.pp.se>

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

On Tue Sep 04, 2012 at 02:26:24PM +0200, Mikael Abrahamsson wrote:

> On Tue, 4 Sep 2012, David Brown wrote:
> 
> > The "raid1" copy you mention will one day be possible with "hot replace"
> > <http://neil.brown.name/blog/20110216044002#2>
> >
> > I don't know how far along this idea is at the moment.
> 
> https://lwn.net/Articles/465048/
> 
> "hot-replace support for RAID4/5/6:
> 
> In order to activate hot-replace you need to mark the device as 
> 'replaceable'. This happens automatically when a write error is recorded 
> in a bad-block log (if you happen to have one).
> 
> It can be achieved manually by
>     echo replaceable > /sys/block/mdXX/md/dev-YYY/state
> 
> This makes YYY, in XX, replaceable."
> 
> I don't know if it actually made it into 3.2, I believe I saw somewhere 
> that it was available for 3.3, but Neil Brown should know more.
> 
I'm currently upgrading my RAID-6 arrays via hot-replacement. The
process I followed (to replace device YYY in array mdXX) is:
    - add the new disk to the array as a spare
    - echo want_replacement > /sys/block/mdXX/md/dev-YYY/state

That kicks off the recovery (a straight disk-to-disk copy from YYY to
the new disk). After the rebuild is complete, YYY gets failed in the
array, so can be safely removed:
    - mdadm -r /dev/mdXX /dev/mdYYY

That's worked fine so far, and looks to run at the single disk write
speed. There were no errors on the old disks though, so I've not seen
how that gets handled (it _should_ just do a parity-based recovery from
the remaining disks and continue).

Cheers,
    Robin
-- 
     ___        
    ( ' }     |       Robin Hill        <robin@robinhill.me.uk> |
   / / )      | Little Jim says ....                            |
  // !!       |      "He fallen in de water !!"                 |

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

  reply	other threads:[~2012-09-04 15:33 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-04  4:14 Safe disk replace Chris Dunlop
2012-09-04 10:28 ` David Brown
2012-09-04 12:26   ` Mikael Abrahamsson
2012-09-04 15:33     ` Robin Hill [this message]
2012-09-04 16:34       ` Mikael Abrahamsson
2012-09-04 17:12         ` Robin Hill
2012-09-05 14:25       ` John Drescher
2012-09-05 19:35         ` John Drescher
2012-09-05 19:46           ` John Drescher
2012-09-05 20:32           ` Robin Hill
2012-09-06 12:59             ` John Drescher
2012-09-10  1:01             ` NeilBrown
2012-09-06  3:28       ` Chris Dunlop

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=20120904153342.GA26999@cthulhu.home.robinhill.me.uk \
    --to=robin@robinhill.me.uk \
    --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 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).