Friday, January 1, 2021

Redundant Array of Independent Disks(RAID)

 

            Redundant Array of Independent Disks

RAID :-

It provides fault tolerance, load balancing using stripping, mirroring and parity concepts.
                                                     

Types of RAIDs available

Two types of RAIDs available.

Hardware RAID

It is depends on vendors and  it is also more expensive .

Software RAID

It does not depends on vendors and not expensive .Compared to Hardware RAID .
it is maintained by system administrator only.


                To configure RAID - 0 in Linux


To configure RAID - 0,

Requirement -  2 minimum disks

Partition id -    "fd".

Solution :-
Reading and writing is very fast. So, it produces high performance.

Problem :-
if one disk is failed we cannot recover the data. So, there is no redundancy and fault tolerance in RAID - 0.
For example if the data is A1, A2, A3, A4, A5 and A6,A7,A8

We have Two Disk  :Disk -1   is            /dev/sda
                                Disk - 2 is           /dev/sdc


root@server~#fdisk  -l    ( Check free space in disk)

root@server~#fdisk  /dev/sda   ( Chose disk  according to your system space)

root@server~#n     (Enter n for new disk)

root@server~#t      ( t used for choose your code lvm code is fd)

Note : You can use code 8e etc.


                      Configure  RAID - 0 using disk - 1 and disk - 2

root@server~
# mdadm -Cv       /dev/md0 -n 2 /dev/sda /dev/sdc   -l   0


To check the RAID - 0 is created or not :-
root@server~# cat /proc/mdstat

To create the ext4 file system on the RAID - 0

root@server~# mkfs.ext4 /dev/md0

RAID - 0 mount point

root@server~# mkdir /mnt/raid0
root@server~# mount /dev/md0 /mnt/raid0

See the details of the RAID - 0 partition
root@server~# mdadm -D /dev/md0

               Configure RAID - 1 in Linux

                                                      
To configure RAID - 1,
Required- minimum 2 disks
Partition id - "fd".

Solution :-
1.In this the same data will be written on 2 disks ie., exact copy on both the disks.
2.One disk is failed we can recover the data from another disk.
3.There is a high availability, redundancy and fault tolerance in RAID - 1.
Problem :-
In this writing speed is slow compared to RAID - 0.


For example if the data is 1, 2, 3, 4

We have Two Disk  :Disk -1   is            /dev/sda
                                Disk - 2 is           /dev/sdc


root@server~#fdisk  -l    ( Check free space in disk)

root@server~#fdisk  /dev/sdc   ( Chose disk  according to your system space)

root@server~#n     (Enter n for new disk)

root@server~#t      ( t used for choose your code lvm code is fd)

Note : You have to configure the disk as disk1 or you can use code 8e etc.

Create the RAID - 1 using disk - 1 and disk - 2

root@server~
# mdadm -Cv       /dev/md1 -n 2 /dev/sda /dev/sdc     -l    1

To check the RAID - 1 is created or not :-

root@server~# cat /proc/mdstat

To create the ext4 file system on the RAID - 1

root@server~# mkfs.ext4 /dev/md1

RAID - 1 mount point

root@server~# mkdir /mnt/raid1
root@server~# mount /dev/md1 /mnt/raid1

See the details of the RAID - 1 partition

root@server~# mdadm -D /dev/md1

                Configure RAID - 5 in Linux

  


To configure RAID - 5

Required Minimum 3 disks
Partition id - "fd".
1.In every disk approximately 25 - 30  % of space is reserved for parity.
2.Reading and writing is very fast. So, it produces high performance.
3.This is used Stripping with parity concept.

Solution :

One disk is failed we can recover the data using remaining two disks and parity.

Problem :

1.If two disks are failed, then we cannot recover the data.
2. There is no redundancy and fault tolerance in RAID - 5.


We have Two Disk  : Disk -1   is             /dev/sda
                                 Disk -2  is           /dev/sdc
                                    Disk -3  is           /dev/sdb

root@server~#fdisk  -l    ( Check free space in disk)

root@server~#fdisk  /dev/sdb   ( Chose disk  according to your system space)

root@server~#n     (Enter n for new disk)

root@server~#t      ( t used for choose your code lvm code is fd)

Note :You have to configure both disk and you can use code 8e etc.

Create the RAID - 5 using disk - 1 and disk - 2 and disk -3

root@server~
# mdadm -Cv       /dev/md5 -n 3 /dev/sda /dev/sdc /dev/sdb    -l    5

To check the RAID -5 is created or not :-

root@server~# cat /proc/mdstat

To create the ext4 file system on the RAID - 5

root@server~# mkfs.ext4 /dev/md5

RAID - 5 Mount point

root@server~# mkdir /mnt/raid5
root@server~# mount /dev/md5 /mnt/raid5

You can see the details of the RAID - 5 partition

root@server~# mdadm -D /dev/md5
 






No comments:

Post a Comment