Home » , , » Raid partition step by step example and implementations Part-II

Raid partition step by step example and implementations Part-II

Written By 1 on Saturday, February 5, 2011 | 12:19 PM

In our last article we created a raid device md0 from three hard disk partition. In this article we show you that how can you manage a raid device. This guide is the second part of our tutorial on raid devices if you have missed first part then read its first.
First verify all raid partition which we created in our pervious article are working properly and in active state.

#mdadm --detail /dev/md0

mdadm Linux commands
Alternately you can also use cat /proc/mdstat command to see run time status of raid device
raid devices linux
raid devices are mainly used for data backup. Data will be safe even if any hard disk get fail from raid devices. To test it first copy some data in /data directory which is the mount point of md0 raid devices.

#cp * /data
#ls /data
Now assume that one hard disk form raid device gets fail. This can be done by mdadm command with --fail options. Verify data it should be safe
mdam --fail
you can verify fail device status via mdadm commands with -- detail switch also

mdadm --detail
run time process can be checked via cat /proc/mdstat commands
cat /proc/mdstat
At this point you should have understand what exactly raid device do?. raid device keep your data safe even if hard disk got crashed. its give you enough time to replace faulty hard disk without losing data.
Now remove faulty devices.[ Note:- you must have to set fail status before removing it form raid devices ]
mdadm --remove
now replace faulty hard disk with good one. To add new disk in raid devices use --add options with mdadm commands
mdadm --add
Congratulations you have successful created raid device and changed faulty hard disk. We suggest you to clean these partition before doing further particular.

How to remove raid devices

First un-mount the raid partitions from /data directory
umount /data
Now stop /md0 devices and remove it form mdadm commands
mdadm --remove
Now remove entry form /etc/fstab
vi /etc/fstab
file /etc/fstab
use fdisk command to remove raid partition form hard disk
fdisk command with d options

0 Comment:

Post a Comment