All of lore.kernel.org
 help / color / mirror / Atom feed
* [linux-lvm] Mounting an LVM disk image.
@ 2010-01-19  2:15 Jason Dusek
  2010-01-19  3:01 ` J Nb
  2010-01-19  3:32 ` malahal
  0 siblings, 2 replies; 5+ messages in thread
From: Jason Dusek @ 2010-01-19  2:15 UTC (permalink / raw)
  To: linux-lvm

  I'm trying to mount a disk image that contains an LVM volume.
  I've managed to follow this tutorial to the point where I've
  got the volume on `/dev/loop7':

    http://www.thegibson.org/blog/archives/467

  Now I want to mount the image. My machine, a CentOS machine,
  is already using LVM; running `lvm pvscan' shows me that the
  the disk image has been stuck in `VolGroup00' with the rest of
  them:

   :; lvm pvscan
    PV /dev/loop7   VG VolGroup00   lvm2 [7.88 GB / 0    free]
    PV /dev/sda5    VG VolGroup00   lvm2 [133.06 GB / 0    free]
    PV /dev/sdb2    VG VolGroup00   lvm2 [135.16 GB / 0    free]
    Total: 3 [276.09 GB] / in use: 3 [276.09 GB] / in no VG: 0 [0   ]

  At this point in the tutorial, I run in to trouble. As they
  suggest, I run `lvm vgchange -ay' and then inspect
  `/dev/mapper':

   :; lvm vgchange -ay
    2 logical volume(s) in volume group "VolGroup00" now active
    2 logical volume(s) in volume group "VolGroup00" now active
   :; ls /dev/mapper/
    control  VolGroup00-LogVol00  VolGroup00-LogVol01

  Mounting fails:

   :;  mount -t ext2 /dev/mapper/VolGroup00-LogVol01 /media/img/
    mount: /dev/mapper/VolGroup00-LogVol01 already mounted or /media/img/ busy
   :;  mount -t ext2 /dev/mapper/VolGroup00-LogVol00 /media/img/
    mount: /dev/mapper/VolGroup00-LogVol00 already mounted or /media/img/ busy
    mount: according to mtab, /dev/mapper/VolGroup00-LogVol00 is mounted on /

  At this point, I'm stuck. I've tried removing `/dev/loop7'
  from the volume group, to no avail:

   :; vgcreate shim /dev/loop7
    Physical volume '/dev/loop7' is already in volume group 'VolGroup00'
    Unable to add physical volume '/dev/loop7' to volume group 'shim'.
   :; vgreduce VolGroup00 /dev/loop7
    Physical Volume "/dev/loop7" not found in Volume Group "VolGroup00"

  What's the right way to mount and LVM disk image? I'm doing it
  to perform maintenance on a Xen guest.

--
Jason Dusek

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [linux-lvm] Mounting an LVM disk image.
  2010-01-19  2:15 [linux-lvm] Mounting an LVM disk image Jason Dusek
@ 2010-01-19  3:01 ` J Nb
  2010-01-19  3:32 ` malahal
  1 sibling, 0 replies; 5+ messages in thread
From: J Nb @ 2010-01-19  3:01 UTC (permalink / raw)
  To: LVM general discussion and development

Try using the -U option and specify the uuid of the correct vg.
U can get vg uuid using vgdisplay.

-nb

--- On Mon, 1/18/10, Jason Dusek <jason.dusek@gmail.com> wrote:

> From: Jason Dusek <jason.dusek@gmail.com>
> Subject: [linux-lvm] Mounting an LVM disk image.
> To: linux-lvm@redhat.com
> Date: Monday, January 18, 2010, 6:15 PM
> � I'm trying to mount a disk
> image that contains an LVM volume.
> � I've managed to follow this tutorial to the point
> where I've
> � got the volume on `/dev/loop7':
> 
> � � http://www.thegibson.org/blog/archives/467
> 
> � Now I want to mount the image. My machine, a CentOS
> machine,
> � is already using LVM; running `lvm pvscan' shows me
> that the
> � the disk image has been stuck in `VolGroup00' with
> the rest of
> � them:
> 
> ���:; lvm pvscan
> � � PV /dev/loop7���VG
> VolGroup00���lvm2 [7.88 GB / 0� �
> free]
> � � PV /dev/sda5� � VG
> VolGroup00���lvm2 [133.06 GB / 0� �
> free]
> � � PV /dev/sdb2� � VG
> VolGroup00���lvm2 [135.16 GB / 0� �
> free]
> � � Total: 3 [276.09 GB] / in use: 3 [276.09 GB]
> / in no VG: 0 [0���]
> 
> � At this point in the tutorial, I run in to trouble.
> As they
> � suggest, I run `lvm vgchange -ay' and then inspect
> � `/dev/mapper':
> 
> ���:; lvm vgchange -ay
> � � 2 logical volume(s) in volume group
> "VolGroup00" now active
> � � 2 logical volume(s) in volume group
> "VolGroup00" now active
> ���:; ls /dev/mapper/
> � � control� VolGroup00-LogVol00�
> VolGroup00-LogVol01
> 
> � Mounting fails:
> 
> ���:;� mount -t ext2
> /dev/mapper/VolGroup00-LogVol01 /media/img/
> � � mount: /dev/mapper/VolGroup00-LogVol01
> already mounted or /media/img/ busy
> ���:;� mount -t ext2
> /dev/mapper/VolGroup00-LogVol00 /media/img/
> � � mount: /dev/mapper/VolGroup00-LogVol00
> already mounted or /media/img/ busy
> � � mount: according to mtab,
> /dev/mapper/VolGroup00-LogVol00 is mounted on /
> 
> � At this point, I'm stuck. I've tried removing
> `/dev/loop7'
> � from the volume group, to no avail:
> 
> ���:; vgcreate shim /dev/loop7
> � � Physical volume '/dev/loop7' is already in
> volume group 'VolGroup00'
> � � Unable to add physical volume '/dev/loop7' to
> volume group 'shim'.
> ���:; vgreduce VolGroup00 /dev/loop7
> � � Physical Volume "/dev/loop7" not found in
> Volume Group "VolGroup00"
> 
> � What's the right way to mount and LVM disk image?
> I'm doing it
> � to perform maintenance on a Xen guest.
> 
> --
> Jason Dusek
> 
> _______________________________________________
> linux-lvm mailing list
> linux-lvm@redhat.com
> https://www.redhat.com/mailman/listinfo/linux-lvm
> read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/
> 


      

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [linux-lvm] Mounting an LVM disk image.
  2010-01-19  2:15 [linux-lvm] Mounting an LVM disk image Jason Dusek
  2010-01-19  3:01 ` J Nb
@ 2010-01-19  3:32 ` malahal
  2010-01-19 18:51   ` Jason Dusek
  1 sibling, 1 reply; 5+ messages in thread
From: malahal @ 2010-01-19  3:32 UTC (permalink / raw)
  To: linux-lvm

Jason Dusek [jason.dusek@gmail.com] wrote:
>   I'm trying to mount a disk image that contains an LVM volume.
>   I've managed to follow this tutorial to the point where I've
>   got the volume on `/dev/loop7':
> 
>     http://www.thegibson.org/blog/archives/467
> 
>   Now I want to mount the image. My machine, a CentOS machine,
>   is already using LVM; running `lvm pvscan' shows me that the
>   the disk image has been stuck in `VolGroup00' with the rest of
>   them:
> 
>    :; lvm pvscan
>     PV /dev/loop7   VG VolGroup00   lvm2 [7.88 GB / 0    free]
>     PV /dev/sda5    VG VolGroup00   lvm2 [133.06 GB / 0    free]
>     PV /dev/sdb2    VG VolGroup00   lvm2 [135.16 GB / 0    free]
>     Total: 3 [276.09 GB] / in use: 3 [276.09 GB] / in no VG: 0 [0   ]

Looks like a name clash here. You have a volume group names VolGroup00
with two PVs (sda5 and sdb2 in it). /dev/loop7 is also a PV with same
group name VolGroup00. They should have different UUIDs though...

You may be running into this problem:
http://liorkaplan.wordpress.com/2008/07/25/when-lvm-volume-groups-collide/

And this method may work, although written for something else:
http://thread.gmane.org/gmane.linux.lvm.general/9628

It is probably a lot easier to with a system that doesn't have
VolGroup00 to begin with!

>   At this point in the tutorial, I run in to trouble. As they
>   suggest, I run `lvm vgchange -ay' and then inspect
>   `/dev/mapper':
> 
>    :; lvm vgchange -ay
>     2 logical volume(s) in volume group "VolGroup00" now active
>     2 logical volume(s) in volume group "VolGroup00" now active
>    :; ls /dev/mapper/
>     control  VolGroup00-LogVol00  VolGroup00-LogVol01
> 
>   Mounting fails:
> 
>    :;  mount -t ext2 /dev/mapper/VolGroup00-LogVol01 /media/img/
>     mount: /dev/mapper/VolGroup00-LogVol01 already mounted or /media/img/ busy
>    :;  mount -t ext2 /dev/mapper/VolGroup00-LogVol00 /media/img/
>     mount: /dev/mapper/VolGroup00-LogVol00 already mounted or /media/img/ busy
>     mount: according to mtab, /dev/mapper/VolGroup00-LogVol00 is mounted on /

You are probably trying to re-mount the root device and swap devices.

>   At this point, I'm stuck. I've tried removing `/dev/loop7'
>   from the volume group, to no avail:
> 
>    :; vgcreate shim /dev/loop7
>     Physical volume '/dev/loop7' is already in volume group 'VolGroup00'
>     Unable to add physical volume '/dev/loop7' to volume group 'shim'.
>    :; vgreduce VolGroup00 /dev/loop7
>     Physical Volume "/dev/loop7" not found in Volume Group "VolGroup00"

Again, this is probably an artifact of name space collision!
 
>   What's the right way to mount and LVM disk image? I'm doing it
>   to perform maintenance on a Xen guest.

Certainly easier to work on a system that doesn't have VolGroup00 to
begin with. If you can't avoid it, you may try renaming the volume group
using uuid or the above mentioned link that is written for cloning a
volume group.

Thanks, Malahal.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [linux-lvm] Mounting an LVM disk image.
  2010-01-19  3:32 ` malahal
@ 2010-01-19 18:51   ` Jason Dusek
  2010-01-19 19:34     ` Stuart D. Gathman
  0 siblings, 1 reply; 5+ messages in thread
From: Jason Dusek @ 2010-01-19 18:51 UTC (permalink / raw)
  To: LVM general discussion and development

2010/01/18  <malahal@us.ibm.com>:
> [...]
> You may be running into this problem:
> http://liorkaplan.wordpress.com/2008/07/25/when-lvm-volume-groups-collide/
>
> And this method may work, although written for something else:
> http://thread.gmane.org/gmane.linux.lvm.general/9628
>
> It is probably a lot easier to with a system that doesn't have
> VolGroup00 to begin with! [...] If you can't avoid it, you may
> try renaming the volume group using uuid or the above
> mentioned link that is written for cloning a volume group.

  I am happy to report that rename by UUID does work (although,
  from the above links, you would think it did not):

   :; vgrename aaaaaa-bbbb-cccc-dddd-eeee-ffff-gggggg VolGroupForeign
    Volume group "VolGroup00" successfully renamed to "VolGroupForeign"

  Although it seems to be a best practice, naming volume groups
  in a unique way isn't done by default on CentOS -- and I
  inherited a bunch of CentOS Xen instances on a CentOS Dom0...

  Thanks for you help everyone,

--
Jason Dusek

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [linux-lvm] Mounting an LVM disk image.
  2010-01-19 18:51   ` Jason Dusek
@ 2010-01-19 19:34     ` Stuart D. Gathman
  0 siblings, 0 replies; 5+ messages in thread
From: Stuart D. Gathman @ 2010-01-19 19:34 UTC (permalink / raw)
  To: LVM general discussion and development

On Tue, 19 Jan 2010, Jason Dusek wrote:

>   Although it seems to be a best practice, naming volume groups
>   in a unique way isn't done by default on CentOS -- and I
>   inherited a bunch of CentOS Xen instances on a CentOS Dom0...

Fedora 12 started naming the default VG after the host name.  If the
hostname is given as "fred.example.com" during install, the VG is named
vg_fred by default.  This is a big improvement IMO.

-- 
	      Stuart D. Gathman <stuart@bmsi.com>
    Business Management Systems Inc.  Phone: 703 591-0911 Fax: 703 591-6154
"Confutatis maledictis, flammis acribus addictis" - background song for
a Microsoft sponsored "Where do you want to go from here?" commercial.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-01-19 19:35 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-19  2:15 [linux-lvm] Mounting an LVM disk image Jason Dusek
2010-01-19  3:01 ` J Nb
2010-01-19  3:32 ` malahal
2010-01-19 18:51   ` Jason Dusek
2010-01-19 19:34     ` Stuart D. Gathman

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.