Ubuntu – How to setup Ubuntu on a Motherboard Raid, no alternate image


This is something that took me an extraordinary amount of time to iron out, and the literature is distributed over several websites. I also didn't like the idea of doing it through the alternate CD, as I thought software RAID (slightly) inferior to doing it through the BIOS. Also, only a select number of distros actually possess the alternate install iso, and the USB support for them is a little weak. Anyways, I thought I could write the step-by-step that worked for me.

1) Start by setting up the BIOS raid.

2) Boot into a live usb Ubuntu Distribution of your choice.

3) Open Gparted and partition the RAID as follows:

(i) 500 MB Ext partition for GRUB.

(ii) Ext partition with all remaining data.

(iii) A swap partition of equal size to your RAM.

*These statements are modifiable. For example, I setup a 4 GB swap partition since I have 16 GB of RAM, and have never actually seen it used but wanted to be safe. Also, of the 500 MB partition which is recommended uniformly across the interwebs, it currently only occupies about 75 MB.

4) Start the installer, and proceed as usual until it asks for the install option. Select "Something else" or "Advanced Options", depending on distribution, to open the built in partition manager. Select partition (i) created above and hit "change". Select Ext4 (or any Ext of your choice) Journalling System, format, and set it to "/boot". Similary, select partition (ii), hit "change", Ext4, format, and set it to "/". Then proceed with the installation.

5) Nearing the end of the install, it will tell you it failed to install grub at the current location, and ask you to relocate it. Use "Continue without a bootloader".

6) At the end it will ask you if you are ready to restart, or continue testing. Select the latter option.

7) Run the following commands in terminal:

sudo add-apt-repository ppa:yannubuntu/boot-repair

sudo apt-get update

sudo apt-get install -y boot-repair

8) Open Boot-Repair, which should find the $/boot$ partition created earlier, and hit the recommended repair option, follow the steps putting the necessary commands into terminal and it will tell you at the end that GRUB was repaired successfully. As a reference, 'https://help.ubuntu.com/community/Boot-Repair'.

9) Reboot into your new Ubuntu-ready-computer!

Hope this works, reply if you have any issue.

Best Answer

  • Software RAID (mdadm) is not inferior to BIOS RAID. You might need the latter in a multi-OS environment (dualboot with Windows), but other than that, mdadm is good.

    As for your installation method, I did the same, for Ubuntu 13.04 on LVM on LUKS on RAID-1. Create the partitions and set up the RAID, LUKS and LVM from the terminal. I had to do this w/o swap as for me, the installer would crash for swap on mdadm for some reason. I set up swap once the install was finished instead.

    The steps I took however differ from yours at point 7)/8). I never heard of boot-repair before. So my steps instead look like this:

    A) Chroot into your install.

    mount /dev/your/root /mnt
    mount /dev/your/boot /mnt/boot
    mount -o bind /dev /mnt/dev
    mount -o bind /dev/pts /mnt/dev/pts
    mount -o bind /proc /mnt/proc
    mount -o bind /sys /mnt/sys
    cp /etc/resolv.conf /mnt/etc
    chroot /mnt /bin/bash

    Now you have a chroot-shell in the Ubuntu you just installed.

    B) Install software necessary for the extra stuff you did. As well as the missing bootloader.

    apt-get install mdadm
    apt-get install cryptsetup
    apt-get install lvm2
    apt-get install grub2

    C) Set up your /etc/crypptab (only if you used some kind of encryption which wasn't set up by the installer)

    echo yourluks UUID=`cryptsetup luksUUID /dev/yourluksdev` none luks > /etc/crypttab

    D) Update initramfs

    update-initramfs -u -k all

    E) Install GRUB2 onto the RAID members

    grub-install /dev/sda
    grub-install /dev/sdb

    F) Sync & Reboot

    exit # chroot

    Note that there are some oddities after the install, at least for 13.04. In Unity there is a "Install RELEASE" button left over, so for whatever reason the installer installed the installer...? Other than that everything seems to be working fine though.

    So it's entirely possible (although probably not the recommended way) to use the regular Desktop CD for complex mdadm/luks/lvm setups.