megacli64做raid1

先卸载raid0的12块盘,再做raid1,其中下面的一行要确认

#megacli64 -PDList -aALL | egrep 'Enclosure Device ID|Slot Number'
#!/bin/bash
sed -i /nodiratime/d /etc/rc.local
echo "/dev/sdb               /data/slot0          xfs     defaults        0 0" >> /etc/fstab
echo "/dev/sdc               /data/slot1          xfs     defaults        0 0" >> /etc/fstab
echo "/dev/sdd               /data/slot2          xfs     defaults        0 0" >> /etc/fstab
echo "/dev/sde               /data/slot3          xfs     defaults        0 0" >> /etc/fstab
echo "/dev/sdf               /data/slot4          xfs     defaults        0 0" >> /etc/fstab
echo "/dev/sdg               /data/slot5          xfs     defaults        0 0" >> /etc/fstab
umount /dev/sdb
umount /dev/sdc
umount /dev/sdd
umount /dev/sde
umount /dev/sdf
umount /dev/sdg
umount /dev/sdh
umount /dev/sdi
umount /dev/sdj
umount /dev/sdk
umount /dev/sdl
umount /dev/sdm
####################
megacli64 -CfgLdDel -L1 -a0
megacli64 -CfgLdDel -L2 -a0
megacli64 -CfgLdDel -L3 -a0
megacli64 -CfgLdDel -L4 -a0
megacli64 -CfgLdDel -L5 -a0
megacli64 -CfgLdDel -L6 -a0
megacli64 -CfgLdDel -L7 -a0
megacli64 -CfgLdDel -L8 -a0
megacli64 -CfgLdDel -L9 -a0
megacli64 -CfgLdDel -L10 -a0
megacli64 -CfgLdDel -L11 -a0
megacli64 -CfgLdDel -L12 -a0
#megacli64 -CfgSpanAdd -r10 -Array0[0:0,0:1] -Array1[0:2,0:3] -Array2[0:4,0:5] -Array3[0:6,0:7] -Array4[0:8,0:9] -Array5[0:10,0:11] WB -strpsz1024 -a0
sleep 2
megacli64 -CfgLdAdd -r1 [32:0,32:1] WB -strpsz1024 -a0
megacli64 -CfgLdAdd -r1 [32:2,32:3] WB -strpsz1024 -a0
megacli64 -CfgLdAdd -r1 [32:4,32:5] WB -strpsz1024 -a0
megacli64 -CfgLdAdd -r1 [32:6,32:7] WB -strpsz1024 -a0
megacli64 -CfgLdAdd -r1 [32:8,32:9] WB -strpsz1024 -a0
megacli64 -CfgLdAdd -r1 [32:10,32:11] WB -strpsz1024 -a0
sleep 2
mkfs.xfs -f /dev/sdb
mkfs.xfs -f /dev/sdc
mkfs.xfs -f /dev/sdd
mkfs.xfs -f /dev/sde
mkfs.xfs -f /dev/sdf
mkfs.xfs -f /dev/sdg
sleep 2
rm -rf /data/
mkdir -p /data/slot{0..5}
mount /dev/sdb  /data/slot0
mount /dev/sdc  /data/slot1
mount /dev/sdd  /data/slot2
mount /dev/sde  /data/slot3
mount /dev/sdf  /data/slot4
mount /dev/sdg  /data/slot5

你可能感兴趣的:(megacli64做raid1)