0

I am setting up a linux server with two drives in an mdadm created raid 1. All the online help I fine says to create your partitions and then create an md0 raid volume using something like sda1 and sdb1 for the raid. So my question is, what if drive sda goes down...how will drive sdb boot up?

I want two 100% identical drives so that if one fails, I can install a new drive, repair and run without any loss of data.

1
  • Booting actually isn't that important. You can always re-download Linux. The locations to protect are directories like /home, /var and /etc - those should be on the RAID because those contain your work.
    – MSalters
    Commented Apr 5, 2016 at 12:54

3 Answers 3

1

If you want to be able to boot from your linux raid1 device, you need to do the following:

No partitions on the disks, add (for example) /dev/sda and /dev/sdb to your raid1 device.

Use --metadata=1.0 when you create the raid (to store the raid superblock at the end of the disk.)

Create a regular "MBR"-style partition with fdisk on the raid device and use that either as your root filesystem (or /boot, if you want encrypted root).

Install grub on BOTH sda and sdb, both times telling grub that THAT disk is hd0.

This means that whatever disk the BIOS things is 0x80 will be read and booted correctly.

0

This one is an excellent question. I've had this happen. It wasn't fun.

Practically speaking, the SuperGrub CD (http://www.supergrubdisk.org/) is likely to be able to help you recover when this happens.

I've tried things like making sure to install GRUB on both disks, making sure the drives were as identical as possible... But SuperGrub is the approach that has worked.

If you do this and you're serious, you should test to see if you can boot the system with either disk and re-synchronize the mirror once it is back up. The re-synchronization is also harder than it should be / seems, so make sure you document that part.

4
  • Why is it not recommended to just add my drives to the raid vs the partitions? And how would someone with raid 5 ever recover when a boot drive goes out?
    – user277244
    Commented Mar 8, 2014 at 7:06
  • Re: drives vs. partitions: The on-disk format for RAID array members is not the same as non-members (there is a special RAID partition type, among other details). Re: RAID5: I haven't been in that position, but you could boot with a RAID capable kernel (on other media / partitions?), bring the array up degraded, and move forward from there. Maybe the md documentation can help. Commented Mar 8, 2014 at 19:13
  • So is linux raid fundamentally crippled vs hardware raid? With a hardware raid, or even an intel fake raid, I raid the entire drive. So if one goes down, I can boot up just fine.
    – user277244
    Commented Mar 8, 2014 at 19:20
  • 1) md-raid is not the only RAID option available in Linux. 2) I'm not an expert in it; I've just used it before, possibly incorrectly. 3) Linux can make use of hardware RAID just like any other OS. 4) In my experience 'boot up just fine' is in the eye of the beholder, and I don't see it that often. Commented Mar 8, 2014 at 19:28
0

what if drive sda goes down...how will drive sdb boot up?

It does not need to.

If you installed a mirror then you are not using sda nor sdb. Instead you use /dev/mdX. And that mdx device will stay available even if one of the drives of the array fails.

The only exciting part is if you want to boot and your firmware want to find a bootsector or EFI file. It should just give up on a disk and continue searching. If that does not work pull the broken disk, especially if it is a SATA disc and not a SAS disk (SATA does not always fail gracefully).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .