Resolving LVM and Hard DiskPVID Issues
解决LVM和硬盘PVID问题
原文:http://www-01.ibm.com/support/docview.wss?uid=isg3T1019281
Technote (FAQ)
Question问题
Technote that discusses various issueswith PVIDs and how to resolve them. 关于PVIDs的各种各样的问题,如何解决
Answer答复
The Logical Volume Manager (LVM) on AIXuses a Physical Volume Identifier (PVID) to keep track of disk drives that arepart of an LVM volume group. This is a system-generated 16-digit number that isstored physically on the hard drive and read into the ODM. LVM also stores thisPVID in the Volume Group Descriptor Area (VGDA) for the volume group. Each PVIDon a system uniquely identifies one physical volume.
AIX的LVM使用一个PVID去跟踪LVM卷组中构成部分--磁盘驱动器这是一个系统产生的16位数值编号(物理存储在硬盘上)并都读入到ODM中。LVM也存储这个PVID到VGDA中。系统通过PVID来唯一识别每个物理卷。
Problems with PVIDs PVIDs的问题
Duplicate PVID重复的PVID
The same PVIDshows up on more than one disk. 有多个磁盘使用相同的PVID
Problem Diagnosis问题诊断
1. Verify that you have a duplicate PVID on multiple disks.验证你在多个磁盘上有重复的PVID
$ lspv
or
If you know the name of an imported volume group having the problem use:
$ lspv | grep VGNAME
The lspv command reads out of the ODM,it does not read the PVID from disk. We need to check if the PVID listed in theODM is the same as the PVID on disk.
Lspv命令读取ODM的信息,而不是从磁盘上读取PVID。我们需要检查磁盘上的PVID和ODM中所列的PVID是否相同。
2. To read the PVID off the disk, youmust log in as root or su to it, and use:以root用户身份登陆从磁盘上读取PVID,命令如下:
# lquerypv -h /dev/hdisk7 80 10
Example output:输出如下:
00000080 00021AC8 E561D594 00000000 00000000 |.....a..........|
The PVID of the disk is in columns 2 and 3.
磁盘的PVID在第2和3列
Possible Solution 1: ODM and PVID on Disk Do Not Match
可能解决方案1:ODM和磁盘的PVID不匹配
If the PVID on disk does not match the ODM output from lspv, use the chdevcommand to re-read the proper PVID in from disk and repopulate the ODM.
如果磁盘的PVID不匹配使用lspv显示的ODM中的PVID,使用chdev命令去从磁盘上重新读取正确的PVID且刷新ODM
Example:(以hdisk24为例)
例如:
ODM中的hdisk24的pvid
# lspv | grep hdisk24
hdisk24 deadbeefdeadbeef None
从硬盘上直接读取其PVID
# lquerypv -h/dev/hdisk24 80 10
00000080 00050A85 577D8A61 00000000 00000000 |....W}.a........|
So the ODM version does not match. Another way to verify this is to query theODM directly:
因为ODM版本不匹配。另一种方法可以直接查询OMD来进行验证:
# odmget -q"name=hdisk24 and attribute=pvid" CuAt
CuAt:
name = "hdisk24"
attribute = "pvid"
value = "deadbeefdeadbeef0000000000000000"
type = "R"
generic = "D"
rep = "s"
nls_index = 2
Force the system to re-read the PVID off disk and repopulate the ODM:
强制系统去重读磁盘上的PVID并刷新ODM,操作步骤如下:
# chdev -a pv=yes -l hdisk24
hdisk24 changed
Now check that lspv shows the correct PVID:
现在检查ODM中是否有正确的PVID:
# lspv | grep hdisk24
hdisk24 00050a85577d8a61 None
You can also double-check the ODM directly:
你也可以再次检查ODM:
# odmget -q "name=hdisk24 andattribute=pvid" CuAt
CuAt:
name = "hdisk24"
attribute = "pvid"
value = "00050a85577d8a610000000000000000"
type = "R"
generic = "D"
rep = "s"
nls_index = 2
Possible Solution 2: The Disks Are Copies of Each Other
可能的解决方案2:磁盘之间互备
In recent years, SAN storage has become a popular way to attach new disks tosystems using a fibrechannel network. Some of these SAN storage systems includea way to make a bit-for-bit copy of each disk (or LUN) in order to take that toanother site or computer. The copy is exact, down to the VGDA and PVID areas ofthe LUNs If both of these disks, the original and the copy, are zoned to thesame host and seen by cfgmgr, it will cause the system to show duplicate PVIDsin commands such as lspv, lsvg, and in the ODM.
近年,SAN存储已经变成一种使用光纤通道网络扩容新磁盘到系统中的办法。这些SAN存储系统中包含一种LUN或者每盘的位到位的副本(为了实现端到端容灾)。副本是精确的,如果LUNs的VGDA和PVID区,源和副本,通过cfgmgr查看时,它将引起例如lspv,lsvg命令中显示重复的PVIDs(ODM中)
Varyonvg (either called from importvg or varyonvg) will fail due to duplicatePVIDs:
varyonvg(或者importvg或varyonvg)将因为重复的PVIDs失败,如:
# importvg -y datavg hdisk20
0516-1775varyonvg: Physical volumes hdisk21 and hdisk20 have identical PVIDs(00050a85470c2eeb).
0516-780importvg: Unable to import volume group from hdisk20.
以上显示:卷hdisk21,和hdisk20有相同的PVIDs,不能导入从hdisk20上导入卷组。
A. Find out if these disks are indeed copies of each other. If a copy ofthe volume group on the second disk (or set of disks) is not needed, theVGDA and PVID areas can be wiped out, allowing the user to create a new volume groupon the disks.
发现这些磁盘确实彼此互备。如果在di’er个磁盘上的卷组的一部分是bu 需要的,VGDA和PVID区域可以被wipe out擦掉,允许用户在磁盘上去创建一个新的卷组。
One word of warning, this is a permanent change to the disks.
由于这是一个永久性的变更,将会告警。
First, wipe the PVID off the drive using:
首先,使用以下命令擦除PVID
# chdev -a pv=clear -l hdiskX (If using another path manager, thename may be different)
Next clear the VGDA off the drive:
接下来清除VGDA
# chpv -C hdiskX
Then you may use the mkvg command to create a new volume group on the disks, oradd them to an existing volume group with extendvg.
接着你或许使用mkvg命令去创建一个新的卷组(在磁盘上),或者添加他们到一个已经存在卷组上(使用extendvg)
B. If, however, the disks are copies of each other for use in a backupstrategy, and BOTH the source and backup (or target) volume group need to existon the same machine, then the target volume group will need to be importedusing recreatevg. The benefit of using recreatevg is that it can changethe PVIDs of the disks as it imports the volume group, and update the VGDA withthose new PVIDs.
如果,在备份策略中就是需要互备,源和目标卷组需要同时存在同一机器上,接着目标卷组将需要使用recreatevg命令重新导入。Recreatevg的好处是一旦磁盘导入到卷组时,它可以改变磁盘的PVIDs,并使用新的PVIDs去更新VGDA。
It should be noted at this point thatAIX does not allow two logical volumes to have the same name, or twofilesystems to have the same mount point. The recreatevg command by defaultwill change the logical volume names and mount points, since it is meant forrecreating an existing volume group.
它应该提醒注意:AIX不允许两个逻辑卷有相同的名字或者两个文件系统有相同的绑定点。Recreatevg命令默认将改变逻辑卷名和绑定点,因此这也意味着重建了一个已存在的卷组。
By default recreatevg will change theexisting logical volume names by prefixing them with the string "fs"and prefixing the filesystem mount point paths with "/fs". These canbe changed by using the -L and -Y flags to recreatevg.
默认recreatevg将改变已存在的逻辑卷名(通过fs前缀),绑定点用/fs前缀。这些可以在使用recreatevg 的-L和-Y标识来改变。
For example, if I have a volume group "origvg" with a filesystem andlog device, and a SAN copy of it on hdisk6:
例如,如果我有一个卷组origvg(用于一个文件系统和日志设备),且在hdisk6上有一个SAN 副本:
# lsvg -l origvg
origvg:
LV NAME TYPE LPs PPs PVs LV STATE MOUNT POINT
loglv01 jfs2log 1 1 1 closed/syncd N/A
fslv02 jfs2 256 256 1 closed/syncd /data
# lspv | grep origvg
hdisk5 00050a85ef3356ec origvg active
hdisk6 00050a85ef3356ec origvg active
I can clear the PVID off hdisk6 and then run recreatevg against it:
我可以清空hdisk6上的PVID,接着运行recreatevg
# chdev -a pv=clear -l hdisk6
hdisk6 changed
# lspv
hdisk5 00050a85ef3356ec origvg active
hdisk6 none None
# recreatevg -y copyvg hdisk6
copyvg
hdisk5 00050a85ef3356ec origvg active
hdisk6 00050a85ee6d1446 copyvg active
# lsvg -l copyvg
copyvg:
LV NAME TYPE LPs PPs PVs LV STATE MOUNT POINT
fsloglv01 jfs2log 1 1 1 closed/syncd N/A
fsfslv02 jfs2 256 256 1 closed/syncd N/A
Possible Solution 3: PVIDs Exist on Individual Disk Paths Rather Than onMultipath Device
可能的解决方案3:PVIDs存在独立的磁盘路径上
Example using SDD multipathing:例如使用SDD多路径:
vpath34 Available Data Path Optimizer Pseudo Device Driver
This vpath is made up of he following hdisks.
这个vpath由以下hdisks构成:
hdisk138Available 01-01-02
U789D.001.DQD35BK-P1-C2-T2-W5005076801402F1D-L22000000000000FC 2145
hdisk139Available 01-01-02
U789D.001.DQD35BK-P1-C2-T2-W5005076801402F2D-L22000000000000FC 2145
hdisk140Available 03-00-02
U789D.001.DQD35PG-P1-C6-T1-W5005076801302F2D-L22000000000000FC 2145
hdisk141Available 03-00-02
U789D.001.DQD35PG-P1-C6-T1-W5005076801302F1D-L22000000000000FC 2145
---------------------------------------------------------------------
From lspv output:
hdisk138 none None
hdisk139 none None
hdisk140 none None
hdisk141 none None
vpath34 00cb3e924851eb12 oravg1
This is the correct configuration for a vpath, where the PVID is associatedwith the vpath device in the ODM.
这是一个vpath的正确的配置,在ODM中的vpath设备关联PVID。
If the PVID appears on the individual paths (hdisks) then it can be moved usingone of two SDD commands:
如果PVID出现在独立的路径上,也可以使用两条SDD命令去移动:
hd2vp The SDD script that converts an hdisk device volume group to an
SDD vpath device volume group.
hd2vp 这个SDD脚本可以转换一个hdisk设备卷组到一个SDDvpath的设备的卷组。
dpovgfix The command that fixes an SDD volumegroup that has mixed
vpath and hdisk physical volumes.
dpovgfix 这条命令可以修正一个SDD卷组(混合了vpath和hdisk物理卷的卷组)
This can occur with any multipath driver that creates a pseudo-device to beused for access to the LUN. Another example of this is EMC PowerPath which usesan "hdiskpowerX" pseudo-device, which should have the PVID on it,while the individual paths are listed as "hdiskX" with no pvid orvolume group association.
这可以引起用多路径驱动创建一个伪设备用于去访问LUN。比如EMC powerpath创建的hdiskpowerX伪设备上应该有一个PVID,而hdiskX上没有PVID关联关系。