Mint on Bootable Raid0

Questions about Grub, UEFI,the liveCD and the installer
Forum rules
Before you post please read how to get help
Post Reply
LeBoy
Level 1
Level 1
Posts: 29
Joined: Mon Sep 14, 2015 2:26 pm

Mint on Bootable Raid0

Post by LeBoy » Fri Nov 06, 2015 11:09 am

Since documentation on this is so scarce and fragmented I decided to start my own thread. Hopefully this will end up in an post with straightforward instructions that anyone can follow.

Objective: Install Linux Mint 17.2 on a SSD Raid0 array that the system can boot up from.

Hard facts I gathered from several sources across the Internet:
  • Linux OS don’t have proper support for hardware Raid. Therefore all attempts to use BIOS Raid arrays are unanimously discouraged.
  • Software Raid solutions seem to be the only available alternatives – mdadm, dmraid
  • The complication with software Raid is that, in order to boot from it, the necessary software has to be loaded first so that the bootable partition is visible. This brings a chicken-egg dilemma and it is the main challenge of this setup.
My approach: Most instructions I found so far use a small separate bootable partition in the each of your Raid disks to install GRUB together with the necessary Raid software. The system would then boot from this small partition; load the Raid software; find the Raid partition; and start Linux normally from there. However since this involves too many steps and quite a lot of terminal commands knowledge I decided to try a different approach that requires almost no terminal commands typing. All you would need is a motherboard that supports booting from a USB stick and spare USB stick. The idea is:
  • 1. Install Linux normally in a small and inexpensive USB stick together with all appropriate Raid drivers.
    2. Clone this USB installation to a Raid0 partition using a Live CD.
    3. Use the USB as a boot device and load Linux from the Raid partition.
I’m currently testing this solution and I’ll post the results here soon. Feedback, ideas, criticism, etc. are highly appreciated.

------------------------
Mobo: MSI X99S MPower
CPU: Intel Core i7-5960X
RAM: 32GB DDR4
Storage: 2x SanDisk Ultra II 120GB SATA
------------------------

LeBoy
Level 1
Level 1
Posts: 29
Joined: Mon Sep 14, 2015 2:26 pm

Re: Mint on Bootable Raid0

Post by LeBoy » Mon Nov 09, 2015 1:38 pm

Mission accomplished! Here are the detailed instruction as promised:

NOTE 1: Be aware that this setup uses an extra spare USB stick as bridge to load the OS. This USB stick should always be connected the PC afterwards. In case you don't want to use a spare USB stick as intermediate bootloader please don't read any further.
NOTE 2: I assume you know how to change your BIOS setting to boot from different devices when needed. I also assume you have a concept for your raid setup as I won’t be including any information about this here. For my setup I used two SSD's in raid 0 but I trust the instructions would also work with any other type of raid (0, 1, 5 or 10)

What you will need:
  • Linux Mint LiveCD media (CD/DVD or USB stick)
  • A spare USB stick (8GB recommended) that will be always connected to the PC afterwards
  • A motherboard capable of booting from USB sticks
  • Any number of storage devices for your raid array
=============================================

Step 1. Insert the spare USB stick into a free USB port

Step 2. Insert LiveCD media and boot from it

Step 3. LiveCD:> Install Mint in the spare USB stick normally
  • The instructions for this step are pretty much up to you. You can run a standard automatic installation or choose to set up any number of partitions as you like (root, home, swap, etc.) The only important thing is to install the bootloader in the spare USB drive as well.
Step 4. Restart and boot from the spare USB stick containing the newly installed system

Step 5. Spare USB:> Install mdadm
  • Open the Software Manager, search for "mdadm", find the package and install
Step 6. Spare USB:> Update grub
  • Open terminal and type:

    Code: Select all

    sudo update-grub
[/i]Step 7. Restart and boot again from LiveCD

Step 8. LiveCD:> Using the Disks application format each of your raid disks using a single partition (ext4)
  • Select your raid drive and create a partition
    Format the partition using ext4
    Repeat the same for each of your raid drives
Step 9. LiveCD:> Install mdadm
  • Open the Software Manager, search for "mdadm", find the package and install
Step 10. LiveCD:> Use mdadm to create your raid array
  • Here are instructions how to create raid arrays using mdadm according to your specific needs: http://linux.die.net/man/8/mdadm
    To create a raid0 of two drives I used:

    Code: Select all

    sudo mdadm --create dev/md0 --level=0 --raid-devices=2 dev/sd[XY]
    Where X and Y are the respective letters of my raid drives
[/i]Step 11. LiveCD:> Using the Gparted application clone the spare USB partition into the newly create raid partition:
  • Select the partition in your spare USB stick, unmount it if necessary, and copy it
    Select the raid partition (md0), create Partition Table, and paste the copied partition
    The next dialog box shows the size of the copied partition into the new drive.
    Drag the sizable partition box to a desirable size. In my case I used the entire raid available space
    Confirm the operation and apply it
Step 12. Remove LiveCD media

Step 13. Restart and set your BIOS to boot primarily from the spare USB stick

Step 14. Restart and enjoy Mint on raid :-)
=============================================

With the steps above we installed a raid-capable GRUB (bootloader) in the spare USB stick and tricked it into loading the Mint installation contained in the cloned partition. Note that the cloned partition resides in both the spare USB stick and the raid partition with the same UUID number (cloned). In my system the raid partition is always loaded first and the one in the spare USB is always skipped. If for some reason your system loads the Mint installation in the spare USB instead you can fix that by changing the UUID of that partition. This can be done from the LiveCD with the following terminal command:

Code: Select all

sudo tune2fs -U random /dev/sdX
Where X is the drive letter of your spare USB stick.

I am particularly happy with this solution because I can now use the spare USB stick as an extra security "dongle" that I can easily take with me when I go on holidays and render the PC unbootable.

@power users: I am aware that one can probably accomplish the same results by manipulating the GRUB installation directly. However I must admit that the GRUB2 editing options are somehow too complicated for me. I tried that approach in the beginning but after two days of researching and a couple of failed attempts I decided to go for the easy cloning trick. However if you feel like offering feedback to simplify the procedure above it will be highly appreciate :-)

Post Reply

Return to “Installation & Boot”