Chinaunix首页 | 论坛 | 博客
  • 博客访问: 104673411
  • 博文数量: 19283
  • 博客积分: 9968
  • 博客等级: 上将
  • 技术积分: 196062
  • 用 户 组: 普通用户
  • 注册时间: 2007-02-07 14:28
文章分类

全部博文(19283)

文章存档

2011年(1)

2009年(125)

2008年(19094)

2007年(63)

分类:

2008-04-22 13:36:24

作者: Axflue 出自:
在操作系统安装结束后
安装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 -

至此,引导盘镜像操作的第一步完成

运行以下命令重新引导操作系统

# sync
# sync
# sync
# reboot

做数据同步
# metattach d20 d22
# metattach d23 d25
# metattach d26 d28
# metattach d30 d32
# metattach d33 d35
# metattach d36 d38
以上步骤执行时间较长
主引导盘损坏的恢复(主引导盘为c0t0d0)
删除损坏的replicas
# metadb -i #查看状态
# metadb -d c0t0d0s4 #删除replicas
停机,换盘
# sync
# sync
# 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
以上步骤执行时间较长

raid 0 +1
metainit d1 1 3 c0t1d0s0 c0t2d0s0 c0t3d0s0
metainit d2 1 3 c0t4d0s0 c0t5d0s0 c0t6d0s0
# metainit d0 -m d1
# metattach d0 d2

raid 1 +0
metainit d1 3 1 c0t1d0s0 1 c0t2d0s0 1 c0t3d0s0
metainit d2 3 1 c0t4d0s0 1 c0t5d0s0 1 c0t6d0s0
# metainit d0 -m d1
# metattach d0 d2

raid 5比较简单
# metainit d0 -r 1 6 c0t1d0s0 1 c0t2d0s0 1 c0t3d0s0 c0t4d0s0 1 c0t5d0s0 1 c0t6d0s0
阅读(414) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~