环境: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