Latest News

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, we appreciate your effort to comment and encourage us. Please do not post spam. All comments will be moderated before approval.

Techeia.com Designed by Templateism.com Copyright © 2014

Free Blogger Themes

Designed by Techeia.com Copyright © 2016

Powered by Blogger.