分类: 服务器与存储
2006-03-01 16:15:00
在操作系统安装结束后
安装DiskSuite_4.2.1软件及相关补丁
以下以实力的方式介绍“引导盘镜像操作”
例子中操作系统分区定义如下:
c0t0d0s0 /
c0t0d0s1 swap
c0t0d0s3 /var
c0t0d0s4 (metaDB*3)
c0t0d0s5 /opt
c0t0d0s6 /usr
c0t0d0s7 /export/home
用root用户登陆
运行以下命令:
# prtvtoc /dev/rdsk/c0t0d0s2 > boot-vtoc.tab
# fmthard -s boot-vtoc.tab /dev/rdsk/c0t1d0s2
以上命令将第2硬盘的文件分区表调整为和引导盘一致
运行以下命令制作镜像:
# metadb -afc 3 c0t0d0s4
# metadb -afc 3 c0t1d0s4
# metainit -f d21 1 1 c0t0d0s0
# metainit d22 1 1 c0t1d0s0
# metainit -f d24 1 1 c0t0d0s1
# metainit d25 1 1 c0t1d0s1
# metainit -f d27 1 1 c0t0d0s3
# metainit d28 1 1 c0t1d0s3
# metainit -f d31 1 1 c0t0d0s5
# metainit d32 1 1 c0t1d0s5
# metainit -f d34 1 1 c0t0d0s6
# metainit d35 1 1 c0t1d0s6
# metainit -f d37 1 1 c0t0d0s7
# metainit d38 1 1 c0t1d0s7
# metainit d20 -m d21
# metainit d23 -m d24
# metainit d26 -m d27
# metainit d30 -m d31
# metainit d33 -m d34
# metainit d36 -m d37
# metaroot d20
# lockfs -fa
修改/etc/vfstab文件为如下:
#device device mount FS fsck mount mount to mount to fsck point type pass at boot options
#/dev/dsk/c1d0s2 /dev/rdsk/c1d0s2 /usr ufs 1 yes -
fd - /dev/fd fd - no -
/proc - /proc proc - no -
#/dev/dsk/c0t0d0s3 - - swap - no -
/dev/md/dsk/d26 - - swap - no -
#/dev/dsk/c0t0d0s0 /dev/rdsk/c0t0d0s0 / ufs 1 no -
/dev/md/dsk/d20 /dev/md/rdsk/d20 / ufs 1 no -
#/dev/dsk/c0t0d0s6 /dev/rdsk/c0t0d0s6 /usr ufs 1 no -
/dev/md/dsk/d33 /dev/md/rdsk/d33 /usr ufs 1 no -
#/dev/dsk/c0t0d0s1 /dev/rdsk/c0t0d0s1 /var ufs 1 no -
/dev/md/dsk/d23 /dev/md/rdsk/d23 /var ufs 1 no -
#/dev/dsk/c0t0d0s7 /dev/rdsk/c0t0d0s7 /export/home ufs 2 yes -
/dev/md/dsk/d36 /dev/md/rdsk/d36 /export/home ufs 2 yes -
#/dev/dsk/c0t0d0s5 /dev/rdsk/c0t0d0s5 /opt ufs 2 yes -
/dev/md/dsk/d30 /dev/md/rdsk/d30 /opt ufs 2 yes -
swap - /tmp tmpfs - yes -
至此,引导盘镜像操作的第一步完成 运行以下命令重新引导操作系统
# reboot
做数据同步
# metattach d20 d22
# metattach d23 d25
# metattach d26 d28
# metattach d30 d32
# metattach d33 d35
# metattach d36 d38
加载镜像与系统同步
#ls -l /dev/dsk/c0t1d0s0
显示:
进入OK模式
ok nvlias disk1
ok setenv boot-device disk disk1
以上步骤执行时间较长
主引导盘损坏的恢复(主引导盘为c0t0d0)
删除损坏的replicas
# metadb -i #查看状态
# metadb -d c0t0d0s4 #删除replicas
停机,换盘
# init 5
从备用盘引导系统(使用Stop+A 使系统进入ok状态)
ok boot disk1
设置新盘分区
# prtvtoc /dev/rdsk/c0t1d0s2 > boot-vtoc.tab
# fmthard -f boot-vtoc.tab /dev/rdsk/c0t0d0s2
再创建replicas
# metadb -afc 3 c0t0d0s4
重连接新设备到主mirror,并同步
# metareplace -e d20 c0t0d0s0
d20: device c0t0d0s0 is enabled
# metareplace -e d23 c0t0d0s1
d20: device c0t0d0s1 is enabled
# metareplace -e d26 c0t0d0s3
d20: device c0t0d0s3 is enabled
# metareplace -e d30 c0t0d0s5
d20: device c0t0d0s5 is enabled
# metareplace -e d33 c0t0d0s6
d20: device c0t0d0s6 is enabled
# metareplace -e d36 c0t0d0s7
d20: device c0t0d0s7 is enabled
以上步骤执行时间较长