红联Linux门户
Linux帮助

做一个新的Mirror boot disk 步骤(hpux)

发布时间:2006-08-21 09:35:24来源:红联作者:夏雨
1、将BDRA信息写入另一个mirror的boot disk 。保留固定的(fixed)2912KB空间给LVM header。
#pvcreate -f -B /dev/rdsk/cXtYdZ (因为要做启动盘一定要加上 -B option)
BDRA:
Information about Boot/Swap/Root LVs ( maior /minor number, etc.)
Information about PVs in root VG
仅仅只用 -f option是不行的,因为这个选择仅仅-force 强制写入PVRA信息到disk。这里的LVM header只有PVRA和VGRA,header sizes of non-bootable disk is not fixed ,但是一定小于2912KB。
2、将cXtYdZ添加到vg00中
#vgextend /dev/vg00 /dev/dsk/cXtYdZ
3、写LIF header 和LIF files(ISL,AUTO,HPUX,LABEL)
ISL,initial system loader
#mkboot -l /dev/rdsk/cXtYdZ
#lifls -l /dev/rdsk/cXtYdZ-----(check it)
4、做mirror,将disk上的LV镜像到当前盘,有很多LV,我们可以使用shell loop在自动完成。有兴趣可以试试!
#lvextend -m 1 /dev/vg00/lvol 1 /dev/dsk/cXtYdZ
#lvextend -m 1 /dev/vg00/lvol 2 /dev/dsk/cXtYdZ
#lvextend -m 1 /dev/vg00/lvol 3 /dev/dsk/cXtYdZ
#for lvol in lvol1 lvol2 ... lvol 9 (指定你所要mirror的LV)
>do
>lvextend -m 1 /dev/vg00/$lvol /dev/rdsk/cXtYdZ
>done
5、write AUTO文件内容
#mkboot -a "hpux -lq(;0)/stand/vmunix" /dev/rdsk/cXtYdZ
这里要注意的是,hpux 和-lq 中间有一个空格,如果没有加空格从新盘启动时,系统会直接进入ISL>,然后继续敲hpux -lq 就正常起来了,进入系统再重新做一次mkboot,再测试就没有问题了。
#lifcp /dev/rdsk/cXtYdZ:AUTO- (check it)
在这里设置的AUTO文件,绕过了quorum否则两块盘按照quorum机制是不能正常启动的。quorum的解释我有发过,请大家参考。
6、write LABEL文件内容。
#lvlnboot -b /dev/vg00/lvol 1
#lvlnboot -s /dev/vg00/lvol 2
#lvlnboot -r /dev/vg00/lvol 3
#lvlnboot -d /dev/vg00/lvol 2
b-boot、s-swap、r-root、d-dump
#lvlnboot -v (check it )
注意:lvlnboot -Rv( 确保BDRA已经update,这个命令是确认写入的)。直接执行这个命令就不用分个指定boot、swap、root、dump。
7、修改boot ALT路径为mirror disk
setboot -a
# setboot -p 0/0/0/0.0.0 设定原来的硬盘路径为主启动(primary)
# setboot -a 0/0/0/0.1.0 使用 mirrored disk’s hw path 将磁盘设定为alt


以是做一个新的mirror,下面是更换根盘的步骤,大家也看到了,其实做一个mirror并不是很复杂但是重要的是细心,不要出错。
1、首先扫描系统disk,找出有问题的disk,
#ioscan -fnCdisk
2、 查看系统中的VG和VG内包括的PV.现在是更换更换根盘。我们要更换根盘,所以要看vg00下的disk,确认坏盘是在vg00下的。
#strings etc/lvmtab
3、确定cXtYdZ的位置
#dd if=/dev/rdsk/cXtYdZ of=/dev/null bs=1024k cXtYdZ 的状态灯长亮(其它的disk在正常的情况下,灯都是闪烁的)
4、确定pv上的lvol信息,开始去除mirror。
#lvdiplay -v lvol*|more
#lvreduce -m 0 /dev/vg00/lvol1 /dev/dsk/cXtYdZ

#lvreduce -m 0 /dev/vg00/lvol8 /dev/dsk/cXtYdZ
可以使用shell loop
#for lvol in lvol1 lvol2 lvol3……lvol8
>do
>lvreduce -m 0 /dev/vg00/$lvol /dev/dsk/cXtYdZ
>done
5、将disk从VG中去除
#vgreduce /dev/vg00 /dev/dsk/cXtYdZ
6、更换硬盘
7、#ioscan -fnCdisk 查看系统是否发现磁盘和状态
8、恢复LVM header 信息到磁盘,注意,用vgcfgrestore 恢复过就无法执行pvcreate了
#vgcfgrestore -n /dev/vg00 /dev/rdsk/cXtYdZ
9、激活VG #vgchange -a y /dev/vg00
10、同步数据 #vgsync
文章评论

共有 1 条评论

  1. 于 2006-11-16 14:42:04发表:

    :ha3nd