Xi6.org

Software RAID Ubuntu 9.04 Linux

by on Jul.16, 2009, under linux/ubuntu

Setting up software RAID is “fairly” easy. But first you must install the ALTERNATE installation CD for Ubuntu. (CentOS is pretty straight forward when you select “manual partitioning” in the GUI installer on the regular ISO).

Once you download and burn the alternate ubuntu ISO for your cpu architecture, boot it up on the machine you want to install. (Note: this will erase data on the drives, so make sure no external drives are connected, or any drives in the system you don’t want raided).

During the install, when you come to partitioning, select manual and delete the partitioning tables that currently exist on your drives so that each drive has “FREE SPACE” as the only option under the device.

I’m going to be setting up RAID5, which in my opinion is the best balance between performance and redundancy. (This box is going to be a media server / backup / desktop with three TB drives).

Now for my first device (HD) I’m setting up 3 partitions, (boot, root, and swap). I create the first primary partition of 100MB at the beginning of the drive and set the “use for RAID” where you might normally select ext3, boot, swap etc.  Also be sure to add the boot flag to this partition.

The second partition I setup as logical 6GB and “use for RAID” selected here as well. And the third I set the remainder as a primary partition and “use for RAID”.

I repeat these partitions on the remainder of the 2 drives so each of the 3 drives have identical partition tables.

Next we’re going to select “configure software RAID” that is at the top of the menu, and create a new MD (Multi Disk) device.

Keep in mind we have 3 partitions per disk, totalling 9. So we will have to create 3 MD devices in order to raid each partition.

Creating the first MD device we select RAID1 (mirroring) for the boot partition. This will allow the system to boot properly. (This single raid 1 is very important to our system functioning).

For number of active devices, we type in 3. And 0 spares. Selecting /dev/sda1, /dev/sdb1, and /dev/sdc1 in the device list.

We will repeat creating an MD for each “set” of partitions. (for a total of 3 times). But these subsequent partitions will be RAID5.

You will be presented with RAID MD devices showing up on the partition overview. This is when we will set these partitions to EXT3, SWAP etc…

The 100MB raid1 partition we will set up as EXT3 mounted at /boot. This raid1 will allow the system to boot and not throw a grub error 2 at us.

The 12GB raid partition will be set up as SWAP

And the 2TB partition will be set up as EXT3 mounted at root /

Once we have those set, we finish and write to partition table. It’ll format the drives, sync the arrays and install the OS.

After that’s all said and done it’ll want to reboot. And we’re finished!

:, , ,
5 comments for this entry:
  1. GRUB Error 2 Ubuntu 9.04 RAID - Xi6.org

    [...] – you’re presented with a system that cannot boot properly. In my case, I installed a RAID5 Array and was presented with a GRUB ERROR:2 on [...]

  2. Adam

    Is it best to switch off the BIOS RAID before doing this? I’m wondering if leaving it on impacts performance of the software RAID.

  3. swicknire

    If you choose to use the software raid (aka. kernel raid, os raid), you must turn off your bios raid (aka. fakeraid). Though “similar” in nature, they are two completely different raid solutions.

    Sometimes even if your raid is turned on in the bios, it may not be active or setup on your system. (You would have to set up an MD device in the mapper).

  4. Allan Marcus

    Hi,

    I found your posting very useful. If you were to do it again today, would you use this method, or would you have a fourth drive for the OS and swap, and have jsut one partition on each of the RAID5 drives?

    Thanks,

    Allan

  5. swicknire

    As far as using a single drive for the os/swap – it really comes down to personal preference. You can add software raided drives to an existing single disk system so that the data written to those drives is safe. But anything written to the single drive has no redundancy. Which may be fine for home use.

    If the single drive goes down, you would have to rebuild and re-configure your system from scratch in order to gain access to the data on your raided drives again. (Personally I’ve only ever had 3 drives fail in the last 10 years, 2 of which degraded/failed over time so I was able to back them up – one failed beyond hope the first time).

    I would personally stick to keeping the os with the raid to reduce any re-installation/configuration if the system was installed on a single non-raid disk. Although having a separate raid group for a single mount point/data does make it more portable if you were to move the disks to another system.

Leave a Reply

You must be logged in to post a comment.

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Visit our friends!

A few highly recommended friends...