LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Hardware (https://www.linuxquestions.org/questions/linux-hardware-18/)
-   -   Unable to Change UUID of Cloned Drive - "Device Left Open"? (https://www.linuxquestions.org/questions/linux-hardware-18/unable-to-change-uuid-of-cloned-drive-device-left-open-4175470893/)

cowmoo32 07-25-2013 11:18 AM

Unable to Change UUID of Cloned Drive - "Device Left Open"?
 
I have a drive that I cloned using clonezilla. I am trying to add the logical volume to a new LV group so I can rsync updated files, but first I need to change the UUID because right now it's showing up the same as the drive on /dev/sda1. I run
Code:

pvchange --uuid /dev/sdb2
and I get the following error message

Code:

  Found duplicate PV 7CBVufOmlK2OnUUVM0O7nAs8I3zvOFKg: using /dev/sda2 not /dev/sdb2
  Unable to find /dev/sdb2 in vg_4brxrc1
  0 physical volumes changed / 0 physical volumes not changed
  Internal error: Volume Group vg_4brxrc1 was not unlocked
  Device '/dev/sda2' has been left open.
  Device '/dev/sdb2' has been left open.
  Device '/dev/sdb2' has been left open.
  Device '/dev/sdb2' has been left open.
  Device '/dev/sda2' has been left open.
  Device '/dev/sdb2' has been left open.
  Device '/dev/sda2' has been left open.
  Device '/dev/sda2' has been left open.
  Device '/dev/sdb2' has been left open.
  Device '/dev/sda2' has been left open.
  You have a memory leak (not released memory pool):
  [0x188a140] format_instance
  [0x1c80c50] read_vg
  Internal error: Unreleased memory pool(s) found.

Some googling lead me to bug reports that say it has been fixed with the newest version of lvm2, which I have.

Shadow_7 07-25-2013 02:03 PM

Have you rebooted. A memory leak is RAM, not HDD. Is there swap space available on the system? It's used as virtual ram when physical ram is not available.

cowmoo32 07-25-2013 04:08 PM

Yes, I have tried rebooting. There is plenty of swap and memory available. This is essentially a fresh install that I have cloned.

Shadow_7 07-26-2013 01:56 AM

Did you force the UUID when you "cloned" the system? The UUID is partition specific and generated when you mkfs the filesystem. You might use blkid to check the UUID of each component device.

Code:

  Found duplicate PV 7CBVufOmlK2OnUUVM0O7nAs8I3zvOFKg: using /dev/sda2 not /dev/sdb2
  Unable to find /dev/sdb2 in vg_4brxrc1

Seems to be the bulk of the issue. Noticing how it's trying to use device names and not UUIDs. Not that I have any clue how to fix it.

modonnell 07-26-2013 07:08 AM

You didn't say specifically what is was that you "cloned" (entire physical drive? partition? LV?) so when you say you're trying to "add the logical volume to a new LV group" I'm not sure if you wish to add a partition from a cloned physical drive, or a cloned copy of a partition now residing in another partition, etc, etc...

Anyway, have you tried vgimportclone?

SYNOPSIS
vgimportclone [-n|--basevgname VolumeGroupName] [-i|--import] PhysicalVolume [PhysicalVolume...]

DESCRIPTION
vgimportclone is used to import a duplicated VG (e.g. hardware snapshot). Duplicate VG(s) and PV(s) are not able to be used until they are made to coexist with the origin VG(s) and PV(s). vgimportclone renames the VG associated with the specified PV(s) and changes the associated VG and PV UUIDs.

cowmoo32 07-26-2013 02:26 PM

I cloned the entire drive, two partitions, a small ext4 boot partition and a larger LVM2 partition. I just booted to separate (third) drive and tried pvhcange again

Code:

# pvchange --uuid /dev/sdb2
  Volume group containing /dev/sdb2 has active logical volumes
  0 physical volumes changed / 1 physical volume not change

I'll try booting with both cloned drives in the machine and run vgimportclone and report back.

edit: It seems to have worked. I'll try to mount it to be sure
Code:

# vgimportclone  --basevgname vg_4brxrc1 /dev/sda2 /dev/sdb2
  WARNING: Activation disabled. No device-mapper interaction will be attempted.
  Found duplicate PV 7CBVufOmlK2OnUUVM0O7nAs8I3zvOFKg: using /tmp/snap.vC3D9qKh/vgimport0 not /tmp/snap.vC3D9qKh/vgimport1
  Unable to find /tmp/snap.vC3D9qKh/vgimport1 in vg_4brxrc1
  0 physical volumes changed / 0 physical volumes not changed
  Internal error: Volume Group vg_4brxrc1 was not unlocked
  Device '/tmp/snap.vC3D9qKh/vgimport0' has been left open.
  Device '/tmp/snap.vC3D9qKh/vgimport1' has been left open.
  You have a memory leak (not released memory pool):
  [0x19d7710] format_instance
  [0x1dcd710] read_vg
  Internal error: Unreleased memory pool(s) found.
  WARNING: Activation disabled. No device-mapper interaction will be attempted.
  Found duplicate PV 7CBVufOmlK2OnUUVM0O7nAs8I3zvOFKg: using /tmp/snap.vC3D9qKh/vgimport1 not /tmp/snap.vC3D9qKh/vgimport0
  Volume group "vg_4brxrc1" successfully changed
  Found duplicate PV 7CBVufOmlK2OnUUVM0O7nAs8I3zvOFKg: using /tmp/snap.vC3D9qKh/vgimport1 not /tmp/snap.vC3D9qKh/vgimport0
  Volume group "vg_hallen4brxrc1" successfully renamed to "vg_4brxrc11"
  Reading all physical volumes.  This may take a while...
  Found duplicate PV 7CBVufOmlK2OnUUVM0O7nAs8I3zvOFKg: using /dev/sdb2 not /dev/sda2
  Found volume group "vg_4brxrc11" using metadata type lvm2



edit2:
It worked, thanks for the help. I was able to mount /dev/vg_4brxrc11/lv_root and /dev/vg_4brxrc11/lv_home without any problems.


All times are GMT -5. The time now is 02:45 AM.