linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: NeilBrown <neilb@suse.de>
To: Adam Goryachev <mailinglists@websitemanagers.com.au>
Cc: Hai Wu <haiwu.us@gmail.com>, linux-raid@vger.kernel.org
Subject: Re: mdadm rebuild
Date: Mon, 9 Dec 2013 11:16:51 +1100	[thread overview]
Message-ID: <20131209111651.664635f9@notabene.brown> (raw)
In-Reply-To: <52A50730.4030301@websitemanagers.com.au>

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

On Mon, 09 Dec 2013 10:56:32 +1100 Adam Goryachev
<mailinglists@websitemanagers.com.au> wrote:

> On 09/12/13 10:17, NeilBrown wrote:
> > On Sun, 8 Dec 2013 17:03:22 -0600 Hai Wu <haiwu.us@gmail.com> wrote:
> >
> >> This is something I am not aware of, thanks!
> >>
> >> In this case, do I have to worry about cases where the new drive might not be able to boot (this is raid1 with 2 drives, and both drives need to be able to boot up the server by themselves in case the other drive fails later)? I remember I had to do the following before for the new drive:
> >>
> >> grub> root (hd0,0)
> >>
> >> Is that still the case here if marking it as 'spare'?
> > If you want the new drive to boot and the boot sector is not covered by any
> > md array, then you have to update the boot sector yourself.
> >
> > You can presumably get udev to run some command which will write a boot
> > sector out.  However I'm not an expert on boot sector management so cannot
> > really advise you.
> Hi Neil,
> 
> I like the way you phrased that :)
> 
> I just wanted to clarify one point, it there a specific MD metadata 
> version (I'm assuming either 1.0 or 1.2) which could be applied to an 
> entire device MD array which would allow the automatic sync of the boot 
> sectors/etc
> 
> ie, something like:
> mdadm --create /dev/md3 --level=raid1 --metadata=1.2 /dev/sda /dev/sdb
> 
> then writing the boot sector information to /dev/md3
> mdadm --manage /dev/md3 --fail /dev/sdb
> mdadm --manage /dev/md3 --remove /dev/sdb
> mdadm --manage /dev/md3 --add /dev/sdc
> 
> Then, shutdown, remove sda and sdb
> 
> Would you expect the system to boot successfully from sdc (assuming the 
> BIOS will boot from it, and that the OS will "find" the correct boot and 
> root device....
> 
> In the past I've always used partitions for MD, but this might be a good 
> reason to use whole devices if it would solve the issue of the boot 
> sector information.
> 
> Regards,
> Adam

If you use --metadata=1.0 then everything from the very start of the device
to near the end is mirrored.
If having identical boot blocks on every device works (which I think it does,
but I'm no expert), then using 
  --level=raid1 --metadata=1.0
on whole devices (not partitions) would remove the need to worry further
about boot sectors.

NeilBrown

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

  reply	other threads:[~2013-12-09  0:16 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-08 17:53 mdadm rebuild Hai Wu
2013-12-08 21:55 ` NeilBrown
     [not found]   ` <CAJ1=nZfUBQ0_T1s3deG+HOU7BQeayibWcW8y5h5bEjFt2tvhnA@mail.gmail.com>
2013-12-08 22:53     ` NeilBrown
2013-12-08 23:03       ` Hai Wu
2013-12-08 23:17         ` NeilBrown
2013-12-08 23:56           ` Adam Goryachev
2013-12-09  0:16             ` NeilBrown [this message]
     [not found]   ` <CAJ1=nZcGO_GTUZ9bgrYJJXHoGQnepHyLof21xQ3MFwokfaCvCg@mail.gmail.com>
2013-12-09 22:17     ` NeilBrown
2013-12-08 21:56 ` Peter Grandi

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=20131209111651.664635f9@notabene.brown \
    --to=neilb@suse.de \
    --cc=haiwu.us@gmail.com \
    --cc=linux-raid@vger.kernel.org \
    --cc=mailinglists@websitemanagers.com.au \
    /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).