The Technology Magazine.

Full width home advertisement

Android

Linux

Post Page Advertisement [Top]

How to manage RAID in Linux



MDADM
mdadm is a standard software tool to manage RAID in Linux.

to identify a faulty hard disk in a RAID, we can use the command

cat /proc/mdstat

if the raid array is good, we can see the string [UU] . If one of the Disk is failed or faulty, we can see [U_] or [_U]

to mark a disk in RAID as failed:

mdadm --manage /dev/md0 --fail /dev/sdb1

To remove a disk from RAID:

mdadm --manage /dev/md0 --remove /dev/sdb1

To remove the hard disk , we need to identify the failed hard disk physically.
Identifying using the serial number is easy and practical.

To identify the serial number of a hhard disk:

hdparm -I <device> | grep "Serial Number:"

To add a new hard disk to RAID:

a) copy the partition table from existing disk
sfdisk -d /dev/sda | sfdisk /dev/sdb

b) to list the partition table :
fdisk -l

c) add the nee hard disk to RAID:
mdadm --manage /dev/md0 --add /dev/sdb1

d) verify the status of the RAID
cat /proc/mdstat


No comments:

Post a Comment

Dear visitor,
Please do not post spam. All comments will be moderated before approval.

Bottom Ad [Post Page]

| Designed by Techeia.com