Linux RAID subsystem development
 help / color / mirror / Atom feed
From: Adam Goryachev <mailinglists@websitemanagers.com.au>
To: starlight.2012q4@binnacle.cx
Cc: linux-raid@vger.kernel.org
Subject: Re: question: no-bitmap RAID1 with off-site drive
Date: Mon, 12 Nov 2012 14:40:15 +1100	[thread overview]
Message-ID: <50A06F9F.3090600@websitemanagers.com.au> (raw)
In-Reply-To: <6.2.5.6.2.20121111170842.05dfe758@binnacle.cx>

On 12/11/12 09:14, starlight.2012q4@binnacle.cx wrote:
> Would like to have the option to zero the
> superblock of an incoming drive and have
> it treated as a virgin replacement.
>
> I tried this (I think) by running
>
>    mdadm --add /dev/md2 /dev/sde
>
> It worked, but assigned the new drive
> as device number [2], which seems
> incorrect.  I tried failing/removing the
> drive followed by a
>
>    mdadm --remove /dev/md2 detached
>
> and repeated the --add with a zero-superblock
> drive but it does the same thing every time.
> Only way to get it to reuse drive slot 1
> was to do a 
>
>    mdadm --grow --raid-devices=1 --force /dev/md2
>
> followed by a
>
>    mdadm --grow --add --raid-devices=2 /dev/md2 /dev/sde
>
> Is this the expected behavior?  I find it
> confusing and probably don't understand
> it properly.
>
I think (from what I understand) is that you will do the following:
1) Two HDD in raid1 installed, synced, working
2) Install third HDD
3) mdadm --manage /dev/md2 --add /dev/sde (add it as a spare)
4) mdadm --grow /dev/md2 --raid-devices=3 (add the third disk to the
array, and let it sync)
5) madam --manage /dev/md2 --fail /dev/sdd (fail the disk you want to
remove)
6) mdadm --manage /dev/md2 --remove /dev/sdd (remove the disk from the
array)
7) mdadm --grow /dev/md2 --raid-devices=2 (reconfigure the array to only
have two disks)
8) Physically remove sdd and send offsite

The above process will ensure that you ALWAYS have at least two copies
of your live data (ie, two working, fully synced members of the array).

I have seen that there are some new features to make a drive as "want
replacement", which will do some magic to copy all the data to a spare
device without actually removing the drive until the spare is synced or
similar. However, I think this is only in very recent kernel, and you
might need to do some work in finding the usage details etc.

Hope the above helps.

Regards,
Adam

-- 
Adam Goryachev
Website Managers
www.websitemanagers.com.au


  reply	other threads:[~2012-11-12  3:40 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-11 21:40 question: no-bitmap RAID1 with off-site drive starlight.2012q4
2012-11-11 22:14 ` starlight.2012q4
2012-11-12  3:40   ` Adam Goryachev [this message]
2012-11-12 14:55     ` starlight.2012q4
2012-11-12 17:56       ` Drew
     [not found]         ` <CACJz6Qt93zm47+576HSWBv+GGcNKKmz0G7+soAqPSMeBk2KFCg @mail.gmail.com>
2012-11-12 18:05           ` starlight.2012q4
2012-11-12 17:26 ` starlight.2012q4
2012-11-12 18:11   ` starlight.2012q4
2012-11-12 20:31     ` NeilBrown
2012-11-12 20:40       ` starlight.2012q4
2012-11-19  0:11   ` starlight.2012q4
2012-11-27  2:31     ` NeilBrown
2012-11-27  3:31       ` starlight.2012q4

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=50A06F9F.3090600@websitemanagers.com.au \
    --to=mailinglists@websitemanagers.com.au \
    --cc=linux-raid@vger.kernel.org \
    --cc=starlight.2012q4@binnacle.cx \
    /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