Sunday, November 14, 2010

Implementing RAID (Redundant Array Inexpensive Disk)

Hi Guys,

Today i am going to show you a very very important concept of the system administration called RAID. It is a very important thing for any system administrator.

RAID is actually used for fault tolerance. So, it has a very significant value for data because data is very important for any organisation whether it is big or small. RAID can be implemented in 2 ways: Hardware RAID and Software RAID.

Hardware RAID is implemented through the disk controller of the system. Instruction for configuring hardware RAID differs from controller to controller. So refer your disk controller manual for implementation.

We will be discussing the software RAID. Software RAID is implemented through the operating system and uses some processor and memory resources.

Different RAID levels are available with software RAID, so you can decide one is best for your needs. Software RAID allows for RAID levels 0, 1, 5 and 6.

RAID level 0, or striping, means that data is written across all hard drives in the array to accomplish the fast disk performance. No redundancy is used, so the size of the logical RAID drive is equal to the size of all the hard drives in the array. Because there is no redundancy, recovering data from a hard drive crash is not possible through RAID.

RAID level 1, or mirroring, means that all data is written to each disk in the array, accomplishing redundancy. The data is “mirrored” on a second drive. This allows for easy recovery should a disk fail. However, it does mean that, for example, if there are two disks in the array, the size for the logical disk is size of the smaller of the two disks because data must be mirrored to the second disk.

RAID level 5, combines striping and parity. Data is written across all disks as in RAID 0, but parity data is also written to one of the disks. Should a hard drive failure occur, this parity data can be used to recover the data from the failed drive, including while the data is being accessed and the drive is still missing from the array.

RAID level 6, RAID level 6 is RAID level 5 with dual parity. Data is written across all disks as in RAID 5, but two sets of parity data is calculated. Performance is slightly worse than RAID 5 because the extra parity data must be calculated and written to disk. RAID 5 allows for recovery using the parity data if only one drive in the array fails. Because of the dual parity, RAID 6 allows for recovery from the failure of up to two drives in the array.

SETTING UP THE RAID DEVICES:

Using Software RAID:

1) First, create partitions for the RAID, using fdisk same as we did for the LVM and set their partition type ID to "fd".

2) Now, creating RAID device, I have created 3 paritions sda5,sda6,sda7:

# mdadm --create /dev/md0 --level=5 --raid-devices=3 /dev/sda{5,6,7}
or
# mdadm --C /dev/md0 --l=5 -n=3 /dev/sda{5,6,7}

Here, the word "create" has a parameter "/dev/md0" which is a device name i am creating for RAID. Then, with "level", i am specifying the level of the RAID, I am trying to implement. And "raid-devices" is the number of devices or the number or parallel logical disks.

3) Now check the RAID status:
# cat /proc/mdstat
and
# mdadm --details /dev/md0

4) Formatting RAID device:
# mkfs.ext3 /dev/md0

5) Creating mount point for the RAID device:
# mkdir /tmp/RAID5

6) Mounting RAID:
# mount -t ext3 /dev/md0 /tmp/RAID0
or make a entry in the file "/etc/fstab" for automounting

7) DONE...:)

Enjoy....backing up of data with RAID.....:)

No comments:

Post a Comment