You are on page 1of 2

What is RAID? RAID is redundant array of independend or inexpensive disks. It is mainly used for data protection.

It has following uses. 1. Data protection 2. Increasing performance Types of RAIDs: There are alot of levels of RAIDs. But the main levels are 1. Level 0 or Stiping 2. Level 1 or Mirroring 3. Level 5 or Striping + Parity Level 0: It is also known as striping. You know hard disk is a block device. Datas are read and written from/to it by blocks. Suppose we have data block as below 1011 Suppose each bit takes one cpu clocks for writing into a disk. Total, it will take 4 cpu clocks. With stripping: In striping we use "N" number of hard disks. RAID devides the data block by "N" and writes each part to each disk parallely as shown below. If we have 4 hard disks, It'll take only one cpu clock if we use Level 0 RAID. Best for where more writing take place than reading. But insecure as there is no recovery mechanisms. Level 1: Also known as Mirroring. One is the exact replica of other. Whatever writing to master disk will be written in to mirror disk also. Reading can be performed fro each disk simultaneously, thus increasing the read performance. But can be utilize only 50% of the total size. Level 5: It is a combination of striping and parity. Need atleast three harddisks. Both parity and data are distributed in all. If one hard disk fails, data on that can be regenerated by the data and parity information in the other two harddisks. ###RAID### Raid 5 :need 3 disks

Raid 0 :need 2 disks Raid 1 :need 2 disks first partition disks ***RAID 5*** #mdadm --create /dev/md0 --level=5 --raid-devices=3 /dev/sda{5,6,7} #mke2fs -j /dev/md0 #mkdir /raid5 #mount /dev/md0 /raid5 #vi /etc/fstab /dev/md0 /raid5 ext3 defaults 0 0 :wq #mount -a touch something in /raid5 and delete one of partitions of sda5,sda6,sda7 ***RAID 1*** #mdadm --create /dev/md0 --level=1 --raid-devices=2 /dev/sda{5,6} ***RAID 0*** #mdadm --create /dev/md0 --level=0 --raid-devices=2 /dev/sda{5,6} Stopping mdadm *Unmount the md0 before stopping mdadm #mdadm --stop /dev/md0

You might also like