[ 天羽]pv問題定位,pvid重複

idba發表於2009-08-04

本來應該要hdiskpower73屬於vg_db2,hdiskpower144屬於vg_db4,現在發現hdiskpower73和hdiskpower144實際上好像是同一塊盤,無法分別在兩個VG裡。
怎麼解決?
問題現象

host:/@root>#extendvg vg_db2 hdiskpower73

  • .(此時hdiskpower144在vg_db4)

    0516-1398 extendvg: The physical volume hdiskpower73, appears to belong to
    another volume group. Use the force option to add this physical volume
    to a volume group
    0516-792 extendvg: Unable to extend volume group.
    host:/@root>#extendvg -f vg_db2 hdiskpower73
    host:/@root>#lsvg -p vg_db2

    vg_db2:
    PV_NAME PV STATE TOTAL PPs FREE PPs FREE DISTRIBUTION
    hdiskpower51 active 725 724 145..144..145..145..145
    hdiskpower52 active 725 724 145..144..145..145..145
    hdiskpower53 active 725 724 145..144..145..145..145
    hdiskpower54 active 725 724 145..144..145..145..145
    hdiskpower55 active 725 725 145..145..145..145..145
    hdiskpower56 active 725 725 145..145..145..145..145
    hdiskpower57 active 725 725 145..145..145..145..145
    hdiskpower58 active 725 725 145..145..145..145..145
    hdiskpower59 active 725 725 145..145..145..145..145
    hdiskpower60 active 725 725 145..145..145..145..145
    hdiskpower61 active 725 725 145..145..145..145..145
    hdiskpower62 active 725 725 145..145..145..145..145
    hdiskpower63 active 725 725 145..145..145..145..145
    hdiskpower64 active 725 725 145..145..145..145..145
    hdiskpower65 active 725 725 145..145..145..145..145
    hdiskpower66 active 725 725 145..145..145..145..145
    hdiskpower67 active 725 725 145..145..145..145..145
    hdiskpower68 active 725 725 145..145..145..145..145
    hdiskpower69 active 725 725 145..145..145..145..145
    hdiskpower70 active 725 725 145..145..145..145..145
    hdiskpower71 active 725 725 145..145..145..145..145
    hdiskpower72 active 725 725 145..145..145..145..145
    hdiskpower144 active 725 725 145..145..145..145..145
    hdiskpower74 active 725 725 145..145..145..145..145
    hdiskpower75 active 725 725 145..145..145..145..145
    hdiskpower76 active 725 725 145..145..145..145..145
    hdiskpower77 active 725 725 145..145..145..145..145
    hdiskpower78 active 725 725 145..145..145..145..145
    hdiskpower79 active 725 725 145..145..145..145..145
    hdiskpower80 active 725 725 145..145..145..145..145
    hdiskpower81 active 725 725 145..145..145..145..145
    hdiskpower82 active 725 725 145..145..145..145..145
    hdiskpower83 active 725 725 145..145..145..145..145
    hdiskpower84 active 725 725 145..145..145..145..145
    hdiskpower85 active 725 725 145..145..145..145..145
    hdiskpower86 active 725 725 145..145..145..145..145

    host:/@root>#lspv hdiskpower73

    PHYSICAL VOLUME: hdiskpower144 VOLUME GROUP: vg_db2
    PV IDENTIFIER: 00c4b454e06cf223 VG IDENTIFIER 00c4b45400004c0000000120f125e3da
    PV STATE: active
    STALE PARTITIONS: 0 ALLOCATABLE: yes
    PP SIZE: 32 megabyte(s) LOGICAL VOLUMES: 0
    TOTAL PPs: 725 (23200 megabytes) VG DESCRIPTORS: 1
    FREE PPs: 725 (23200 megabytes) HOT SPARE: no
    USED PPs: 0 (0 megabytes) MAX REQUEST: 256 kilobytes
    FREE DISTRIBUTION: 145..145..145..145..145
    USED DISTRIBUTION: 00..00..00..00..00

    host:/@root>#lspv hdiskpower144

    PHYSICAL VOLUME: hdiskpower144 VOLUME GROUP: vg_db2
    PV IDENTIFIER: 00c4b454e06cf223 VG IDENTIFIER 00c4b45400004c0000000120f125e3da
    PV STATE: active
    STALE PARTITIONS: 0 ALLOCATABLE: yes
    PP SIZE: 32 megabyte(s) LOGICAL VOLUMES: 0
    TOTAL PPs: 725 (23200 megabytes) VG DESCRIPTORS: 1
    FREE PPs: 725 (23200 megabytes) HOT SPARE: no
    USED PPs: 0 (0 megabytes) MAX REQUEST: 256 kilobytes
    FREE DISTRIBUTION: 145..145..145..145..145
    USED DISTRIBUTION: 00..00..00..00..00

    lspv –p vg_db4,發現hdiskpower144不在vg_db4上了,那麼,把hdiskpower144加入vg_db4,修改hdiskpower73成vg_db2的VGID,這樣應該就可以在不同的VG上了。
    改hdiskpower73的VGID
    ./chvgid.sh f125e3da hdiskpower73

    chvgid.sh的內容:
    cat > chvgid.sh
    #!/usr/bin/ksh
    vgid=$1
    disk=$2

    set -A a `echo $vgid|\
    awk '{
    for (f=1; f <= length($0); f=f+2) {
    print "ibase=16\nobase=8\n"toupper(substr($0,f,2))
    }
    }'|bc 2>/dev/null`
    /usr/bin/echo “\0″${a[0]}”\0″${a[1]}”\0″${a[2]}”\0″${a[3]}”\c”|dd bs=1 seek=3600 f=/dev/$disk

    lspv hdiskpower73,發現被指向hdiskpower77,hdiskpower77屬於vg_db2。hdiskpower144在vg_db4上正常工作,這樣問題應該在hdiskpower73。

    刪掉hdiskpower73重新認
    host:/@root>#varyoffvg vg_db2
    host:/@root>#rmdev -dl hdiskpower73
    hdiskpower73 deleted
    host:/@root>#cfgmgr
    發現問題依舊,檢視磁碟的pvid

    host:/@root>#lquerypv -h /dev/hdiskpower73
    00000000 C9C2D4C1 00000000 00000000 00000000 |................|
    00000010 00000000 00000000 00000000 00000000 |................|
    00000020 00000000 00000000 00000000 00000000 |................|
    00000030 00000000 00000000 00000000 00000000 |................|
    00000040 00000000 00000000 00000000 00000000 |................|
    00000050 00000000 00000000 00000000 00000000 |................|
    00000060 00000000 00000000 00000000 00000000 |................|
    00000070 00000000 00000000 00000000 00000000 |................|
    00000080 00C4B454 E074AE5E 00000000 00000000 |...T.t.^........|
    00000090 00000000 00000000 00000000 00000000 |................|
    000000A0 00000000 00000000 00000000 00000000 |................|
    000000B0 00000000 00000000 00000000 00000000 |................|
    000000C0 00000000 00000000 00000000 00000000 |................|
    000000D0 00000000 00000000 00000000 00000000 |................|
    000000E0 00000000 00000000 00000000 00000000 |................|
    000000F0 00000000 00000000 00000000 00000000 |................|

    檢視hdiskpower77的pvid

    host:/@root>#lquerypv -h /dev/hdiskpower77
    00000000 C9C2D4C1 00000000 00000000 00000000 |................|
    00000010 00000000 00000000 00000000 00000000 |................|
    00000020 00000000 00000000 00000000 00000000 |................|
    00000030 00000000 00000000 00000000 00000000 |................|
    00000040 00000000 00000000 00000000 00000000 |................|
    00000050 00000000 00000000 00000000 00000000 |................|
    00000060 00000000 00000000 00000000 00000000 |................|
    00000070 00000000 00000000 00000000 00000000 |................|
    00000080 00C4B454 E074AE5E 00000000 00000000 |...T.t.^........|
    00000090 00000000 00000000 00000000 00000000 |................|
    000000A0 00000000 00000000 00000000 00000000 |................|
    000000B0 00000000 00000000 00000000 00000000 |................|
    000000C0 00000000 00000000 00000000 00000000 |................|
    000000D0 00000000 00000000 00000000 00000000 |................|
    000000E0 00000000 00000000 00000000 00000000 |................|
    000000F0 00000000 00000000 00000000 00000000 |................|

    發現hdiskpower73和hdiskpower77的PVID是一樣的,把hdiskpower73的pvid重置一下。
    host:/@root>#
    host:/@root>#chdev -l hdiskpower73 -a pv=clear
    hdiskpower73 changed
    host:/@root>#lspv hdiskpower73
    0516-304 : Unable to find device id hdiskpower73 in the Device
    Configuration Database.

    host:/@root>#lquerypv -h /dev/hdiskpower73

    00000000 C9C2D4C1 00000000 00000000 00000000 |................|
    00000010 00000000 00000000 00000000 00000000 |................|
    00000020 00000000 00000000 00000000 00000000 |................|
    00000030 00000000 00000000 00000000 00000000 |................|
    00000040 00000000 00000000 00000000 00000000 |................|
    00000050 00000000 00000000 00000000 00000000 |................|
    00000060 00000000 00000000 00000000 00000000 |................|
    00000070 00000000 00000000 00000000 00000000 |................|
    00000080 00000000 00000000 00000000 00000000 |................|
    00000090 00000000 00000000 00000000 00000000 |................|
    000000A0 00000000 00000000 00000000 00000000 |................|
    000000B0 00000000 00000000 00000000 00000000 |................|
    000000C0 00000000 00000000 00000000 00000000 |................|
    000000D0 00000000 00000000 00000000 00000000 |................|
    000000E0 00000000 00000000 00000000 00000000 |................|
    000000F0 00000000 00000000 00000000 00000000 |................|

    清除了hdiskpower73的PVID後,重認。
    host:/@root>#chdev -l hdiskpower73 -a pv=yes
    hdiskpower73 changed
    host:/@root>#lquerypv -h /dev/hdiskpower73
    00000000 C9C2D4C1 00000000 00000000 00000000 |…………….|
    00000010 00000000 00000000 00000000 00000000 |…………….|
    00000020 00000000 00000000 00000000 00000000 |…………….|
    00000030 00000000 00000000 00000000 00000000 |…………….|
    00000040 00000000 00000000 00000000 00000000 |…………….|
    00000050 00000000 00000000 00000000 00000000 |…………….|
    00000060 00000000 00000000 00000000 00000000 |…………….|
    00000070 00000000 00000000 00000000 00000000 |…………….|
    00000080 00C4B454 FE6F2375 00000000 00000000 |…T.o#u……..|
    00000090 00000000 00000000 00000000 00000000 |…………….|
    000000A0 00000000 00000000 00000000 00000000 |…………….|
    000000B0 00000000 00000000 00000000 00000000 |…………….|
    000000C0 00000000 00000000 00000000 00000000 |…………….|
    000000D0 00000000 00000000 00000000 00000000 |…………….|
    000000E0 00000000 00000000 00000000 00000000 |…………….|
    000000F0 00000000 00000000 00000000 00000000 |…………….|

    host:/@root>#varyonvg vg_db2
    host:/@root>#lspv hdiskpower73
    0516-320 : Physical volume hdiskpower73 is not assigned to
    a volume group.
    host:/@root>#extendvg vg_db2 hdiskpower73
    0516-1398 extendvg: The physical volume hdiskpower73, appears to belong to
    another volume group. Use the force option to add this physical volume
    to a volume group.
    0516-792 extendvg: Unable to extend volume group.
    host:/@root>#extendvg -f vg_db2 hdiskpower73
    最後檢查一下:

    host:/@root>#lsvg -p vg_db2
    vg_db2:
    PV_NAME PV STATE TOTAL PPs FREE PPs FREE DISTRIBUTION
    hdiskpower51 active 725 724 145..144..145..145..145
    hdiskpower52 active 725 724 145..144..145..145..145
    hdiskpower53 active 725 724 145..144..145..145..145
    hdiskpower54 active 725 724 145..144..145..145..145
    hdiskpower55 active 725 725 145..145..145..145..145
    hdiskpower56 active 725 725 145..145..145..145..145
    hdiskpower57 active 725 725 145..145..145..145..145
    hdiskpower58 active 725 725 145..145..145..145..145
    hdiskpower59 active 725 725 145..145..145..145..145
    hdiskpower60 active 725 725 145..145..145..145..145
    hdiskpower61 active 725 725 145..145..145..145..145
    hdiskpower62 active 725 725 145..145..145..145..145
    hdiskpower63 active 725 725 145..145..145..145..145
    hdiskpower64 active 725 725 145..145..145..145..145
    hdiskpower65 active 725 725 145..145..145..145..145
    hdiskpower66 active 725 725 145..145..145..145..145
    hdiskpower67 active 725 725 145..145..145..145..145
    hdiskpower68 active 725 725 145..145..145..145..145
    hdiskpower69 active 725 725 145..145..145..145..145
    hdiskpower70 active 725 725 145..145..145..145..145
    hdiskpower71 active 725 725 145..145..145..145..145
    hdiskpower72 active 725 725 145..145..145..145..145
    hdiskpower73 active 725 725 145..145..145..145..145
    hdiskpower74 active 725 725 145..145..145..145..145
    hdiskpower75 active 725 725 145..145..145..145..145
    hdiskpower76 active 725 725 145..145..145..145..145
    hdiskpower77 active 725 725 145..145..145..145..145
    hdiskpower78 active 725 725 145..145..145..145..145
    hdiskpower79 active 725 725 145..145..145..145..145
    hdiskpower80 active 725 725 145..145..145..145..145
    hdiskpower81 active 725 725 145..145..145..145..145
    hdiskpower82 active 725 725 145..145..145..145..145
    hdiskpower83 active 725 725 145..145..145..145..145
    hdiskpower84 active 725 725 145..145..145..145..145
    hdiskpower85 active 725 725 145..145..145..145..145
    hdiskpower86 active 725 725 145..145..145..145..145

    host:/@root>#lspv hdiskpower73
    PHYSICAL VOLUME: hdiskpower73 VOLUME GROUP: vg_db2
    PV IDENTIFIER: 00c4b454fe6f2375 VG IDENTIFIER 00c4b45400004c0000000120f125e3da
    PV STATE: active
    STALE PARTITIONS: 0 ALLOCATABLE: yes
    PP SIZE: 32 megabyte(s) LOGICAL VOLUMES: 0
    TOTAL PPs: 725 (23200 megabytes) VG DESCRIPTORS: 1
    FREE PPs: 725 (23200 megabytes) HOT SPARE: no
    USED PPs: 0 (0 megabytes) MAX REQUEST: 256 kilobytes
    FREE DISTRIBUTION: 145..145..145..145..145
    USED DISTRIBUTION: 00..00..00..00..00

    PVID 是由裝置系列號加上一個時間戳組成的,很少有機會重複,關於重複PVID,可以參考:
    http://www-01.ibm.com/support/docview.wss?uid=isg1IY88240

    <!--
  • 來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/1384/viewspace-611331/,如需轉載,請註明出處,否則將追究法律責任。

    相關文章