Installing Raid1 in Ubuntu14.03
Let’s create software Raid 1 in ubuntu server 14.03 . I have done this software Raid1 installation in Virtualbox. Same steps I have used installing software Raid1 in physical 64 bit Machine.
- In Vmware I have created two harddisks sda and sdb each of 16 GB.
- I have ISO image of ubuntu server 14.03
- To begin , run the Ubuntu Installer . When we get the ‘Partition disks’ menu choose Manual.
2. In my case disk is new , there is no partitions created yet. I will be selecting each disk to create disk partition table.
Repeat those steps to create the free partition table for the second disk drive.
3. Now I will be using the free space in the first disk to create the partitions.
4. The first partition will be of 0.8 GB which I will be using to create /boot partition.
I only use Primary partitions here but you can use primary or Logical/Extended, it makes little difference for this example.
Put is at the beginning of the free disk space or not your choice.
5. Highlight and then press return on the use as option selecting physical volume for RAID and set the Bootable flag: on. It should look as mine did below. Select Done setting up the partition to return back to the Partition Disks main menu.
Use a similar process for root partition. Select the remaining free space on disk one. Create a partition this time I used 24GB, Primary, and Beginning. set Use as to be physical volume for RAID.
For the swap partition use all the remaining disk space about 2GB. again set use as to bephysical volume for RAID.
Repeat the above making an exact copy for the second drive, now you know why I choose the values I did :-).
The disk should look similar to the following.
Create the MD Devices
Now to setup our three RAID1 arrays, /dev/md. Highlight Configure RAID and press return. Write the change to the storage devices.
6. To create our RAID1 MD devices, select partitions in pairs sda1 & sdb1, sda2 &sdb2 etc. Each MD device will have 2 disks and zero spares. The screen shot shows the disks for the boot partition. Repeat for the other two devices and then select finish.
7. Selecting MD components. It’s important to select two partitions with identical sizes so in my case md0=sda1+sbd1, md1=sda2+sdb2 and md2=sda3+sdb3.
Back at the main menu again and it should look similar to the following:
8. Highlight the line under RAID device #0. This is the unused space on the device. Set it up as an EXT4 file system and a mount point of /boot.
Now setup the swap partition on RAID device #2, it’s a similar process to the /boot partition.
Overall it should look like this
Now complete the install as you would any other. I only select open ssh server from the package manager it makes the initial install much quicker. (If you break it you don’t have to wait so long for it to reinstall.)
9. While we will get grub installation prompt , do not select install grub in MBR rather select install it in /dev/sda /dev/sdb and proceed.
10. Server ask for reboot after installation, when server comes up do below things
- For safer side again install grub in sda and sdb
# grub-install /dev/sda
- b) Update the grub, if there is some issue with grub, update grub will show you the message.
11. Execute the below command , it’s necessary if you want booting mode doesn’t go to initramfs mode.
#echo “sleep 60” > /etc/initramfs-tools/scripts/init-premount/delay_for_raid_array_to_build_before_mounting
#chmod a+x /etc/initramfs-tools/scripts/init-premount/delay_for_raid_array_to_build_before_mounting
For testing the raid setup follow the instruction given in the below link