先卸載raid的6塊盤,在做raid0,其中下面的一行要確認
#megacli64 -PDList -aALL | egrep 'Enclosure Device ID|Slot Number'
#!/bin/bash
#去除fstab
sed -i /data/d /etc/fstab
#卸載
umount /dev/sdb
umount /dev/sdc
umount /dev/sdd
umount /dev/sde
umount /dev/sdf
umount /dev/sdg
#刪除raid1
megacli64 -CfgLdDel -L1 -a0
megacli64 -CfgLdDel -L2 -a0
megacli64 -CfgLdDel -L3 -a0
megacli64 -CfgLdDel -L4 -a0
megacli64 -CfgLdDel -L5 -a0
megacli64 -CfgLdDel -L6 -a0
#單盤raid0
megacli64 -CfgLdAdd -r0[0:4] -wb -strpsz1024 -a0
megacli64 -CfgLdAdd -r0[0:5] -wb -strpsz1024 -a0
megacli64 -CfgLdAdd -r0[0:6] -wb -strpsz1024 -a0
megacli64 -CfgLdAdd -r0[0:7] -wb -strpsz1024 -a0
megacli64 -CfgLdAdd -r0[0:8] -wb -strpsz1024 -a0
megacli64 -CfgLdAdd -r0[0:9] -wb -strpsz1024 -a0
megacli64 -CfgLdAdd -r0[0:10] -wb -strpsz1024 -a0
megacli64 -CfgLdAdd -r0[0:11] -wb -strpsz1024 -a0
megacli64 -CfgLdAdd -r0[0:12] -wb -strpsz1024 -a0
megacli64 -CfgLdAdd -r0[0:13] -wb -strpsz1024 -a0
megacli64 -CfgLdAdd -r0[0:14] -wb -strpsz1024 -a0
megacli64 -CfgLdAdd -r0[0:15] -wb -strpsz1024 -a0
#添加rc.local
echo "/bin/mount -t xfs -o defaults,noatime,nodiratime /dev/sdb /data/slot0" >> /etc/rc.local
echo "/bin/mount -t xfs -o defaults,noatime,nodiratime /dev/sdc /data/slot1" >> /etc/rc.local
echo "/bin/mount -t xfs -o defaults,noatime,nodiratime /dev/sdd /data/slot2" >> /etc/rc.local
echo "/bin/mount -t xfs -o defaults,noatime,nodiratime /dev/sde /data/slot3" >> /etc/rc.local
echo "/bin/mount -t xfs -o defaults,noatime,nodiratime /dev/sdf /data/slot4" >> /etc/rc.local
echo "/bin/mount -t xfs -o defaults,noatime,nodiratime /dev/sdg /data/slot5" >> /etc/rc.local
echo "/bin/mount -t xfs -o defaults,noatime,nodiratime /dev/sdh /data/slot6" >> /etc/rc.local
echo "/bin/mount -t xfs -o defaults,noatime,nodiratime /dev/sdi /data/slot7" >> /etc/rc.local
echo "/bin/mount -t xfs -o defaults,noatime,nodiratime /dev/sdj /data/slot8" >> /etc/rc.local
echo "/bin/mount -t xfs -o defaults,noatime,nodiratime /dev/sdk /data/slot9" >> /etc/rc.local
echo "/bin/mount -t xfs -o defaults,noatime,nodiratime /dev/sdl /data/slota" >> /etc/rc.local
echo "/bin/mount -t xfs -o defaults,noatime,nodiratime /dev/sdm /data/slotb" >> /etc/rc.local
##########格式化磁盤
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
mkfs.xfs -f /dev/sdh
mkfs.xfs -f /dev/sdi
mkfs.xfs -f /dev/sdj
mkfs.xfs -f /dev/sdk
mkfs.xfs -f /dev/sdl
mkfs.xfs -f /dev/sdm
/bin/mount -t xfs -o defaults,noatime,nodiratime /dev/sdb /data/slot0
/bin/mount -t xfs -o defaults,noatime,nodiratime /dev/sdc /data/slot1
/bin/mount -t xfs -o defaults,noatime,nodiratime /dev/sdd /data/slot2
/bin/mount -t xfs -o defaults,noatime,nodiratime /dev/sde /data/slot3
/bin/mount -t xfs -o defaults,noatime,nodiratime /dev/sdf /data/slot4
/bin/mount -t xfs -o defaults,noatime,nodiratime /dev/sdg /data/slot5
/bin/mount -t xfs -o defaults,noatime,nodiratime /dev/sdh /data/slot6
/bin/mount -t xfs -o defaults,noatime,nodiratime /dev/sdi /data/slot7
/bin/mount -t xfs -o defaults,noatime,nodiratime /dev/sdj /data/slot8
/bin/mount -t xfs -o defaults,noatime,nodiratime /dev/sdk /data/slot9
/bin/mount -t xfs -o defaults,noatime,nodiratime /dev/sdl /data/slota
/bin/mount -t xfs -o defaults,noatime,nodiratime /dev/sdm /data/slotb