Install Ubuntu With Software RAID 10
Install Ubuntu With Software RAID 10The Ubuntu Live CD installer doesn't support software RAID, and the server and alternate CDs only allow you to do RAID levels 0, 1, and 5. Raid 10 is the fastest RAID level that also has good redundancy too. So I was disappointed that Ubuntu didn't have it as a option for my new file server. I didn't want shell out lots of money for a RAID controller, especially since benchmarks show little performance benefit using a Hardware controller configured for RAID 10 in a file server.
1 Before you startI'll asume you have already known about RAID 10, but I'll cover a some important information before you begin.
2 Prepare your disksUse a partition program that can create RAID partitions, I use cfdisk which is text based but easier to use than fdisk. Partition your disks, make a 50 MB partition on the first drive, this is for /boot since grub doesn't support RAID well. Set up a partition on four drives to be RAID type, in cfdisk choose FD as the type. In my setup all of the system besides /boot will reside in one RAID 10 volume. For best swap performance put a swap partition on each drive. I put a one GB swap on each drive. Boot the Ubuntu Live CD. Run the Terminal.
sudo su
cfdisk /dev/sdb
The next two drives are partitioned the same as /dev/sdb:
cfdisk /dev/sdc 3 Install RAID utility, mdadm, and set up the RAID array
apt-get install mdadm Then create the file system on the RAID array. Format it now because the partitioner in the installer doesn't know how to modify or format RAID arrays. I used XFS file system, because XFS has great large file performance. Then you will create an alias for the RAID array with the link command because the Ubuntu installer won't find devices starting with "md".
mkfs.xfs /dev/md0
4 Ubuntu InstallRun the installer, when you are in the partitioner choose manual and be careful not to modify the partition layout. For the /dev/sda1 partition choose ext3 as the file system and set /boot on. Set your swap partitions to be used as swap. You select the type of file system you already formatted the RAID device and set the mount point. Do not choose to reformat or make partition table changes to the RAID array, because the partitioner will misconfigure it. Click continue on the warning about the RAID not being marked for formatting.
When the installer finishes tell it to continue to use the Live CD.
5 Install RAID support inside the new installA default Ubuntu setup won't automatically boot into a software RAID setup, you will need to chroot into the new install and have the chroot configured to see all the device information available in the LiveCD environment so that the mdadm install scripts can properly set up config and boot files for RAID support.
mkdir /myraid You can now reboot into your new system.
Extra commands you may needA helpful command that will tell you the status of the RAID and which partitions belong to a volume: cat /proc/mdstat If you reboot into the Live CD and want to mount your RAID array you will need to install mdadm in the Live CD environment and activate the RAID:
sudo su
If you need to start over or remove the RAID arraySoftware RAID information is embedded in a place on each RAID partition called the superblock. If you decide to change your RAID setup and start over, you can't just repartition and try to recreate the RAID array. You will need to erase the superblock first on each partition belonging to the RAID array you want to remove. Make sure your important data has been backed up before doing these steps. First we will make sure RAID is unmounted and stopped.
sudo su
|




Recent comments
1 day 12 hours ago
1 day 17 hours ago
1 day 17 hours ago
1 day 18 hours ago
1 day 19 hours ago
2 days 7 hours ago
2 days 20 hours ago
2 days 23 hours ago
3 days 40 min ago
3 days 19 hours ago