Tuesday, March 18, 2014

How to create Raid file system in Linux ?

How to create a RAID volume 1  ?

syntax :- mdadm --create  <raid devicename>  --level=<raid level>  <devises>

for ex :- mdadm --create /dev/md1  --level=1 --raid-devices=2  /dev/sdb1 /dev/sdb2

TO get details of raid device ?

mdadm--detail /dev/md1

TO check the current active raid device :- 

cat /proc/mdstat

To create a filesystem  ?

syntax :- mkfs -t xfs  <devicename>
for ex :- mkfs -t xfs  /dev/md1

How to add new disk to existing raid ?

syntax :- mdadm <existing raid device>  --add  <new device >

for ex :- mdadm /dev/md1  --add </dev/sdc>

to increase 

mdadm --grow --raid-devices=3 /dev/md1

fstab entries

/dev/md1 <mountpath> <filesystemtype> defaults 0 0