環境:SUN-U250 + Solaris8 硬盤:c0t0d0(root),c8t0d0,c9t0d0,c10t0d0,c11t0d0,c12t0d0 目的:練習用disksuite做RAID0,RAID1,RAID5,hotspare... 熟悉常用命令 過程: 1,分區 format-選盤-partition-print-modify 分20MB於7分區,用於放狀態數據庫副本,其余給分區6 #prtvtoc /dev/rdsk/c0t8d0s2 fmthard s - dev/rdsk/c9t0d0s2 c10t0d0s2 c11t0d0s2 c12t0d0s2 2,建database #metadb -a -c 2 -f c8t0d0s7 c9t0d0s7 c10t0d0s7 c11t0d0s7 c12t0d0s7 #metadb -i 3,RAID0試驗 #metainit d0 1 2 c8t0d0s6 c9t0d0s6 建二個slice組成的stripe #metastat #cd / #mkdir data1 #newfs /dev/md/dsk/d0 #mount /dev/md/dsk/d0 /data0 #metattach d0 c10t0d0s6 c11t0d0s6 加入slice到volumn中 #metastat #umount /data1 刪除 #metaclear d0 #metastat #metadb -d -f c8t0d0s7 c9t0d0s7 c10t0d0s7 c11t0d0s7 c12t0d0s7 3,RAID1試驗 建database #metainit d1 1 1 c8t0d0s6 建立鏡像 #metainit d2 1 1 c9t0d0s6 #metainit d0 -m d1 #metainit d0 d2 #metastat #newfs /dev/md/dsk/d0 #mount /dev/md/dsk/d0 /data1 #metattach d0 c9t0d0s6 c10t0d0s6 換盤 拔出c0t10d0s6 #toUCh /data1/a 機噐報錯 插入c0t10d0s6 #netareplace -e d0 c0t10d0s6 修復(原位) #metastat #metainit hsp001 創建一個hot spare pool #metahs -a hsp001 c0t9d0s6 #metaparam -h hsp001 d1 綁定 #metaparam -h hsp001 d2 #metastat 拔出c0t0d10s6 #touch /data1/a 機噐報錯,hsp001自動替換失效的slice 插入c0t10d0s6 #netareplace -e d0 c0t10d0s6 修復(原位) #metastat #metaparam -h none d1 脫離 #metaparam -h none d2 #metaclear hsp001 刪除 #umount /data1 刪除RAID1 #metaclear d0 d2 d1 #metadb -d c8t0d0s7 c9t0d0s7 c10t0d0s7 c11t0d0s7 c12t0d0s7 4,/opt盤鏡像,根盤鏡像 建database #umount /opt #metainit –f d1 1 1 c0t0d0s3 ( opt slice ) #metainit d2 1 1 c0t8d0s6 #metainit d0 -m d1 #vi /etc/vfstab #metainit -f d11 1 1 c0t0d0s0 根盤 #metainit d12 1 1 c0t9d0s6 #metainit d10 -m d11 #metaroot d10 #lockfs -fa #reboot #metattach d10 d12 #metattach d0 d2 #metadetach d10 d12 取消/ #metaroot /dev/dsk/c0t0d0s0 #metadetach d0 d2 取消opt #vi /etc/vfstab #reboot #metaclear -r d10 #metaclear d12 #metaclear d0 d2 5,RAID5試驗 建database #metainit d0 -r c0t9d0s6 c0t9d0s6 c0t10d0s6 #metastat #newfs /dev/md/dsk/d0 #mount /dev/md/dsk/d0 /data1 #拔出c0t10d0s6 #touch /data1/a 報錯 #metadb -f -d c0t0d10s6 #metadb -a -c 2 c0t0d10s6 插入c0t10d0s6 #metareplace -e d0 c0t10d0s6 修復(原位) #metastat #metainit hsp001 c0t11d0s6 創建一個hot spare pool #metahs -d hsp001 c0t11d0s6 #metahs -a hsp001 c0t11d0s6 c0t12d0s6 往hsp加盤 #metaparam -h hsp001 d0 綁定 #metastat #拔出c0t0d10s6 #touch /data1/a 機噐報錯,hsp001自動替換失效的硬盤 #metastat #metadb -f -d c0t0d10s6 #metadb -a -c 2 c0t0d10s6 插入c0t10d0s6 #metareplace -e d0 c0t10d0s6 修復(原位) #通過c0t11d0s6恢復c0t10d0s6 #metastat #metaparam -hone d0 刪除hsp #metaclear hsp001 #umount /data1 刪除RAID5 #metaclear d0