Archive

Posts Tagged ‘raid’

Boot Ubuntu from RAID

May 13th, 2016 No comments

I had lately setup RAID 5 (three 2TB disks) with i7 6700 + ASUS H170 MoBo + 32GB DDR4 RAM followed by installing Ubuntu 16.04 x64 on it.  The installation went very well with Kernel 4.4.0-21.  But, upon restart the installation was unable to move ahead as the Kernel was not able to read from the RAID device.

Basically, the issue is that the install kernel didn’t have the RAID drivers embedded within.  Upon digging for few hours, found one solution at http://ubuntuforums.org/showthread.php?t=2220063 , which didn’t work as is.  The following modification worked:

  1. Boot from Live DVD image, which would load the RAID drivers automatically allowing you to see the device correctly.
  2. Now mount the root partition. (say /mnt/root-partition)
  3. Edit /mnt/root-partition/etc/initramfs-tools/modules for adding drivers that should get embedded into Initialization RAM drive file System (initrd).
  4. Add the following list at the end of the modules file.  The list is generated using “lsmod|grep raid” during the live DVD session.
    1. dm_raid
      raid456
      async_raid6_recov
      async_memcpy
      async_pq
      async_xor
      async_tx
      id6_recov
      raid6_pq
      libcrc32c
  5. Run “mkinitramfs -r /mnt/root-partition -o /mnt/root-partition/boot/initrd.img-4.4.0-21-generic”
  6. Reboot the machine to see that RAID is being detected.
  7. Install dmraid (apt-get install dmraid), which would again fix the initrd image with necessary stuff.
  8. Now, my machine works smooth.

If nothing worked, get a small HDD to install the OS in it.  While booting the OS, you may load the drivers via /etc/rc.local and dmraid commands to activate the RAID device and mount it for use.

RAID Mayhem in Linux Mint 17.1 and Kubuntu 14

March 11th, 2015 No comments

I have a Quad-core machine that has 2+2 1TB disks configured in RAID 1+0 mode (mirror + stripe).  I am having a 64Gb SSD, on which I have the operating systems installed.  Recently, I wanted to install Linux Mint 17.1 on the SSD.  The installation went fine, but after rebooting the RAID device was not visible at all.  To overcome this problem, I had to do “dmraid -ay” to activate the RAID device in my machine.

Ok, now my RAID device is visible.  Went ahead to create /home and /data partitions, followed by updating the same in /etc/fstab for auto-mounting during boot-up.

To my surprise, the reboot failed saying /home is not ready.  Checked into recovery mode by punching in the root password and found that the RAID device has gone missing now.   Ran “dmraid -ay” again to activate the device; following by running “mount -a” make /home and /data partitions come alive.  Exited the recovery mode to complete the full booting.

Did some internet search for how to activate the RAID device on booting automatically.  It was awful that there are no direct methods to do so.   Infact, some people have advised about not rebooting the machine at all..  Funny!

Later, found a workaround, where the /etc/fstab entries were made “noauto”.  And RAID activation happening in /etc/rc.local.

/etc/rc.local

dmraid -ay
mount /home
mount /data

/etc/fstab

/dev/mapper/pdc_cjcdcdeide6    /home ext4    defaults,noauto     0   2
/dev/mapper/pdc_cjcdcdeide5    /data ext4    defaults,noauto     0   2

Moral: Never install the Operating System on a RAID device, as majority of the distributions don’t recognize them by default.  Interestingly, Fedora 21 recognized RAID during installation itself, but I ended up hating it, when I found “yum update” not working out of the box.