Software Raid (0) Step by Step
Purpose: I have found many tutorials on Linux software RAID, however the steps I used to achieve this were not documented in any thread or post that i could find. I felt that these steps were worthy of documentation with the purpose of helping others users like me who are trying to get software RAID working in linux.
Before you begin:
- This process will wipe any data that exists on the hard drives. If you have data on these devices, back it up before beginning this procedure.
- Also, it is preferred that the hard disks are the same size for this.
Detailed Steps:
- Install your hard drives
Install the hard drives you want to RAID. In this tutorial I am creating a RAID which uses 4 hard drives in a RAID 0 Stripe.- Download and Burn the Alternate Ubuntu install CD
Download the alternate installer from http://www.ubuntu.com/desktop/get-ub...ative-download. For example: I choose the link for ubuntu-10.10-alternate-amd64.iso.torrent because I wanted a 64 bit install. Burn this image to a CD or DVD with brassero(ubuntu) or imgburn (windows). Mac users can use the built in disk utility to burn the image.- Boot to the installer CD and select the Install option from the menu
- Select Manual Partitioning
When you arrive at the Partition Disks menu option, select Manual Partitioning.- Delete any existing partition on the disks
This step will remove any data that existed on the disks. Select each partition that exist on all the disks and select the delete partition option. All disks should be completely clear before continuing to the next step- Create the /Boot Partition on the first disk
Select the first disk's free space. The first drive is usually labeled SDA(SATA). Select the Create Partition option. Set the size of the partition to 0.5gb. Partition it as EXT4 and assign it to /boot. Return to the main partitioning menu.- Create the primary RAID partitions on each drive
- For each drive in the RAID create the primary partition. Select the remaining free space on the first drive and select create partition.
- For the size of the partition you'll want to leave some space at the end of the partition for the swap.
Here is an example of how to figure out how much space:
Size of the remaining free space=245gb
Size of memory (typically swap is the same size as the memory)= 8gb
Number of hard drives in the array=4
So we want 8 total GB of swap accross 4 hard drives. Each drive will need 2gb for swap (8/4=2). For this example 245gb-2gb is 243gb.
- Set the total space of this partition to 243 in this example, set it as a primary partition, and format it as ext4.
- Select each drive and repeat this process.
- Partition the Swap space on each drive
- Select each drive's remaining free space to create the swap partitions.
-Select create partition, use the remaining space (it will default to this), set it to a primary partition and select swap as the type.
-Perform this for each Drive that will be in the RAID array.
When you are finished the partition situation will look like this:
SDA
SDA1 Primary 0.5gb /boot ext4SDA2 Primary 243gb nomountpoint ext4SDA3 Primary 2gb SwapSDB
SDB1 Primary 243.5 nomountpoint ext4SDB2 Primary 2gb SwapSDC
SDC1 Primary 243.5 nomountpoint ext4SDC2 Primary 2gb SwapSDD
SDD1 Primary 243.5 nomountpoint ext4SDD2 Primary 2gb Swap- Create the root RAID Array
- Select the Configure Software RAID option from the partitioning menu.
- Select Create New MD Device and set it as RAID 0
- Select the SDA2, SDB1, SDC1, SDD1 partitions. If your partition numbers are different this is ok. You want to select the large partitions from each drive here.
- Finish creating the RAID.
- Select the raid (MD0) and select create partition
- Use all of the space and set it to a Primary partition.
- Format it as EXT4 and use it as / (root)- Create the Swap RAID
- Select the Configure Software RAID option from the partitioning menu.
- Select Create New MD Device and set it as RAID 0
- Select the SDA3, SDB2, SDC2, SDD2 partitions. If your partition numbers are different this is ok. You want to select the small partitions you made for the swap.
- Finish creating the RAID.
- Select the RAID (MD1) and select create partition.
- Use all of the space and set it to a Primary partition.
- Make sure it is formatted as Swap and use it as Swap.
Congratulations you have created the software RAID! Finish the ubuntu installer as normal by entering your username other information. Reboot to test your new software RAID.
Ref: https://help.ubuntu.com/community/In...n/SoftwareRAID
Ref: http://www.ubuntu.com/desktop/get-ub...ative-download
Bookmarks