Friday, October 10, 2014

LinuxMint 17 installation RAID root device

To summarize you can't install LinuxMint 17, to a hard disk where / and /boot are on RAID devices, using the live disk. I believe the problem is also there in Ubuntu which is where it has inherited the issue.

This would manifest itself when the installer will complain about grub not able to install the bootloader and then the installer would crash if you bypassed grub installation.

You would imagine you can solve this by letting the installer quit and then chroot into the new installation and then running grub-install manually but you would be out of luck. While trying out manually you would see errors with grub-probe not recognizing md devices and expecting only physical disks like [hfc]d[0..9].

So what is wrong with the picture ?
Two things actually - at least for LinuxMint 17.
  1. Default installer/live disk doesn't come with mdadm installed - easily fixed by running apt-get.
  2. grub isn't the latest or greatest

Solution
  1. Make sure mdadm is installed and raid devices are assembled before starting the installer. No you don't have to recreate your RAID device and neither do you have to format your partitions unless it is the root device. Somehow sudo mdadm created different raid device  numbers instead of sudo bash and then mdadm - this shouldn't change the installation in anyway.
  2. Continue till the end - including skipping grub installation and then letting the installer crash.
  3. Write down your nameserver from /etc/resolv.conf if you don't know it already
  4. Open a terminal and switch to root - or sudo every command I don't care :)
  5. Switch to your installation media mount point and mount the following folders
    mount -t proc proc proc/
    mount -t sysfs sys sys/
    mount -o bind /dev dev/
  6. chroot <your installation media mount point>
  7. Add your DNS server to /etc/resolv.conf
  8. apt-get install mdadm grub2
  9. Sit back and enjoy while it fixes everything for you :)

[RANT]
This is a modern OS with known technologies working internally - why I am chrooting and apt-getting to do basic installation on a RAID device ? This problem doesn't exist on Fedora 20 - I shouldn't be aware of anything different to be done.