Raid 1 setup

I have installed freepbx with asterisk 13 on a test system with two 160 GB hard disk. I want to configure raid 1. My question is :
Do I have to choose each of the partition and set raid 1 for each partition. Can I not set raid 1 for the entire disk.
Also in case one of the hard disk fails how do I replace it. I went through wiki it looks quite out dated. For eg grub is not there. Fdisk command is not there when system boots with one hard disk.
Please help. I am quite confused.


Theoretically, if you install two identical hard drives, the SNG7 FreePBX Distro 14 installer should automatically create a software RAID 1. But I have tried that and it seems it only creates it automatically if you install on a UEFI motherboard, but if the motherboard has a legacy BIOS, the installer won’t crate the RAID automatically and you must do custom partitioning.

Thanks @arielgrin for the response. My motherboard supports uefi so I guess it will install raid 1 automatically. The 2nd query was how to replace the hard disk in case of failure. Any pointers for that.

If the disk fails, you just replace it. mdraid will take care of raid resync.

Thanks @arielgrin so I just remove the bad disk n plug in new disk and every thing will be automatic or I have to give some commands. Can you just explain. Also even though my board supports UEFI I had to select each partition and select partion type as raid. Where am I going wrong. Actually the hard disks are already partitioned I want to delete the old partition and do reinstallation with raid.

Regarding the installation, if you select “recommended” it should create the raid for you, you shouldn’t need to do any manual partitioning. Regarding raid recreation after a disk failure, you just need to remove the failed disk and install the new disk, that is all, no commands or anything. The exception would be if GRUB is installed to only one disk, and the disk that fails is the one that has GRUB on it, the PC wouldn’t boot, so you need to make sure that the /boot partition is also mirrored with raid and that grub is installed in both disks. I think that SNG7 installer creates the /boot partition in one disk only, and grub gets installed to that same disk.

Thanks @arielgrin for replying.
Sorry for late reply. I wanted to test before I post a reply.

  1. Regarding the installation, “recommented” option worked.
  2. To test disk failure, I pulled out one of the hard disk. The system booted with a hash prompt with root priviledge. I followed these steps (in case it helps someone)

a) At # prompt : /usr/sbin/mdraid_start /dev/sda ( the active hdd).
The system boots normally with degraded raid.
b) Plug the new hard disk and boot the system

    1) Replicate the partition from working hdd to new hdd
            sfdisk -d /dev/sda|sfdisk /dev/sdb (if /dev/sdb died and you replaced it)

     2) Add the new partitions to the active RAID:
            mdadm --manage /dev/md0 --add /dev/sdb1
            mdadm --manage /dev/md1 --add /dev/sdb2
    3) Check raid status
            mdadm --detail /dev/md0
            mdadm --detail /dev/md1


Glad it worked for you. If I remember correctly, FreePBX installer creates the boot partition in just one disk.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.