From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [10.34.131.19] (dhcp131-19.brq.redhat.com [10.34.131.19]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s5U9UlxN009911 for ; Mon, 30 Jun 2014 05:30:48 -0400 Message-ID: <53B12E46.4000605@redhat.com> Date: Mon, 30 Jun 2014 11:30:46 +0200 From: Zdenek Kabelac MIME-Version: 1.0 References: In-Reply-To: Content-Transfer-Encoding: 7bit Subject: Re: [linux-lvm] Read LVM structure of a virtual machine disk image Reply-To: LVM general discussion and development List-Id: LVM general discussion and development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , List-Id: Content-Type: text/plain; charset="us-ascii"; format="flowed" To: LVM general discussion and development Dne 30.6.2014 10:36, Matteo Lanati napsal(a): > Hi all, > > I have a file containing a disk image of a virtual machine. One of the partitions is LVM. > I would like to read the information in there (i.e. the volume group name or the list of logical volumes) from the file itself without exposing the device through kpartx and/or qemu-nbd. > My problem is that on the same physical host I could have multiple copies of the same virtual machine running, using same VGs and LVs. Even the UUID would be the same, hence the impossibility to distinguish the two virtual machines anymore. > Of course, if I could check beforehand the structure of the disk image I could take a different decision and avoid errors. > Thanks, That's why there is a 'filter' setting in your lvm.conf. You may set different device filter for each lvm command. You could either use '--config' option with each lvm command where you set your filter to view only given device - or eventually with latest versions you may try to use profiles. It's a users' fault to pass multiple same devices to lvm - it's mandatory to use different UUIDs, and it's upto user to choose how to achieve it. There is no way for lvm2 to resolve this inconsistency in come 'always-be-smart' way... Zdenek