Re: mdadm rebuild
From: NeilBrown <hidden>
Date: 2013-12-09 00:16:51
On Mon, 09 Dec 2013 10:56:32 +1100 Adam Goryachev [off-list ref] wrote:
On 09/12/13 10:17, NeilBrown wrote:quoted
On Sun, 8 Dec 2013 17:03:22 -0600 Hai Wu [off-list ref] wrote:quoted
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
Attachments
- signature.asc [application/pgp-signature] 828 bytes