First, check the mdadm status
cat /proc/mdstatus
then, run
lsblskto see the available drives ,and after choosing the drives to be part of RAID,let's say sda,sdb
sudo mdadm --create --verbose /dev/md0 --level=1 --raid-devices=2 /dev/sda /dev/sdbif one hard disk fail and you want to replace it, then you need to flag it as fail part of raid the remove it from the raid array:
mdadm --manage /dev/md1 --fail /dev/sdb2
then you can remove it from the raid array
mdadm --manage /dev/md1 --remove /dev/sdb2if you want to remove Raid1 : Check the Raid status -- these may will give you clear picture :
sudo mdadm --detail /dev/md0 and lsblk
Then stop and remove the Raid
mdadm --stop /dev/md0 mdadm --remove /dev/md0
tell the drive sda to forget about raid
sudo mdadm --zero-superblock /dev/sda/
if the system complain for being busy or such then
sudo dd if=/dev/zero of=/dev/sdafinally unmount the raid in the fstab file and comment it in the /etc/mdadm/mdadm.conf
No comments:
Post a Comment