- 論壇徽章:
- 0
|
適用范圍:
主機(jī)本地至少有兩個(gè)磁盤,其中操作系統(tǒng)安裝在一塊硬盤上,另一塊硬盤目前未使用,并且沒有使用的硬盤的容量必須等于或者大于已經(jīng)安裝了操作系統(tǒng)的那塊磁盤。為了提高主機(jī)的安全性,避免因本地磁盤上只使用一塊磁盤裝操作系統(tǒng)存在的單點(diǎn)故障導(dǎo)致機(jī)器宕機(jī)的危險(xiǎn),可以使用根盤鏡像配置的方法消除主機(jī)的磁盤單點(diǎn)故障
主要操作步驟:
1, 查看主機(jī)的本地磁盤
#ioscan –knfCdisk
Class I H/W Path Driver S/W State H/W Type Description
=======================================================================
disk 1 0/0/2/0.6.0 sdisk CLAIMED DEVICE COMPAQ BF03687B54
/dev/dsk/c1t6d0 /dev/rdsk/c1t6d0
disk 0 0/0/2/1.6.0 sdisk CLAIMED DEVICE COMPAQ BF03687B54
/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 LV 10
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)已經(jīng)被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 LV 255
Cur LV 10
Open LV 10
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
LV Size (Mbytes) 512
Current LE 32
Allocated PE 32
Used PV 1
LV Name /dev/vg00/lvol2
LV Status available/syncd
LV Size (Mbytes) 2048
Current LE 128
Allocated PE 128
Used PV 1
LV Name /dev/vg00/lvol3
LV Status available/syncd
LV Size (Mbytes) 1024
Current LE 64
Allocated PE 64
Used PV 1
LV Name /dev/vg00/lvol4
LV Status available/syncd
LV Size (Mbytes) 512
Current LE 32
Allocated PE 32
Used PV 1
LV Name /dev/vg00/lvol5
LV Status available/syncd
LV Size (Mbytes) 1024
Current LE 64
Allocated PE 64
Used PV 1
LV Name /dev/vg00/lvol6
LV Status available/syncd
LV Size (Mbytes) 4096
Current LE 256
Allocated PE 256
Used PV 1
LV Name /dev/vg00/lvol7
LV Status available/syncd
LV Size (Mbytes) 2048
Current LE 128
Allocated PE 128
Used PV 1
LV Name /dev/vg00/lvol8
LV Status available/syncd
LV Size (Mbytes) 4096
Current LE 256
Allocated PE 256
Used PV 1
LV Name /dev/vg00/oracle
LV Status available/syncd
LV Size (Mbytes) 8000
Current LE 500
Allocated PE 500
Used PV 1
LV Name /dev/vg00/sybase
LV Status available/syncd
LV Size (Mbytes) 9008
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。因此在鏡像時(shí),這些lv都需要鏡像。
4, 格式化第二塊磁盤
#pvcreate -B /dev/rdsk/c2t6d0
參數(shù)-B的作用是將該磁盤格式化為可啟動(dòng)磁盤
注意:此處必須使用塊設(shè)備
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中的所有l(wèi)v復(fù)制到一份到第二塊磁盤上
#for lvol in lvol1 lvol2 lvol3 lvol4 lvol5 lvol6 lvol7 lvol8 oracle sybase
>do
>lvextend –m 1 /dev/vg00/$lvol /dev/dsk/c2t6d0
>done
此過程需要一段時(shí)間完成,需要耐心等待完成后再操作下一步
9, 給兩個(gè)磁盤的AUTO文件寫入新的內(nèi)容
#mkboot –a ‘hpux –lq’ /dev/rdsk/c1t6d0
#mkboot –a ‘hpux –lq’ /dev/rdsk/c2t6d0
hpux –lq意為:autoboot without qurom enforced
10, 查看給兩個(gè)磁盤的AUTO文件寫入新的內(nèi)容是否正確
#lifcp /dev/rdsk/c1t6d0:AUTO –
hpux -lq
#lifcp /dev/rdsk/c2t6d0:AUTO –
hpux –lq
本文來自ChinaUnix博客,如果查看原文請(qǐng)點(diǎn):http://blog.chinaunix.net/u/8103/showart_2029005.html |
|