分类:
2009-08-15 23:57:31
适用范围:
主机本地至少有两个磁盘,其中操作系统安装在一块硬盘上,另一块硬盘目前未使用,并且没有使用的硬盘的容量必须等于或者大于已经安装了操作系统的那块磁盘。为了提高主机的安全性,避免因本地磁盘上只使用一块磁盘装操作系统存在的单点故障导致机器宕机的危险,可以使用根盘镜像配置的方法消除主机的磁盘单点故障
主要操作步骤:
1, 查看主机的本地磁盘
#ioscan –knfCdisk
Class I H/W Path Driver S/W State H/W Type Description
=======================================================================
disk 1 0/0/2/
/dev/dsk/c1t6d0 /dev/rdsk/c1t6d0
disk 0 0/
/dev/dsk/c2t6d0 /dev/rdsk/c2t6d0
2, 查看本地磁盘使用情况
#pvdisplay /dev/dsk/c1t6d0
--- Physical volumes ---
PV Name /dev/dsk/c1t6d0
VG Name /dev/vg00
PV Status available
Allocatable yes
VGDA 2
Cur
PE Size (Mbytes) 16
Total PE 2170
Free PE 147
Allocated PE 2023
Stale PE 0
IO Timeout (Seconds) default
Autoswitch On
#pvdisplay /dev/dsk/c2t6d0
pvdisplay: Couldn't find the volume group to which physical volume "/dev/dsk/c2t6d0" belongs.
pvdisplay: Cannot display physical volume "/dev/dsk/c2t6d0".
从上述信息中可以知道:第一块磁盘(/dev/dsk/c1t6d0)已经被vg00使用,而第二磁盘(/dev/dsk/c2t6d0)未被使用
3, 查看vg00中包含的lv
#vgdisplay –v vg00
--- Volume groups ---
VG Name /dev/vg00
VG Write Access read/write
VG Status available
Max
Cur
Open
Max PV 16
Cur PV 1
Act PV 1
Max PE per PV 4384
VGDA 2
PE Size (Mbytes) 16
Total PE 2170
Alloc PE 2023
Free PE 147
Total PVG 0
Total Spare PVs 0
Total Spare PVs in use 0
--- Logical volumes ---
LV Name /dev/vg00/lvol1
LV Status available/syncd
Current LE 32
Allocated PE 32
Used PV 1
LV Name /dev/vg00/lvol2
LV Status available/syncd
Current LE 128
Allocated PE 128
Used PV 1
LV Name /dev/vg00/lvol3
LV Status available/syncd
Current LE 64
Allocated PE 64
Used PV 1
LV Name /dev/vg00/lvol4
LV Status available/syncd
Current LE 32
Allocated PE 32
Used PV 1
LV Name /dev/vg00/lvol5
LV Status available/syncd
Current LE 64
Allocated PE 64
Used PV 1
LV Name /dev/vg00/lvol6
LV Status available/syncd
Current LE 256
Allocated PE 256
Used PV 1
LV Name /dev/vg00/lvol7
LV Status available/syncd
Current LE 128
Allocated PE 128
Used PV 1
LV Name /dev/vg00/lvol8
LV Status available/syncd
Current LE 256
Allocated PE 256
Used PV 1
LV Name /dev/vg00/oracle
LV Status available/syncd
Current LE 500
Allocated PE 500
Used PV 1
LV Name /dev/vg00/sybase
LV Status available/syncd
Current LE 563
Allocated PE 563
Used PV 1
--- Physical volumes ---
PV Name /dev/dsk/c1t6d0
PV Status available
Total PE 2170
Free PE 147
Autoswitch On
从上面的输出中得知:vg00包含以下lv,分别是lvol1、lvol2、lvol3、lvol4、lvol5、lvol6、lvol7、lvol8、oracle、sybase。因此在镜像时,这些lv都需要镜像。
4, 格式化第二块磁盘
#pvcreate -B /dev/rdsk/c2t6d0
参数-B的作用是将该磁盘格式化为可启动磁盘
注意:此处必须使用块设备
5, 将第二块磁盘加入vg00
#vgextend vg00 /dev/dsk/c2t6d0
6, 给新磁盘写入LIF header和LIF文件(ISL,AUTO,HPUX,LABEL)
#mkboot –l /dev/rdsk/c2t6d0
7, 查看给新磁盘写入的LIF header和LIF文件,确保写入正确
#lifls –l /dev/rdsk/c2t6d0
volume c2t6d0 data size 7984 directory size 8 07/08/08 12:44:39
filename type start size implement created
===============================================================
ISL -12800 584 306 0 02/05/10 16:25:44
AUTO -12289 896 1 0 02/05/10 16:25:44
HPUX -12928 904 848 0 02/05/10 16:25:44
PAD -12290 1752 1580 0 02/05/10 16:25:45
LABEL BIN 3336 8 0 07/08/10 17:19:04
8, 将vg00中的所有lv复制到一份到第二块磁盘上
#for lvol in lvol1 lvol2 lvol3 lvol4 lvol5 lvol6 lvol7 lvol8 oracle sybase
>do
>lvextend –m 1 /dev/vg00/$lvol /dev/dsk/c2t6d0
>done
此过程需要一段时间完成,需要耐心等待完成后再操作下一步
9, 给两个磁盘的AUTO文件写入新的内容
#mkboot –a ‘hpux –lq’ /dev/rdsk/c1t6d0
#mkboot –a ‘hpux –lq’ /dev/rdsk/c2t6d0
hpux –lq意为:autoboot without qurom enforced
10, 查看给两个磁盘的AUTO文件写入新的内容是否正确
#lifcp /dev/rdsk/c1t6d0:AUTO –
hpux -lq
#lifcp /dev/rdsk/c2t6d0:AUTO –
hpux –lq