Unix应用技巧:solaris raid 制作大集合
网络整理 - 06-30
在操作系统安装结束后
安装DiskSuite_软件及相关补丁
以下以实力的方式介绍引导盘镜像操作
例子中操作系统分区定义如下
ctds /
ctds swap
ctds /var
ctds (metaDB*)
ctds /opt
ctds /usr
ctds /export/home
用root用户登陆
运行以下命令
# prtvtoc /dev/rdsk/ctds > bootvtoctab
# fmthard s bootvtoctab /dev/rdsk/ctds
以上命令将第硬盘的文件分区表调整为和引导盘一致
运行以下命令
# metadb afc ctds
# metadb afc ctds
# metainit f d ctds
# metainit d ctds
# metainit f d ctds
# metainit d ctds
# metainit f d ctds
# metainit d ctds
# metainit f d ctds
# metainit d ctds
# metainit f d ctds
# metainit d ctds
# metainit f d ctds
# metainit d ctds
# metainit d m d
# metainit d m d
# metainit d m d
# metainit d m d
# metainit d m d
# metainit d m d
# metaroot d
# lockfs fa
修改/etc/vfstab文件为如下
#device device mount FS fsck mount mount
#to mount to fsck point type pass at boot options
#
#/dev/dsk/cds /dev/rdsk/cds /usr ufs yes
fd /dev/fd fd no
/proc /proc proc no
#/dev/dsk/ctds swap no
/dev/md/dsk/d swap no
#/dev/dsk/ctds /dev/rdsk/ctds / ufs no
/dev/md/dsk/d /dev/md/rdsk/d / ufs no
#/dev/dsk/ctds /dev/rdsk/ctds /usr ufs no
/dev/md/dsk/d /dev/md/rdsk/d /usr ufs no
#/dev/dsk/ctds /dev/rdsk/ctds /var ufs no
/dev/md/dsk/d /dev/md/rdsk/d /var ufs no
#/dev/dsk/ctds /dev/rdsk/ctds /export/home ufs yes
/dev/md/dsk/d /dev/md/rdsk/d /export/home ufs yes
#/dev/dsk/ctds /dev/rdsk/ctds /opt ufs yes
/dev/md/dsk/d /dev/md/rdsk/d /opt ufs yes
swap /tmp tmpfs yes
至此引导盘镜像操作的第一步完成
运行以下命令重新引导操作系统
# sync
# sync
# sync
# reboot
做数据同步
# metattach d d
# metattach d d
# metattach d d
# metattach d d
# metattach d d
# metattach d d
以上步骤执行时间较长
主引导盘损坏的恢复(主引导盘为ctd)
删除损坏的replicas
# metadb i #查看状态
# metadb d ctds #删除replicas
停机换盘
# sync
# sync
# init
从备用盘引导系统(使用Stop+A 使系统进入ok状态)
ok boot disk
设置新盘分区
# prtvtoc /dev/rdsk/ctds > bootvtoctab
# fmthard f bootvtoctab /dev/rdsk/ctds
再创建replicas
# metadb afc ctds
重连接新设备到主mirror并同步
# metareplace e d ctds
d: device ctds is enabled
# metareplace e d ctds
d: device ctds is enabled
# metareplace e d ctds
d: device ctds is enabled
# metareplace e d ctds
d: device ctds is enabled
# metareplace e d ctds
d: device ctds is enabled
# metareplace e d ctds
d: device ctds is enabled