- 論壇徽章:
- 0
|
前兩天客戶有臺(tái)根盤(pán)做了Mirror的RP7410啟不來(lái)了,幸好有MC/SG雙機(jī)環(huán)境。
兩塊內(nèi)置硬盤(pán)在另一臺(tái)RP7410上做diskinfo都沒(méi)返回信息,估計(jì)可能是兩塊
盤(pán)都出現(xiàn)故障了。后來(lái)停掉業(yè)務(wù)停機(jī),在拔出另一臺(tái)RP7410雙機(jī)做了Mirror
的內(nèi)置硬盤(pán),插在故障機(jī)器上通過(guò)取消根盤(pán)Mirror,以及用新硬盤(pán)重做根盤(pán)
Mirror等操作才得以恢復(fù)。
由于整個(gè)故障排除不在現(xiàn)場(chǎng),現(xiàn)根據(jù)這樣的情況在自已的HP9000 C3000機(jī)器
上做個(gè)完整的HPUX v11.11根盤(pán)Mirror及去掉一塊硬盤(pán)后取消根盤(pán)Mirror的測(cè)試:
測(cè)試環(huán)境:
主機(jī) HP9000 C3000
OS HP_UX v11.11
內(nèi)置硬盤(pán) 18.2GB*2
安裝HP_UX v11.11操作系統(tǒng)及補(bǔ)丁這里略過(guò),將HP_UX 11i的Application
Software四張安裝CD的第一張放入光驅(qū),
#mkdir /cdrom
#ioscan -fnC disk
Class I H/W Path Driver S/W State H/W Type Description
=======================================================================
disk 0 10/0/14/0.0.0 sdisk CLAIMED DEVICE TEAC CD-532E-B
/dev/dsk/c0t0d0 /dev/rdsk/c0t0d0
disk 1 10/0/15/1.5.0 sdisk CLAIMED DEVICE COMPAQ BD0186349B
/dev/dsk/c3t5d0 /dev/rdsk/c3t5d0
disk 2 10/0/15/1.6.0 sdisk CLAIMED DEVICE COMPAQ BD0186349B
/dev/dsk/c3t6d0 /dev/rdsk/c3t6d0
#mount /dev/dsk/c0t0d0 /cdrom
#swinstall -s /cdrom
在列表里找到B5403BA B.11.11 MirrorDisk/UX并執(zhí)行安裝,缺省安裝這個(gè)軟
件會(huì)重新編譯內(nèi)核,安裝完成后系統(tǒng)自動(dòng)重新啟動(dòng)。啟動(dòng)完成后就開(kāi)始做根盤(pán)的Mirror
由于系統(tǒng)是安裝在c3t5d0上,另一塊盤(pán)c3t6d0做鏡像盤(pán)。
#pvcreate -fB /dev/rdsk/c3t6d0
#vgextend /dev/vg00 /dev/dsk/c3t6d0
#vgdisplay -v vg00
確認(rèn)根盤(pán)的8個(gè)LV,并且c3t6d0已經(jīng)加入到vg00中了。
#mkboot -l /dev/dsk/c3t6d0
#lifls -l /dev/rdsk/c3t5d0
#lifls -l /dev/rdsk/c3t6d0
在c3t6d0上創(chuàng)建LIF,并對(duì)比兩塊硬盤(pán)的LIF信息一致性。
#for i in 1 2 3 4 5 6 7 8
>do
>lvextend -m 1 /dev/vg00/lvol$i /dev/dsk/c3t6d0
>done
The newly allocated mirrors are now being synchronized. This operation will
take some time. Please wait ....
Logical volume "/dev/vg00/lvol1" has been successfully extended.
Volume Group configuration for /dev/vg00 has been saved in /etc/lvmconf/vg00.conf
The newly allocated mirrors are now being synchronized. This operation will
take some time. Please wait ....
Logical volume "/dev/vg00/lvol2" has been successfully extended.
Volume Group configuration for /dev/vg00 has been saved in /etc/lvmconf/vg00.conf
The newly allocated mirrors are now being synchronized. This operation will
take some time. Please wait ....
Logical volume "/dev/vg00/lvol3" has been successfully extended.
Volume Group configuration for /dev/vg00 has been saved in /etc/lvmconf/vg00.conf
The newly allocated mirrors are now being synchronized. This operation will
take some time. Please wait ....
Logical volume "/dev/vg00/lvol4" has been successfully extended.
Volume Group configuration for /dev/vg00 has been saved in /etc/lvmconf/vg00.conf
The newly allocated mirrors are now being synchronized. This operation will
take some time. Please wait ....
Logical volume "/dev/vg00/lvol5" has been successfully extended.
Volume Group configuration for /dev/vg00 has been saved in /etc/lvmconf/vg00.conf
The newly allocated mirrors are now being synchronized. This operation will
take some time. Please wait ....
Logical volume "/dev/vg00/lvol6" has been successfully extended.
Volume Group configuration for /dev/vg00 has been saved in /etc/lvmconf/vg00.conf
The newly allocated mirrors are now being synchronized. This operation will
take some time. Please wait ....
Logical volume "/dev/vg00/lvol7" has been successfully extended.
Volume Group configuration for /dev/vg00 has been saved in /etc/lvmconf/vg00.conf
The newly allocated mirrors are now being synchronized. This operation will
take some time. Please wait ....
Logical volume "/dev/vg00/lvol8" has been successfully extended.
Volume Group configuration for /dev/vg00 has been saved in /etc/lvmconf/vg00.conf
#mkboot -a "hpux -lq(;0)/stand/vmunix" /dev/rdsk/c3t6d0
#lvlnboot -b /dev/vg00/lvol1
#lvlnboot -s /dev/vg00/lvol2
#lvlnboot -r /dev/vg00/lvol3
#lvlnboot -d /dev/vg00/lvol2
#setboot -p 10/0/15/1.6.0
#setboot -a 10/0/15/1.5.0
至此根盤(pán)的Mirror工作完成,經(jīng)過(guò)多次重新啟動(dòng),多次更改setboot引導(dǎo)順序后確認(rèn)
Mirror沒(méi)有問(wèn)題。
接下來(lái)關(guān)機(jī)下電,拔掉c3t6d0這塊硬盤(pán),啟動(dòng)機(jī)器可看到報(bào)錯(cuò)信息,仍能夠啟動(dòng)系統(tǒng)。
登錄后vgdisplay也顯示報(bào)錯(cuò)信息
# vgdisplay
vgdisplay: Warning: couldn't query physical volume "/dev/dsk/c3t6d0":
The specified path does not correspond to physical volume attached to
this volume group
vgdisplay: Warning: couldn't query all of the physical volumes.
--- Volume groups ---
VG Name /dev/vg00
VG Write Access read/write
VG Status available
Max LV 255
Cur LV 8
Open LV 8
Max PV 16
Cur PV 2
Act PV 1
Max PE per PV 4350
VGDA 2
PE Size (Mbytes) 4
Total PE 4340
Alloc PE 3124
Free PE 1216
Total PVG 0
Total Spare PVs 0
Total Spare PVs in use 0
由于已經(jīng)不存在c3t6d0硬盤(pán)或是這塊硬盤(pán)已經(jīng)故障不再有數(shù)據(jù)信息,這里就不能再使
用lvreduce -m 0 /dev/vg00/lvol1 /dev/dsk/c3t6d0等命令來(lái)取消c3t6d0上的Mirror信息
了,這里HP提供一個(gè)pv_key方試來(lái)取消Mirror,具體每個(gè)LV的信息里包括了pv_key,可以
通過(guò)下面命令查看
# lvdisplay -kv /dev/vg00/lvol1
lvdisplay: Warning: couldn't query physical volume "/dev/dsk/c3t6d0":
The specified path does not correspond to physical volume attached to
this volume group
lvdisplay: Warning: couldn't query all of the physical volumes.
--- Logical volumes ---
LV Name /dev/vg00/lvol1
VG Name /dev/vg00
LV Permission read/write
LV Status available/stale
Mirror copies 1
Consistency Recovery MWC
Schedule parallel
LV Size (Mbytes) 300
Current LE 75
Allocated PE 150
Stripes 0
Stripe Size (Kbytes) 0
Bad block off
Allocation strict/contiguous
IO Timeout (Seconds) default
--- Distribution of logical volume ---
PV Name LE on PV PE on PV
/dev/dsk/c3t5d0 75 75
--- Logical extents ---
LE PV1 PE1 Status 1 PV2 PE2 Status 2
00000 0 00000 stale 1 00000 current
00001 0 00001 stale 1 00001 current
00002 0 00002 stale 1 00002 current
00003 0 00003 stale 1 00003 current
...... ......
可以看到PV1的pv_key=0 而其PV的狀態(tài)已經(jīng)stale了,那么我們需要去掉這個(gè)PV在
VG00中的信息。下面這個(gè)命令增加了一個(gè)-k參數(shù),最后一個(gè)0表示PV1的pv_key,用它代替了
c3t6d0這塊硬盤(pán)。
# lvreduce -k -m 0 /dev/vg00/lvol1 0
Logical volume "/dev/vg00/lvol1" has been successfully reduced.
lvlnboot: Warning: couldn't query physical volume "/dev/dsk/c3t6d0":
The specified path does not correspond to physical volume attached to
this volume group
lvlnboot: Warning: couldn't query all of the physical volumes.
vgcfgbackup: Warning: couldn't query physical volume "/dev/dsk/c3t6d0":
The specified path does not correspond to physical volume attached to
this volume group
vgcfgbackup: Warning: couldn't query all of the physical volumes.
vgcfgbackup: Couldn't query physical volume "/dev/dsk/c3t6d0":
The specified path does not correspond to physical volume attached to
this volume group
vgcfgbackup: Couldn't query physical volume "/dev/dsk/c3t6d0":
The specified path does not correspond to physical volume attached to
this volume group
將lvol1清理完成后再用lvdisplay看到如下正常信息。
# lvdisplay -kv /dev/vg00/lvol1|more
lvdisplay: Warning: couldn't query physical volume "/dev/dsk/c3t6d0":
The specified path does not correspond to physical volume attached to
this volume group
lvdisplay: Warning: couldn't query all of the physical volumes.
--- Logical volumes ---
LV Name /dev/vg00/lvol1
VG Name /dev/vg00
LV Permission read/write
LV Status available/syncd
Mirror copies 0
Consistency Recovery MWC
Schedule parallel
LV Size (Mbytes) 300
Current LE 75
Allocated PE 75
Stripes 0
Stripe Size (Kbytes) 0
Bad block off
Allocation strict/contiguous
IO Timeout (Seconds) default
--- Distribution of logical volume ---
PV Name LE on PV PE on PV
/dev/dsk/c3t5d0 75 75
--- Logical extents ---
LE PV1 PE1 Status 1
00000 1 00000 current
00001 1 00001 current
00002 1 00002 current
00003 1 00003 current
...... ......
這里仍有報(bào)錯(cuò)信息,這是由于c3t6d0仍在vg00這個(gè)卷組中有信息,后面再處理,現(xiàn)在先
在剩下的7個(gè)LV中用上面的pv_key的方法一一去掉c3t6d0的信息。完成后現(xiàn)在要將c3t6d0在vg00
里的信息刪掉,即從vg00中用vgreduce命令刪掉c3t6d0這個(gè)PV。
# vgreduce -f vg00
vgreduce: Couldn't query physical volume "/dev/dsk/c3t6d0":
The specified path does not correspond to physical volume attached to
this volume group
PV with key 0 sucessfully deleted from vg vg00
Repair done, please do the following steps.....:
1. save /etc/lvmtab to another file
2. remove /etc/lvmtab
3. use vgscan(1m) -v to re-create /etc/lvmtab
4. NOW use vgcfgbackup(1m) to save the LVM setup
這里vgreduce命令給出了四個(gè)清理LVM文件的步驟,按這個(gè)步驟一一完成就行。
# cp /etc/lvmtab /etc/lvmtab.bck
# rm -f /etc/lvmtab
# vgscan -v
Creating "/etc/lvmtab".
vgscan: Couldn't access the list of physical volumes for volume group "/dev/vg00".
Physical Volume "/dev/dsk/c0t0d0" contains no LVM information
/dev/vg00
/dev/dsk/c3t5d0
Scan of Physical Volumes Complete.
#vgcfgbackup
#setboot -p 10/0/15/1.5.0
#setboot -a 10/0/15/1.5.0
至此,全部完成了Mirror的清理工作,重新啟動(dòng)系統(tǒng),vgdisplay,lvdisplay等命令已經(jīng)不再
有報(bào)錯(cuò)信息了,完成了全部測(cè)試工作。
總結(jié):
在線清除故障根盤(pán)的Mirror信息步驟如下
1、用下面的命令確認(rèn)故障硬盤(pán)的pv_key
lvdisplay -kv /dev/vg00/lvol1
......
lvdisplay -kv /dev/vg00/lvol8
2、用pv_key的方試去掉LV中的故障硬盤(pán)的Mirror信息
for i in 1 2 3 4 5 6 7 8
do
lvreduce -k -m 0 /dev/vg00/lvol$i 0 --最后那個(gè)0是上面確認(rèn)的pv_key的值
done
3、vgreduce -f /dev/vg00
4、cp /etc/lvmtab /etc/lvmtab.bck
5、rm -f /etc/lvmtab
6、vgscan -v
7、vgcfgbackup
8、setboot -p
本文來(lái)自ChinaUnix博客,如果查看原文請(qǐng)點(diǎn):http://blog.chinaunix.net/u/4005/showart_349599.html |
|