关于 逻辑卷与镜像基础知识请看 HP文档。
目的:更换一块坏磁盘,恢复1+1镜像;
信息:主盘c2t1d0s2,坏盘c2t0d0s2,新盘c2t3d0,安腾,MIRROR/UX 1.0
# uname -a HP-UX rx6600a B.11.23 U ia64
处理三个故障: 1、从逻辑卷中删除坏卷遗留信息vgreduce,需要disk_path。 2、对新盘分区时提示操作异外idisk,提示‘User Aborting’,需要加参数q,即静默处理。 3、在设置镜像启动信息时需要写入备盘设备路径。
Tip:确定硬件设备型号与软件版本型,本设备是安腾类型,MIRROR/UX版本是1.0
Vgdiplay -v vg00时报错信息
vgdisplay: Warning: couldn't query physical volume "/dev/dsk/c2t0d0s2":The specified path does not correspond to physical volume attached tothis volume groupvgdisplay: Warning: couldn't query all of the physical volumes.
1、一切从源头开始,vgdisplay导致的错误需要第一个解决,把坏盘的遗留信息删除。 #vgreduce -f /dev/vg00 /dev/dsk/c2t0d0s2 (c2t0d0s2为坏盘,hbh231同学没有跟disk_path,导致我执行时有误) #rm /etc/lvmtab (删除逻辑卷data文件,可以先保存一份cp /etc/lvmtab /etc/lvmtab.old) #vgscan -v (重新扫描当前VG) #vgcfgbackup /dev/vg00 (保存vg00信息,此信息保存在/etc/lvmtab) #strings /etc/lvmtab (可以查看)
2、对新磁盘分区(此partitionfile文件存在的话,就不需要创建,同时需要依据分区信息进行配置,本次分三个区。) # vi /tmp/partitionfile 3 EFI 500MB HPUX 100% HPSP 400MB
+++++
Tip: 有的硬盘只分二个区(我没做啊,注意哦) # vi /tmp/partitionfile 2 EFI 500MB HPUX 100%
++++
3、对新硬盘进行分区 # idisk -qwf /tmp/partitionfile /dev/rdsk/c2t3d0 (请注意参数q)
本次中如果没有q,则出现如下报错。q参数表示静默执行 idisk version: 1.32 ********************** WARNING *********************** If you continue you may destroy all data on this disk. Do you wish to continue(yes/no)? y User Aborting!
4、在新分区上创建设备文件信息 #insf -eC disk insf: Installing special files for sdisk instance 5 address 0/0/2/1.0.16.0.0 insf: Installing special files for sdisk instance 3 address 0/4/1/0.0.0.1.0 insf: Installing special files for sdisk instance 7 address 0/4/1/0.0.0.3.0
5、验证分区信息 # idisk -pa /dev/rdsk/c2t3d0 idisk version: 1.32
EFI Primary Header: Signature = EFI PART Revision = 0x10000 HeaderSize = 0x5c HeaderCRC32 = 0x694c4070 MyLbaLo = 0x1 MyLbaHi = 0x0 AlternateLbaLo = 0x1117732f AlternateLbaHi = 0x0 FirstUsableLbaLo = 0x22 FirstUsableLbaHi = 0x0 LastUsableLbaLo = 0x1117730c LastUsableLbaHi = 0x0 Disk GUID = e56b40e0-d21a-11e0-8001-d6217b60e588 PartitionEntryLbaLo = 0x2 PartitionEntryLbaHi = 0x0 NumberOfPartitionEntries = 0xc SizeOfPartitionEntry = 0x80 PartitionEntryArrayCRC32 = 0xeb5ad28
Primary Partition Table (in 512 byte blocks): Partition 1 (EFI): Partition Type GUID = c12a7328-f81f-11d2-ba4b-00a0c93ec93b Unique Partition GUID = e56b4220-d21a-11e0-8002-d6217b60e588 Starting Lba Lo = 0x22 Starting Lba Hi = 0x0 Ending Lba Lo = 0xfa021 Ending Lba Hi = 0x0 Partition 2 (HP-UX): Partition Type GUID = 75894c1e-3aeb-11d3-b7c1-7b03a0000000 Unique Partition GUID = e56b423e-d21a-11e0-8003-d6217b60e588 Starting Lba Lo = 0xfa022 Starting Lba Hi = 0x0 Ending Lba Lo = 0x110af30b Ending Lba Hi = 0x0 Partition 3 (HPSP): Partition Type GUID = e2a1e728-32e3-11d6-a682-7b03a0000000 Unique Partition GUID = e56b425c-d21a-11e0-8004-d6217b60e588 Starting Lba Lo = 0x110af30c Starting Lba Hi = 0x0 Ending Lba Lo = 0x1117730b Ending Lba Hi = 0x0
EFI Alternate Header: Signature = EFI PART Revision = 0x10000 HeaderSize = 0x5c HeaderCRC32 = 0x20d60a42 MyLbaLo = 0x1117732f MyLbaHi = 0x0 AlternateLbaLo = 0x1 AlternateLbaHi = 0x0 FirstUsableLbaLo = 0x22 FirstUsableLbaHi = 0x0 LastUsableLbaLo = 0x1117730c LastUsableLbaHi = 0x0 Disk GUID = e56b40e0-d21a-11e0-8001-d6217b60e588 PartitionEntryLbaLo = 0x1117730e PartitionEntryLbaHi = 0x0 NumberOfPartitionEntries = 0xc SizeOfPartitionEntry = 0x80 PartitionEntryArrayCRC32 = 0xeb5ad28
Alternate Partition Table (in 512 byte blocks): Partition 1 (EFI): Partition Type GUID = c12a7328-f81f-11d2-ba4b-00a0c93ec93b Unique Partition GUID = e56b4220-d21a-11e0-8002-d6217b60e588 Starting Lba Lo = 0x22 Starting Lba Hi = 0x0 Ending Lba Lo = 0xfa021 Ending Lba Hi = 0x0 Partition 2 (HP-UX): Partition Type GUID = 75894c1e-3aeb-11d3-b7c1-7b03a0000000 Unique Partition GUID = e56b423e-d21a-11e0-8003-d6217b60e588 Starting Lba Lo = 0xfa022 Starting Lba Hi = 0x0 Ending Lba Lo = 0x110af30b Ending Lba Hi = 0x0 Partition 3 (HPSP): Partition Type GUID = e2a1e728-32e3-11d6-a682-7b03a0000000 Unique Partition GUID = e56b425c-d21a-11e0-8004-d6217b60e588 Starting Lba Lo = 0x110af30c Starting Lba Hi = 0x0 Ending Lba Lo = 0x1117730b Ending Lba Hi = 0x0
6、 把/efi/hpux/ 目录移支新的 EFI系统分区上. # mkboot -e -l /dev/rdsk/c2t3d0 (正常执行是无反馈的)
++++++
因为之前把新盘加过vg00,现在需要卷组中删除物理卷,如果之前新盘没有加入vg00的请略过。 # vgreduce /dev/vg00 /dev/dsk/c2t3d0 Volume group "/dev/vg00" has been successfully reduced. Volume Group configuration for /dev/vg00 has been saved in /etc/lvmconf/vg00.conf +++++++++
7、把新盘创建为新的pv,然后把此卷加入在vg00.因为是根镜像,所以需要B参数 # pvcreate -fB /dev/rdsk/c2t3d0s2Physical volume "/dev/rdsk/c2t3d0s2" has been successfully created. # vgextend vg00 /dev/dsk/c2t3d0s2 Volume group "vg00" has been successfully extended. Volume Group configuration for /dev/vg00 has been saved in /etc/lvmconf/vg00.conf
8、镜像vg00上原来所有逻辑卷lv。镜像前可以用vgdisplay查看一下vg00下有多少个逻辑卷。 lvextend -m 1 /dev/vg00/lvol1 /dev/dsk/c2t3d0s2 lvextend -m 1 /dev/vg00/lvol2 /dev/dsk/c2t3d0s2 lvextend -m 1 /dev/vg00/lvol3 /dev/dsk/c2t3d0s2 lvextend -m 1 /dev/vg00/lvol4 /dev/dsk/c2t3d0s2 lvextend -m 1 /dev/vg00/lvol5 /dev/dsk/c2t3d0s2 lvextend -m 1 /dev/vg00/lvol6 /dev/dsk/c2t3d0s2 lvextend -m 1 /dev/vg00/lvol7 /dev/dsk/c2t3d0s2 lvextend -m 1 /dev/vg00/lvol8 /dev/dsk/c2t3d0s2
命令执行情况,根据每个LV里的PE决定mirror时间。 # lvextend -m 1 /dev/vg00/lvol2 /dev/dsk/c2t3d0s2 The newly allocated mirrors are now being synchronized. This operation will take some time. Please wait ....
9、 改变启动文件,镜像自动切换 # echo "boot vmunix -lq" > /tmp/AUTO.lq # efi_cp -d /dev/rdsk/c2t3d0s1 /tmp/AUTO.lq /EFI/HPUX/AUTO # efi_cp -d /dev/rdsk/c2t1d0s1 -u /EFI/HPUX/AUTO /tmp/AUTO.pri # efi_cp -d /dev/rdsk/c2t3d0s1 -u /EFI/HPUX/AUTO /tmp/AUTO.alt # cat /tmp/AUTO.pri # cat /tmp/AUTO.alt AUTO.pri,AUTO.alt信息是一致的。
10、核实DBRA已经更新 # lvlnboot –v
11、增加EFI primary/high available 设置引导路径 # setboot -p 0/4/1/0.0.0.1.0 <-- Set primary disk 主盘 # setboot -h 0/4/1/0.0.0.3.0 <-- Set mirror disk 备盘 # setboot -b on <-- Set autoboot on # lvlnboot -v (查看启动信息) Boot Definitions for Volume Group /dev/vg00: Physical Volumes belonging in Root Volume Group: /dev/dsk/c2t1d0s2 (0/4/1/0.0.0.1.0) -- Boot Disk /dev/dsk/c2t3d0s2 (0/4/1/0.0.0.3.0) -- Boot Disk Boot: lvol1 on: /dev/dsk/c2t1d0s2 /dev/dsk/c2t3d0s2 Root: lvol3 on: /dev/dsk/c2t1d0s2 /dev/dsk/c2t3d0s2 Swap: lvol2 on: /dev/dsk/c2t1d0s2 /dev/dsk/c2t3d0s2 Dump: lvol2 on: /dev/dsk/c2t3d0s2, 0
另外做了一下这样的操作,不知道是否必要?? lvlnboot -b /dev/vg00/lvol1 lvlnboot -s /dev/vg00/lvol2 lvlnboot -d /dev/vg00/lvol2 lvlnboot -r /dev/vg00/lvol3
12、查看启用信息 # setboot Primary bootpath : 0/4/1/0.0.0.1.0 HA Alternate bootpath : 0/4/1/0.0.0.3.0 Alternate bootpath : 0/4/2/0
Autoboot is ON (enabled)
13、重新引导并测试
#shutdown –ry 0
在启用菜单中选择备用路径菜单 HA Alternate bootpath |