HOWTO: Creating a Raid 5

Creating a Raid 5 with 5 hard drives

This walk through will assume that they are new drives that have no data on them.

1. The first thing that you have to do is create our partitions. Note that all the hard drives should be the same size. If they are not, the raid will base the size of drives on the smallest size. Here are the steps to follow.

a. Type 'fdisk /dev/sdb' enter. (your drives may very)
b. Type 'n' enter (new partition)
c. Type 'p' enter (primary)
d. Type '1' enter (partition number)
e. Hit enter (default starting cylinder)
f. Hit enter (default ending cylinder)
g. Type 't' enter (change partition type)
h. Type 'fd' enter (sets partition value)
i. Type 'w' enter (writes these changes to hard drive)

Repeat a - i for each hard drive. we are doing a raid 5 with 5 drives, so my starting drive was sdb and my finishing drive as sdf.

2. Now type 'cat /proc/mdstat/'
It should produce this result.

Personalities :
unused devices:

Type 'modprobe raid5' to load the raid5 personality

Now it should produce this result.

Personalities : [raid5]
unused devices:

3. We now have to create a raidtab file. enter the etc directory and type vi raidtab.

type the following lines in raidtab. Remember drives may be different.

raiddev /dev/md0
raid-level 5
nr-raid-disks-5
nr-spare-disks-0
parity-algorithim left-symmetric
persistent-superblock 1
chunk-size 32
device /dev/sdb1
raid-disk 0
device /dev/sdc1
raid-disk 1
device /dev/sdd1
raid-disk 2
device /dev/sde1
raid-disk 3
device /dev/sdf1
raid-disk 4

Type "esc" then ":wq"
and you should be back at prompt.

4. Type "mkraid /dev/md0" This sets up the new raid array.

5. You can check the status so far on the new array by typing "cat /proc/mdstat" again.

6. Now we need to create the file system. Type "mke2fs /dev/md0"

7. Mounting the array comes next. First we need to make the directory. Type "mkdir /mnt/raid5 (or whatever name you like) Then type mount -t ext2 /dev/md0 /mnt/raid5

That's it. We have created a raid 5 array with 5 drives.

Did this help or was it useful?? Are there errors??
Please post feed back so I can change them or know that I have helped.