RAID1

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.

 

  1. In Vmware I have created  two harddisks sda and sdb each of 16 GB.
  2. I have ISO image of ubuntu server 14.03

 

  1. To begin , run the Ubuntu Installer . When we get the  ‘Partition disks’ menu choose Manual.

Ubuntu Linux - How to Configure Software RAID Tutorial 1

 

2. In my case disk is new , there is no partitions  created yet.  I will be selecting each disk to                                    create disk  partition table.

raid1_02

raid1_03

 

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.

raid1_04

raid1_05

 

Ubuntu Linux - How to Configure Software RAID Tutorial 5

 

4. The first partition will be of 0.8 GB which I will be using to create /boot partition.

raid1_07

I only use Primary partitions here but you can use primary or Logical/Extended, it makes little difference for this example.

raid1_08

Put is at the beginning of the free disk space or not your choice.

 

raid1_09

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.

 

raid1_10

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.

 

raid1_11

 

raid1_12

For the swap partition use all the remaining disk space about 2GB. again set use as to bephysical volume for RAID.

raid1_13

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.

 

raid1_14

Create the MD Devices

Now to setup our three RAID1 arrays, /dev/md[012]. 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.

raid1_15

Back at the main menu again and it should look similar to the following:

 

raid1_16

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.

 

raid1_17

Now setup the swap partition on RAID device #2, it’s a similar process to the /boot partition.

raid1_18

Overall it should look like this

 

raid1_29

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

  1. For safer side again install grub in sda and sdb

       # grub-install /dev/sda

       #grub-install /dev/sdb

  1.     b) Update the grub, if there is some issue with grub, update grub will show you the          message.

       # update-grub

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

#update-initramfs -u

 

For testing the raid setup follow the instruction given in the below link

https://www.howtoforge.com/replacing_hard_disks_in_a_raid1_array

 

    

 

Advertisements