mdadm软RAID

fdisk 分区时把成员盘ID改成fd

RAID:
1.mknod /dev/md1 b 9 1        # use it once by now
echo md1 >> /etc/udev/makedev.d/50-udev.nodes     # add device file
2.mdadm -Cv /dev/md1 -l5 -n3 -x1 /dev/sda{6,7,8,9}    # create RAID
mdadm /dev/md1 -f /dev/sda7 #test remove /dev/sda7    # 强删成员盘 测试
mdadm -D /dev/md1 cat /proc/mdstat      # 查看RAID状态
mdadm -R mdadm -S            # run and stop command
mdadm -Ds > /etc/mdadm.conf         # configuration
 
# make FS and auto mount at boot time
mkfs.ext3 /dev/md1
mkdir -p /media/md1
cat >> /etc/fstab <!
/dev/md1  /media/md1 ext3 defaults  0 0
!
mount -a
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
mdadm /dev/md0 -f /dev/sda9     # 模拟磁盘出错
mdadm /dev/md0 -r /dev/sda9     # 把出错的盘移除
mdadm /dev/md0 -a /dev/sda12     # 添加新的可用的盘
mdadm -D /dev/md0       # 可以看到正在修复
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
 
 

你可能感兴趣的:(职场,休闲,mdadm)