recover lvm

Asked by vincent on 2012-08-07

I try to recover a broken lvm. but i get failed message

 pvcreate -f -uuid gdg0bR-MuHt-xh7v-shmp-Q4I1-9Qo5-Vkr9bj --restorefile /etc/lvm/archive/vmaxe_pool_00020.vg /dev/mapper/mpath59

Can only set uuid on one volume at once
 Run `pvcreate --help' for more information.

root@Linux51:~# vgdisplay vmaxe_pool
  Couldn't find device with uuid gdg0bR-MuHt-xh7v-shmp-Q4I1-9Qo5-Vkr9bj.
  Couldn't find device with uuid ObBXgi-GBZF-8l72-ZBVQ-Pier-2gsA-iZsFsM.
  Couldn't find device with uuid F8r2wY-bLTU-BzUJ-LBE3-EKLZ-sTrN-Nfn4Bg.
  --- Volume group ---
  VG Name vmaxe_pool
  System ID
  Format lvm2
  Metadata Areas 1
  Metadata Sequence No 19
  VG Access read/write
  VG Status resizable
  MAX LV 0
  Cur LV 2
  Open LV 0
  Max PV 0
  Cur PV 4
  Act PV 1
  VG Size 22.48 GiB
  PE Size 4.00 MiB
  Total PE 5756
  Alloc PE / Size 5632 / 22.00 GiB
  Free PE / Size 124 / 496.00 MiB
  VG UUID b1xnvK-Obuc-T3ZJ-cdaA-nN0i-nvG7-nkbW5C

--------------------
vmaxe_pool {
        id = "b1xnvK-Obuc-T3ZJ-cdaA-nN0i-nvG7-nkbW5C"
        seqno = 18
        status = ["RESIZEABLE", "READ", "WRITE"]
        flags = []
        extent_size = 8192 # 4 Megabytes
        max_lv = 0
        max_pv = 0

        physical_volumes {

                pv0 {
                        id = "gdg0bR-MuHt-xh7v-shmp-Q4I1-9Qo5-Vkr9bj"
                        device = "/dev/mapper/mpath59" # Hint only

                        status = ["ALLOCATABLE"]
                        flags = []
                        dev_size = 11788800 # 5.62134 Gigabytes
                        pe_start = 384
                        pe_count = 1439 # 5.62109 Gigabytes
                }

                pv1 {
                        id = "ObBXgi-GBZF-8l72-ZBVQ-Pier-2gsA-iZsFsM"
                        device = "/dev/mapper/mpath60" # Hint only

                        status = ["ALLOCATABLE"]
                        flags = []
                        dev_size = 11788800 # 5.62134 Gigabytes
                        pe_start = 384
                        pe_count = 1439 # 5.62109 Gigabytes
                }

                pv2 {
                        id = "F8r2wY-bLTU-BzUJ-LBE3-EKLZ-sTrN-Nfn4Bg"
                        device = "/dev/mapper/mpath61" # Hint only

                        status = ["ALLOCATABLE"]
                        flags = []
                        dev_size = 11788800 # 5.62134 Gigabytes
                                 pe_start = 384
                        pe_count = 1439 # 5.62109 Gigabytes
                }

                pv3 {
                        id = "CheC5y-3zWe-x9L7-kHIU-zC55-eJWf-qz0LOC"
                        device = "/dev/mapper/mpath62" # Hint only

                        status = ["ALLOCATABLE"]
                        flags = []
                        dev_size = 11788800 # 5.62134 Gigabytes
                        pe_start = 384
                        pe_count = 1439 # 5.62109 Gigabytes
                }
        }

Appreciate somebody's help.

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu lvm2 Edit question
Assignee:
No assignee Edit question
Solved by:
vincent
Solved:
2012-08-08
Last query:
2012-08-08
Last reply:
vincent (vincent-y-chen) said : #1

finally i resolve this problem. Seems the those uuid has been allocate to pv which are recoreded in LVM archive, we need to clear it before. Attach here for other reference

1) remove missing pv component
vgreduce --removemissing vmaxe_pool
2) recreate pv
pvcreate --uuid gdg0bR-MuHt-xh7v-shmp-Q4I1-9Qo5-Vkr9bj --restorefile /etc/lvm/archive/vmaxe_pool_00019.vg /dev/mapper/mpath59
....
3) restore vg configuration
vgcfgrestore -f /etc/lvm/archive/vmaxe_pool_00019.vg vmaxe_pool