RAID 100 – HOW TO CONFIGURE/DELETE RAID 100 IN LINUX

RAID stands for redundant array of independent disks.How the data is distributed between these drives depends on the RAID level used. RAID 100 has the benefit of two times raid 0 and raid 1(single ). Also known as RAID 1+0+0 .  RAID 100 is fast because Raid 0 distributes the data is striped across multiple disks  and secure because Raid 1 mirroring duplicates all your data.It requires 8 Harddisks .

 

RAID100 IN LINUX

HOW IT WORKS-

As you can see in diagram, RAID 100 is a combination of raid 1+0+0 . It always start from back means first raid 0 , again raid 0 then raid 1 .  Let data be 1 ,2, 3 , 4 , 5 , 6 , 7, 8 , 9 , 10 , 11 , 12 . At top it is Raid 0 and raid 0 is known for disk stripping , so data is stripped across both partitions . 1 , 3 , 5 , 7 , 9 , 11 goes to /dev/md1  and 2 ,4 , 6  , 8 , 10 , 12 goes to /dev/md2 . That’s why /dev/md0 ‘s size is 4000 MB , size of both /dev/md1 and /dev/md2 . Now data comes to /dev/md1 and /dev/md2 which is also raid 0 . Again data is stripped and it’s size is 2000MB . Then comes /dev/md3 , /dev/md4 , /dev/md5 , /dev/md6 , all are Raid 1 (mirroring of data) . Data which comes to Raid 1 equally distributes data to both harddisks so its size will be 1000MB because it can data from any one harddisk .

HOW TO CONFIGURE RAID100 IN LINUX

  • First create eight partitions . Make sure all partitions size is same .
[root@localhost ~]# fdisk /dev/sda
The number of cylinders for this disk is set to 65399.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
   (e.g., DOS FDISK, OS/2 FDISK)

Command (m for help): n
Command action
   l   logical (5 or over)
   p   primary partition (1-4)
l
First cylinder (57368-65399, default 57368):
Using default value 57368
Last cylinder or +size or +sizeM or +sizeK (57368-65399, default 65399): +1000M

Command (m for help): n
Command action
   l   logical (5 or over)
   p   primary partition (1-4)
l
First cylinder (57491-65399, default 57491):
Using default value 57491
Last cylinder or +size or +sizeM or +sizeK (57491-65399, default 65399): +1000M

Command (m for help): n
Command action
   l   logical (5 or over)
   p   primary partition (1-4)
l
First cylinder (57614-65399, default 57614):
Using default value 57614
Last cylinder or +size or +sizeM or +sizeK (57614-65399, default 65399): +1000M

Command (m for help): n
Command action
   l   logical (5 or over)
   p   primary partition (1-4)
l
First cylinder (57737-65399, default 57737):
Using default value 57737
Last cylinder or +size or +sizeM or +sizeK (57737-65399, default 65399): +1000M

Command (m for help): n
Command action
   l   logical (5 or over)
   p   primary partition (1-4)
l
First cylinder (57860-65399, default 57860):
Using default value 57860
Last cylinder or +size or +sizeM or +sizeK (57860-65399, default 65399): +1000M

Command (m for help): n
Command action
   l   logical (5 or over)
   p   primary partition (1-4)
l
First cylinder (57983-65399, default 57983):
Using default value 57983
Last cylinder or +size or +sizeM or +sizeK (57983-65399, default 65399): +1000M
Command (m for help): n
Command action
   l   logical (5 or over)
   p   primary partition (1-4)
l
First cylinder (58106-65399, default 58106):
Using default value 58106
Last cylinder or +size or +sizeM or +sizeK (58106-65399, default 65399): +1000M

Command (m for help): n
Command action
   l   logical (5 or over)
   p   primary partition (1-4)
l
First cylinder (58229-65399, default 58229):
Using default value 58229
Last cylinder or +size or +sizeM or +sizeK (58229-65399, default 65399): +1000M
  • To make use of these partitions we have to change its types .
  • Command  t  ( to change partition type )
  • Give partition number which you want to change its type
  • Hex code  –  fd  (  Linux raid )
Command (m for help): t
Partition number (1-12): 12
Hex code (type L to list codes): fd
Changed system type of partition 12 to fd (Linux raid autodetect)

Command (m for help): t
Partition number (1-12): 11
Hex code (type L to list codes): fd
Changed system type of partition 11 to fd (Linux raid autodetect)
Command (m for help): t
Partition number (1-10): 10
Hex code (type L to list codes): fd
Changed system type of partition 10 to fd (Linux raid autodetect)

Command (m for help): t
Partition number (1-10): 9
Hex code (type L to list codes): fd
Changed system type of partition 9 to fd (Linux raid autodetect)

Command (m for help): t
Partition number (1-10): 8
Hex code (type L to list codes): fd
Changed system type of partition 8 to fd (Linux raid autodetect)

Command (m for help): t
Partition number (1-10): 7
Hex code (type L to list codes): fd
Changed system type of partition 7 to fd (Linux raid autodetect)

Command (m for help): t
Partition number (1-10): 6
Hex code (type L to list codes): fd
Changed system type of partition 6 to fd (Linux raid autodetect)

Command (m for help): t
Partition number (1-10): 5
Hex code (type L to list codes): fd
Changed system type of partition 5 to fd (Linux raid autodetect)
  • Command p  ( to print partition you have and its type )
Command (m for help): p
Disk /dev/sda: 537.9 GB, 537932857344 bytes
255 heads, 63 sectors/track, 65399 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1       50993   409601241   83  Linux
/dev/sda2           50994       57367    51199155   82  Linux swap / Solaris
/dev/sda4           57368       65399    64517040    5  Extended
/dev/sda5           57368       57490      987966   fd  Linux raid autodetect
/dev/sda6           57491       57613      987966   fd  Linux raid autodetect
/dev/sda7           57614       57736      987966   fd  Linux raid autodetect
/dev/sda8           57737       57859      987966   fd  Linux raid autodetect
/dev/sda9           57860       57982      987966   fd  Linux raid autodetect
/dev/sda10          57983       58105      987966   fd  Linux raid autodetect
/dev/sda11          58106       58228      987966   fd  Linux raid autodetect
/dev/sda12          58229       58351      987966   fd  Linux raid autodetect
  • Type command w  ( to save all changes )
  • Don’t forget to run partprobe command to save all changes you made .
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
The kernel still uses the old table.
The new table will be used at the next reboot.
Syncing disks.
[root@localhost ~]# partprobe /dev/sda
  • Now again see diagram . We are going to create Raid from bottom .
  • First is /dev/md3. So after mdadm –create  give raid name you are going to create .
  • –level=1  means you want /dev/md3 to be raid 1 .
  • Then raid devices you want to add . For /dev/md3 i’m gonna add  sda5 and sda6 .
  • It might ask you “Continue creating array? ” Type yes and hit Enter .
[root@localhost ~]# mdadm --create /dev/md3 --level=1 --raid-devices=2 /dev/sda5 /dev/sda6
mdadm: /dev/sda5 appears to contain an ext2fs file system
    size=1975680K  mtime=Sat Jan 14 23:59:45 2017
mdadm: /dev/sda5 appears to be part of a raid array:
    level=raid0 devices=2 ctime=Sat Jan 14 23:58:08 2017
mdadm: /dev/sda6 appears to be part of a raid array:
    level=raid0 devices=2 ctime=Sat Jan 14 23:58:08 2017
Continue creating array? yes
mdadm: array /dev/md3 started.
  • Now create /dev/md4
  • level will be 1 (raid 1)
  • raid devices two which are sda7 and sda8
[root@localhost ~]# mdadm --create /dev/md4 --level=1 --raid-devices=2 /dev/sda7 /dev/sda8
mdadm: /dev/sda7 appears to be part of a raid array:
    level=raid1 devices=2 ctime=Sat Jan 14 23:27:45 2017
mdadm: /dev/sda8 appears to be part of a raid array:
    level=raid1 devices=2 ctime=Sat Jan 14 23:27:45 2017
Continue creating array? yes
mdadm: array /dev/md4 started.
  • Now create /dev/md5 including sda9 and sda10
  • level will be 1 (raid1)
[root@localhost ~]# mdadm --create /dev/md5 --level=1 --raid-devices=2 /dev/sda9 /dev/sda10
mdadm: array /dev/md5 started.
  • Create /dev/md6  including sda11 and sda12
  • level =1 (raid 1)
[root@localhost ~]# mdadm --create /dev/md6 --level=1 --raid-devices=2 /dev/sda11 /dev/sda12
mdadm: array /dev/md6 started.
  • First part done .
  • Check by cat  /proc/mdstat command whether your raid has been created or not .
[root@localhost ~]# cat /proc/mdstat
Personalities : [raid1]
md6 : active raid1 sda12[1] sda11[0]
      987840 blocks [2/2] [UU]
md5 : active raid1 sda10[1] sda9[0]
      987840 blocks [2/2] [UU]
md4 : active raid1 sda8[1] sda7[0]
      987840 blocks [2/2] [UU]
md3 : active raid1 sda6[1] sda5[0]
      987840 blocks [2/2] [UU]
unused devices: <none>
  • Now we have to create /dev/md1 including /dev/md3 and /dev/md4. So we will create raid over raid . ( See above diagram )
  • Here level will be 0 because we want it to be raid 0 .
  • In raid devices write md3 and md4 .
[root@localhost ~]# mdadm --create /dev/md1 --level=0 --raid-devices=2 /dev/md3 /dev/md4
mdadm: /dev/md3 appears to contain an ext2fs file system
    size=1975680K  mtime=Sat Jan 14 23:59:45 2017
mdadm: /dev/md3 appears to be part of a raid array:
    level=raid0 devices=2 ctime=Sat Jan 14 23:30:29 2017
mdadm: /dev/md4 appears to be part of a raid array:
    level=raid0 devices=2 ctime=Sat Jan 14 23:30:29 2017
Continue creating array? yes
mdadm: array /dev/md1 started.
  • Same Create /dev/md2 including md5 and md6
  • Here level will be 0 (raid 0)
[root@localhost ~]# mdadm --create /dev/md2 --level=0 --raid-devices=2 /dev/md5 /dev/md6
mdadm: array /dev/md2 started.
  • Above these two md1 and md2 , Now create /dev/md0
  • Level will be 0 ( raid0 )
  • raid devices will be /dev/md1 and /dev/md2
[root@localhost ~]# mdadm --create /dev/md0 --level=0 --raid-devices=2 /dev/md1 /dev/md2
mdadm: /dev/md1 appears to contain an ext2fs file system
    size=1975680K  mtime=Sat Jan 14 23:59:45 2017
Continue creating array? yes
mdadm: array /dev/md0 started.
  • Check by cat /proc/mdstat command whether raid is been created or not .
[root@localhost ~]# cat /proc/mdstat
Personalities : [raid1] [raid0]
md2 : active raid0 md6[1] md5[0]
      1975552 blocks 64k chunks
md1 : active raid0 md4[1] md3[0]
      1975552 blocks 64k chunks
md6 : active raid1 sda12[1] sda11[0]
      987840 blocks [2/2] [UU]
md5 : active raid1 sda10[1] sda9[0]
      987840 blocks [2/2] [UU]
md4 : active raid1 sda8[1] sda7[0]
      987840 blocks [2/2] [UU]
md3 : active raid1 sda6[1] sda5[0]
      987840 blocks [2/2] [UU]
md0 : active raid0 md2[1] md1[0]
      3950976 blocks 64k chunks
unused devices: <none>
  • Format /dev/md0 . ext3 defines  –  /dev/md0 is ext3 type .
[root@localhost ~]# mkfs.ext3 /dev/md0
mke2fs 1.39 (29-May-2006)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
494016 inodes, 987744 blocks
49387 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=1015021568
31 block groups
32768 blocks per group, 32768 fragments per group
15936 inodes per group
Superblock backups stored on blocks:
        32768, 98304, 163840, 229376, 294912, 819200, 884736
Writing inode tables: done
Creating journal (16384 blocks): done
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 26 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.
  • Now mount it to use it .  Deepit is my folder name
  • To mount type =  mount   raidname    folder name  .
  • Check by df  -h command
[root@localhost ~]# mount /dev/md0 Deepit
[root@localhost ~]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda1             379G  4.8G  355G   2% /
tmpfs                 947M     0  947M   0% /dev/shm
/dev/md0              3.8G   72M  3.5G   2% /root/Deepit
  • But that was temporary mounting it will be lost when yoour sytem restart .
  • For permanent mounting go to /etc/fstab
[root@localhost ~]# vim /etc/fstab
  • Now make entry as shown below Press i and enter to insert mode
  • First what you want to mount
  • Second where you want to mount
  • Third what’s the type
  • Rest will be same .
LABEL=/                 /                       ext3    defaults        1 1
tmpfs                   /dev/shm                tmpfs   defaults        0 0
devpts                  /dev/pts                devpts  gid=5,mode=620  0 0
sysfs                   /sys                    sysfs   defaults        0 0
proc                    /proc                   proc    defaults        0 0
LABEL=SWAP-sda2         swap                    swap    defaults        0 0
/dev/md0                /root/Deepit            ext3    defaults         0 0
  • Press Esc and :wq (to save and quit)
~
~
~
:wq

HOW TO REMOVE RAID100 FROM YOUR SYSTEM

  • Type umount    foldername   (to un mount )
  • Check by df -h command
[root@localhost ~]# umount Deepit
[root@localhost ~]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda1             379G  4.8G  355G   2% /
tmpfs                 947M     0  947M   0% /dev/shm
  • Now check which raid is active on your system by cat  /proc/mdstat command
[root@localhost ~]# cat /proc/mdstat
Personalities : [raid1] [raid0]
md2 : active raid0 md6[1] md5[0]
      1975552 blocks 64k chunks
md1 : active raid0 md4[1] md3[0]
      1975552 blocks 64k chunks
md6 : active raid1 sda12[1] sda11[0]
      987840 blocks [2/2] [UU]
md5 : active raid1 sda10[1] sda9[0]
      987840 blocks [2/2] [UU]
md4 : active raid1 sda8[1] sda7[0]
      987840 blocks [2/2] [UU]
md3 : active raid1 sda6[1] sda5[0]
      987840 blocks [2/2] [UU]
md0 : active raid0 md2[1] md1[0]
      3950976 blocks 64k chunks
unused devices: <none>
  • For removing raid start from top which is /dev/md0
  • Don’t start removing raid from bottom .
  • First stop raid then remove it .
  • To stop        =   mdadm  –stop   raidname
  • To remove  =    mdadm   –remove  raidname
[root@localhost ~]# mdadm --stop /dev/md0
mdadm: stopped /dev/md0
[root@localhost ~]# mdadm --remove /dev/md0
[root@localhost ~]# mdadm --stop /dev/md1
mdadm: stopped /dev/md1
[root@localhost ~]# mdadm --remove /dev/md1
[root@localhost ~]# mdadm --stop /dev/md2
mdadm: stopped /dev/md2
[root@localhost ~]# mdadm --remove /dev/md2
[root@localhost ~]# mdadm --stop /dev/md3
mdadm: stopped /dev/md3
[root@localhost ~]# mdadm --remove /dev/md3
[root@localhost ~]# mdadm --stop /dev/md4
mdadm: stopped /dev/md4
[root@localhost ~]# mdadm --remove /dev/md4
[root@localhost ~]# mdadm --stop /dev/md5
mdadm: stopped /dev/md5
[root@localhost ~]# mdadm --remove /dev/md5
[root@localhost ~]# mdadm --stop /dev/md6
mdadm: stopped /dev/md6
[root@localhost ~]# mdadm --remove /dev/md6
  • Check Raid is removed or not by cat   /proc/mdstat command
[root@localhost ~]# cat /proc/mdstat
Personalities : [raid1] [raid0]
unused devices: <none>
  • Now remove raid partitions
  • Command d ( to delete partition )
  • Command w  (to save  )
[root@localhost ~]# fdisk /dev/sda
The number of cylinders for this disk is set to 65399.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
   (e.g., DOS FDISK, OS/2 FDISK)

Command (m for help): d
Partition number (1-12): 12

Command (m for help): d
Partition number (1-11): 11

Command (m for help): d
Partition number (1-10): 10

Command (m for help): d
Partition number (1-9): 9

Command (m for help): d
Partition number (1-8): 8

Command (m for help): d
Partition number (1-7): 7

Command (m for help): d
Partition number (1-6): 6

Command (m for help): d
Partition number (1-5): 5

Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
The kernel still uses the old table.
The new table will be used at the next reboot.
Syncing disks.
  • After that run partprobe command to save all changes made .
  • fdisk  -l   command to check partitions  .
[root@localhost ~]# partprobe /dev/sda
[root@localhost ~]# fdisk -l
Disk /dev/sda: 537.9 GB, 537932857344 bytes
255 heads, 63 sectors/track, 65399 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1       50993   409601241   83  Linux
/dev/sda2           50994       57367    51199155   82  Linux swap / Solaris
/dev/sda4           57368       65399    64517040    5  Extended

 

WHAT’S Raid10 IN LINUX AND HOW TO CONFIGURE

KDE – HOW TO INSTALL KDE DESKTOP IN LINUX & GET START BUTTON (WINDOWS ) IN LINUX .

RAID01 . HOW TO CONFIGURE RAID 01 IN LINUX.

 

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s