Raid partition step by step example and implementations – Part2

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

Advertisements
Posted 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

%d bloggers like this: