0% found this document useful (0 votes)
104 views16 pages

Raid

The document provides an overview of RAID configurations available in Linux, including RAID 0, 1, 4, and 5, detailing their minimum and maximum disk requirements, data handling methods, read/write speeds, and fault tolerance capabilities. It also includes commands for creating, managing, and troubleshooting RAID arrays using the 'mdadm' tool. Each RAID type is explained with examples of how data is distributed across the disks.

Uploaded by

ramana6n
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
104 views16 pages

Raid

The document provides an overview of RAID configurations available in Linux, including RAID 0, 1, 4, and 5, detailing their minimum and maximum disk requirements, data handling methods, read/write speeds, and fault tolerance capabilities. It also includes commands for creating, managing, and troubleshooting RAID arrays using the 'mdadm' tool. Each RAID type is explained with examples of how data is distributed across the disks.

Uploaded by

ramana6n
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

1

1
RAID s available in Linux

RAID 0 (striping without parity)

RAID 1 (disk mirroring)

RAID 4 (parity)

RAID 5 (disk striping with parity)

2
RAID 0

Minimum - 2 Hard Disks


Maximum - 32 Hard Disks
Data is written alternately and evenly to two or
more disks
Read & Write Speed is Fast
Fault Tolerance is not available

3
How RAID 0 works ?

123456
1
3 Disk 1
5
Meta Disk
2
4 Disk 2
6

root

4
RAID 1

Minimum - 2 Hard Disks

Maximum - 2 Hard Disks

Simultaneously data will be written to two


volumes on two different disks

Read Speed is Fast & Write Speed is Slow

Fault Tolerance is available

50% overhead

5
How RAID 1 works ?

123
1
2 Disk 1
3
Meta Disk
1
2 Disk 2
3

root

6
RAID 4

Minimum - 3 Hard Disks

Maximum - 32 Hard Disks

Data is written alternately and evenly to two or


more disks and a parity is only written on one
disk

Read & Write Speed is Fast

Fault Tolerance is available

7
How RAID 4 works ?

123456
1
3 Disk 1
5

2
4 DiskDisk
Meta 2
6

P=1&2
Disk
P=3& 4 3
P=5&6

root

8
RAID 5

Minimum - 3 Hard Disks

Maximum - 32 Hard Disks

Data is written alternately and evenly to two


disks and a parity is written on all disk

Read & Write Speed is Fast

Fault Tolerance is available

Also Known as Striped with parity

9
How RAID 5 works ?

123456
1
3 Disk 1
P=5&6

2
Disk
P = Meta
3& 2
4 Disk
5

P = 1+2
4 Disk 3
6

root

10

10
What will happen ?

New Disk

Disk
Generate
Data
Disk 22 Fails
Data
Generate
Fails
Recovered
Data
Data
Loss
Recovered
Data
Data
Loss

1
3 Disk 1
P=5&6

2
Meta Disk Disk
P=3& 4 2
5

P = 1+2
4 Disk 3
6

root

11

11
Steps

Create
Createmultiple
multiplepartitions
partitions
[root@comp1
[root@comp1~]#fdisk
~]#fdisk /dev/hda
/dev/hda

To
Toupdate
updatethe
the Kernel
Kernelwithout
withoutrestarting
restarting
[root@comp1 ~]#partprobe
[root@comp1 ~]#partprobe

12

12
RAID Commands

To
Toclub
cluball
allthe
theRAID
RAIDpartitions
partitionsin
into
toaasingle
singlearray
array
[root@comp1
[root@comp1~]#mdadm
~]#mdadm -C -C /dev/md0
/dev/md0 -n3 -n3 /dev/hda8
/dev/hda8
/dev/hda9
/dev/hda9 /dev/hda10
/dev/hda10 -l5 -l5

To
Todisplay
displayRAID
RAIDdevice
device
[root@comp1
[root@comp1~]#mdadm
~]#mdadm -D-D /dev/md0
/dev/md0

To
Toformat
formatRAID
RAIDdevice
device
[root@comp1 ~]#mkfs.ext3 /dev/md0
[root@comp1 ~]#mkfs.ext3 /dev/md0

13

13
RAID Commands

Create
CreateMount
MountPoint
Pointof
ofRAID
RAIDDevice
Device
[root@comp1 ~]#mkdir /raid
[root@comp1 ~]#mkdir /raid

Mount
Mountthe
theRaid
Raiddevice
device
[root@comp1
[root@comp1 ~]#mount /dev/md0 /raid
~]#mount /dev/md0 /raid
[root@comp1
[root@comp1~]#cd
~]#cd /raid
/raid

14

14
RAID Commands

To
Tomake
makeaapartition
partitionfaulty
faulty
[root@comp1
[root@comp1 ~]#mdadm -f /dev/md0 /dev/hda10
~]#mdadm -f /dev/md0 /dev/hda10

To
Toremove
removepartition
partitionfrom
fromRAID
RAIDarray
array
[root@comp1
[root@comp1~]#mdadm
~]#mdadm -r-r /dev/md0
/dev/md0 /dev/hda10
/dev/hda10

To
Toadd
addaanew
newdevice
deviceinto
intothe
theRAID
RAIDarray
array
[root@comp1 ~]#mdadm -a /dev/md0 /dev/hda11
[root@comp1 ~]#mdadm -a /dev/md0 /dev/hda11

15

15
RAID Commands

To
Tostop
stopthe
theRAID
RAID
[root@comp1
[root@comp1~]#mdadm
~]#mdadm -S
-S /dev/md0
/dev/md0

To
Toactivate
activateRAID
RAID
[root@comp1
[root@comp1~]#mdadm
~]#mdadm -A /dev/md0 /dev/hda8
-A /dev/md0 /dev/hda8
/dev/hda9
/dev/hda9 /dev/hda10
/dev/hda10

16

16

You might also like