Description of problem: I attempted this cmd on some devices that didn't actually have any hardware snapshots. [root@taft-02 ~]# pvscan PV /dev/sdb1 VG taft lvm2 [135.66 GB / 135.66 GB free] PV /dev/sdc1 VG taft lvm2 [135.66 GB / 135.66 GB free] PV /dev/sdd1 VG taft lvm2 [135.66 GB / 135.66 GB free] PV /dev/sda2 VG VolGroup00 lvm2 [68.12 GB / 0 free] [root@taft-02 ~]# vgimportclone -n clone -t /dev/sdb1 Volume Group taft incomplete, skipping. Volume Group device,unknown exported, skipping. Volume Group device,/tmp/snap.Csmf7429/vgimport0, exported, skipping. Reading all physical volumes. This may take a while... Found volume group "taft" using metadata type lvm2 Found volume group "VolGroup00" using metadata type lvm2 You have a memory leak (not released memory pool): [0xc944680] You have a memory leak (not released memory pool): [0xc944680] # Shouldn't see "memory leak" messages. [root@taft-02 ~]# vgimportclone -n clone -t /dev/foobar Fatal: /dev/foobar is not a block device. # It'd be nice to see an error stating that "/dev/sdf1" is not in a VG, similar to the above message about block devices, but that's certainly a really low priority. [root@taft-02 ~]# vgimportclone -n clone -t /dev/sdf1 Fatal: Specified PV(s) () don't belong to a VG. Version-Release number of selected component (if applicable): lvm2-2.02.46-5.el5 How reproducible: Everytime
Tried this with as simple a vg as possible and saw the same errors. [root@taft-02 ~]# pvscan PV /dev/sdb1 VG VG lvm2 [135.66 GB / 135.66 GB free] PV /dev/sda2 VG VolGroup00 lvm2 [68.12 GB / 0 free] Total: 2 [203.79 GB] / in use: 2 [203.79 GB] / in no VG: 0 [0 ] [root@taft-02 ~]# vgs VG #PV #LV #SN Attr VSize VFree VG 1 0 0 wz--n- 135.66G 135.66G VolGroup00 1 2 0 wz--n- 68.12G 0 [root@taft-02 ~]# vgimportclone -n clone -t /dev/sdb1 WARNING: Activation disabled. No device-mapper interaction will be attempted. Test mode: Metadata will NOT be updated. Physical volume "/tmp/snap.DlRV7969/vgimport0" changed 1 physical volume changed / 0 physical volumes not changed WARNING: Activation disabled. No device-mapper interaction will be attempted. Test mode: Metadata will NOT be updated. Volume group "VG" successfully changed Test mode: Metadata will NOT be updated. Volume group "VG" successfully renamed to "clone" Reading all physical volumes. This may take a while... Found volume group "VG" using metadata type lvm2 Found volume group "VolGroup00" using metadata type lvm2 You have a memory leak (not released memory pool): [0x83e9680] You have a memory leak (not released memory pool): [0x83e9680]
Created attachment 347094 [details] verbose log from simple pv/vg example
Created attachment 347095 [details] verbose log from simple pv/vg example (with -d output)
I've committed various vgimportclone fixes to upstream's LVM2 cvs: - validate the specified device is a PV and that it is in a VG - automatically enable DEBUG (-d) if >= 4 -v instances were supplied - preserve TMP_LVM_SYSTEM_DIR if it contains an lvm.conf and -d was specified - fix handling of special-case where PV is listed as "unknown device" - more descriptive error when a PV is missing ("unknown device") - unset LVM_SYSTEM_DIR if it was not originally set - skip final vgscan if no changes were made Milan will be rolling these changes into the next 5.4 Beta rpm.
Fix in lvm2-2.02.46-8.el5.
Fix verified in lvm2-2.02.46-8.el5. [root@taft-02 ~]# pvscan PV /dev/sdd1 VG taft lvm2 [135.66 GB / 135.66 GB free] PV /dev/sda2 VG VolGroup00 lvm2 [68.12 GB / 0 free] PV /dev/sde1 lvm2 [135.67 GB] PV /dev/sdf1 lvm2 [135.67 GB] PV /dev/sdg1 lvm2 [135.67 GB] PV /dev/sdh1 lvm2 [135.67 GB] Total: 6 [746.45 GB] / in use: 2 [203.79 GB] / in no VG: 4 [542.66 GB] [root@taft-02 ~]# vgimportclone -n clone -t /dev/sdd1 WARNING: Activation disabled. No device-mapper interaction will be attempted. Test mode: Metadata will NOT be updated. Physical volume "/tmp/snap.CtH10118/vgimport0" changed 1 physical volume changed / 0 physical volumes not changed WARNING: Activation disabled. No device-mapper interaction will be attempted. Test mode: Metadata will NOT be updated. Volume group "taft" successfully changed Test mode: Metadata will NOT be updated. Volume group "taft" successfully renamed to "clone" Reading all physical volumes. This may take a while... Found volume group "taft" using metadata type lvm2 Found volume group "VolGroup00" using metadata type lvm2 [root@taft-02 ~]# vgimportclone -n clone -t /dev/sdh1 Fatal: /dev/sdh1 is not in a VG.
An advisory has been issued which should help the problem described in this bug report. This report is therefore being closed with a resolution of ERRATA. For more information on therefore solution and/or where to find the updated files, please follow the link below. You may reopen this bug report if the solution does not work for you. http://rhn.redhat.com/errata/RHBA-2009-1393.html