X

Rate Us :



Share with Friends :

Menu

Redundant Array of Inexpensive Disks(RAID) :

RAID (originally, Redundant Array of Inexpensive Disks, now commonly Redundant Array of Independent Disks) is a technology that employs the simultaneous use of two or more partitions on the same or different hard disk drives to achieve greater level of performance and reliability.

It is a fault tolerance mechanism in which the data is not lost even if one of the disk fails.


X

fault tolerance :

Fault tolerance is the property that enables a system to continue operating properly in the event of the failure of (or one or more faults within) some of its components.

X

Overhead:

Overhead or overhead expense refers to an ongoing expense of operating something.

Type of RAID :


  • Hardware RAID




  • Software RAID




RAID Levels used for Linux/Unix :


  • RAID 0 [striping, without mirroring or parity]




  • RAID 1 [data mirroring, without parity or striping]




  • RAID 4 [block-level striping with dedicated parity]




  • RAID 5 [block-level striping with distributed parity]




RAID 0 :


  • It require minimum two hard disks.

  • It can support maximum 32 hard disk.

  • Data is written simultaneously and evenly across the multiple hard disks.

  • The reading and writing speed is fast.

  • Fault tolerance is not available.


RAID 1 :


  • It works with only two hard disks.

  • Same data is simultaneously written on both the disk.

  • The reading speed is fast and writing speed is slow.

  • Fault tolerance is available.

  • Overhead is 50%.


RAID 4 :


  • It require minimum three hard disks.

  • It can support maximum 32 hard disks.

  • One of the disk is reserved for parity.

  • Data is written simultaneously and evenly across the remaining disks.

  • The reading and writing speed is fast.

  • Fault tolerance is available.

  • Overhead one hard disk.


RAID 5 :


  • It require minimum three hard disk.

  • It can support maximum 32 hard disks.

  • Data is written simultaneously and evenly across multiple hard disks.

  • The parity is written equally on all the disks.

  • The reading and writing speed is fast.

  • Fault tolerance is available.


  • Configure RAID :


    Create four partition with 100MB size - [root@localhost~]#fdisk /dev/sda Command (m for help): n First cylinder (3634-3917, default 3634): [Enter] (To avoid giving size of partition in cylinder) Last cylinder, +cylinders or +size{K,L,M}{3634-3917, default 3917}: +100MB Command (m for help): p [lets say we already have 10 partition available so, the new partition will be /dev/sda11]


    Command (m for help): n First cylinder (3634-3917, default 3634): [Enter] (To avoid giving size of partition in cylinder) Last cylinder, +cylinders or +size{K,L,M}{3634-3917, default 3917}: +100MB Command (m for help): p [lets say we already have 11 partition available so, the new partition will be /dev/sda12]
    Command (m for help): n First cylinder (3634-3917, default 3634): [Enter] (To avoid giving size of partition in cylinder) Last cylinder, +cylinders or +size{K,L,M}{3634-3917, default 3917}: +100MB Command (m for help): p [lets say we already have 12 partition available so, the new partition will be /dev/sda13]
    Command (m for help): n First cylinder (3634-3917, default 3634): [Enter] (To avoid giving size of partition in cylinder) Last cylinder, +cylinders or +size{K,L,M}{3634-3917, default 3917}: +100MB Command (m for help): p [lets say we already have 13 partition available so, the new partition will be /dev/sda14] Command (m for help): w
    To update new partition table without restarting the OS - [root@localhost~]#partprobe /dev/sda [for CentOS 7 or RHEL 7] [root@localhost~]#partx -a /dev/sda [for CentOS 6 or RHEL 6] Create meta disk - [root@localhost~]#mdadm -C /dev/md0 -n<Number_of_partitions> <partition 1> <partition 2> <partition 3>...<partition n> -l<level> Example : [root@localhost~]#mdadm -C /dev/md0 -n3 /dev/sda{11,12,13} -l5 Format the meta disk - [root@localhost~]#mkfs.ext4 /dev/md0 Create a directory - [root@localhost~]#mkdir /dir1 Mount the meta disk - [root@localhost~]#mount /dev/md0 /dir1 Store the data in meta disk - [root@localhost~]#touch /dir1/file{1..10} To check meta disk status - [root@localhost~]#mdadm -D /dev/md0 Active - 3 Working - 3 Failed - 0 Spare - 0 Add a spare(additional) device to meta disk - [root@localhost~]#mdadm -a /dev/md0 /dev/sda14 Active - 3 Working - 4 Failed - 0 Spare - 1 To make a faulty disk in meta disk - [root@localhost~]#mdadm -f /dev/md0 /dev/sda11 Active - 3 Working - 3 Failed - 1 Spare - 0 Remove failed device - [root@localhost~]#mdadm -r /dev/md0 /dev/sda11 Active - 3 Working - 3 Failed - 0 Spare - 0 To stop the meta disk - [root@localhost~]#unmount /dir1 [root@localhost~]#mdadm -S /dev/md0 To reactive the meta disk - [root@localhost~]#mdadm -A /dev/md0 /dev/sda{12,13,14} Mount the meta disk - [root@localhost~]#mount /dev/md0 /dir1 Check the data - [root@localhost~]#ls /dir1