-1

I have an asterisk pbx. It has 2 drives in a raid 1 setup. However if my main drive fails my 2nd won't boot, as it has no boot partition.

The most important thing for me is up time. If there is a power outage and or a drive failure I'd like the backup drive to boot without any intervention.

What's the way to do this and can I have some guide to doing so.

For clarification. I'm not asking how to "fix" my current setup. I've got 2 drives, a cheap controller and I'm looking for the most robust configuration.

wlraider70
  • 133
  • 7
  • how is the existing mirror being accomplished? HBA or in software? Sounds like it might be software as a HBA should mirror everything and the OS shouldn't care/know the difference. Perhaps there is a config change you can make there to resolve that. I would guess a RAID 1 config would be acceptable assuming you know the risks associated with using that setup. You mention power outage, but I think that is beyond the scope of your question relating to the RAID config. – MikeAWood Jul 18 '13 at 01:42
  • 1
    This doesn't make sense. How could the drives be in a RAID 1 if you can't boot the system with 1 failed drive? Something isn't right here. – joeqwerty Jul 18 '13 at 01:49
  • The "controller" is http://www.newegg.com/Product/Product.aspx?Item=N82E16816104006 using the on card array. Seems like that's my issue – wlraider70 Jul 18 '13 at 01:51
  • 2
    You should be able to create a bootable second drive with that card.. Just do whatever you did to the first one to the second one to make it bootable. This is really basic System Administration stuff. – Chris S Jul 18 '13 at 01:55

3 Answers3

3

If you really are using the RAID features of that card and you can't boot off the second drive, then you set up the volumes incorrectly in the RAID setup utility. You should have one volume that consumes the entirety of both drives. If that is not what you have then you either need to reconfigure what you do have (if your controller supports online or lossless reconfiguration), or you need to backup, erase, configure and restore.

longneck
  • 22,793
  • 4
  • 50
  • 84
1

Raid 1 should mirror all data on both drives, including the MBR.

One possible explanation of why your machine will not boot, is that the raid card enters a rebuild mode, and you will have to replace the drive, and rebuild your raid before booting.

http://www.tomshardware.com/forum/288790-32-what-drive-raid-fails

A second possible explanation is that the raid card simply needs to mark the non failed drive as active

http://www.bleepingcomputer.com/forums/t/452487/raid-1-wont-boot/

The least likely explanation is that you are running a software raid and your boot loader partition is in fact not on each drive. If that is the case, then you would have to boot into a live cd and do a dd of the mbr.

dd if=/dev/sda of=/dev/sdb bs=512 count=1
# Warning: Do not run this command on a GPT drive, or a drive using 4k sector sizes
http://en.wikipedia.org/wiki/GUID_Partition_Table

http://forums.opensuse.org/english/get-technical-help-here/install-boot-login/393772-how-install-bootloader-both-disks-software-raid-1-a.html

spuder
  • 1,695
  • 2
  • 25
  • 42
1

Modern grub2 boot loader is able to find his files on LVM2, on many filsystem and on raid-1 system.

So there is a lot of solution, from using RAID capabilities from LVM2, from Kernel md (my personal recommendation) or even from hardware raid.

The first step of booting linux use a temporary init ram disk from which it's able to make a lot of thing for making / (root) partition available.

In order for this work, you have to build a full raid with all needed partitions mirrored.

Proposition (based on Debian's debootstrap):

/dev/sda -> 2 partitions: sda1 = 50% but min 5Gb, sda2 = whole space left
/dev/sdb -> 2 partitions: sdb1 == sda1 length, sdb2 = whole space left

mdadm --create /dev/md0 --level=1 --raid-devices=2 /dev/sd{a,b}1
mdadm --create /dev/md1 --level=0 --raid-devices=2 /dev/sd{a,b}2

pvcreate /dev/md0
vgcreate mirror /dev/md0
pvcreate /dev/md1
vgcreate strip /dev/md1

lvcreate -L 4G -n root mirror
lvcreate -L 10G -n tmp strip

mkfs.ext4 -L ROOT /dev/mirror/root
mkfs.ext4 -L TMP /dev/strip/tmp

mkdir /target
mount /dev/mirror/root /target
mkdir /target/tmp
mount /dev/strip/tmp /target/tmp

From there,

debootstrap /target
for bind in proc sys dev{,/pts} ;do mount --bind /$bind /target/$bind; done
chroot /target
apt-get install mdadm lvm2 linux-image grub2

This is near all you need. All this could be done by regular installation procédure:

Just boot normal installer, than at partition chooser, hit ``manual config'', build raid, than build LVM.

Nota: you may prefer not to use RAID-0 at all, in this case, only one partition is needed on both disks.

Nota2: swap partition could be located on raid-1 or on raid-0 depending on what kind of reliability or speed you need..