This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
Home Products Support Community News


Re: [Xen-users] Using lvm for domUs

To: "Nico Kadel-Garcia" <nkadel@xxxxxxxxx>
Subject: Re: [Xen-users] Using lvm for domUs
From: "Rene Purcell" <rene.purcell@xxxxxxxxx>
Date: Tue, 8 May 2007 07:56:22 -0400
Cc: xen-users@xxxxxxxxxxxxxxxxxxx
Delivery-date: Tue, 08 May 2007 04:55:04 -0700
Dkim-signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; b=tV/TZyP8NrIiGp2XqIQxL9xE+t+f0u1/EZeh5mTI+mlgr5iv2Y/pzGbTdeo2AfLRE14SKgEA9SlGuMbGcg2DORgisyI/GQ/ulVKX6cYdZtpNBSLp8vRX5xvSDbC/HOiQ/Fd9PhIlgbxoI5SfsRC4IM+nTlmQ6melKJzukNVwvps=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; b=WZcv6XDLfCoNodzVmKw6bWO8i/wrkI2OjBZKPBYoPyfz8ehkr+tv5jAKWmU5hOa+9o352DAjiSzzZuZk4VZG0z1OytpyKCuqkZHLBgx/7aA4LokVtj1MzxXdc0MteCtSLKMfoureavYrnJTTt+1WmR8mUvaH8qJunaw3ln9nTh4=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <46404EB8.8000901@xxxxxxxxx>
List-help: <mailto:xen-users-request@lists.xensource.com?subject=help>
List-id: Xen user discussion <xen-users.lists.xensource.com>
List-post: <mailto:xen-users@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-users>, <mailto:xen-users-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-users>, <mailto:xen-users-request@lists.xensource.com?subject=unsubscribe>
References: <4170c1720704301129k4cc8eac3m32395ce16c7c20ec@xxxxxxxxxxxxxx> <5a4fbd6c0705020156l29eff77ar28ebcaa1961b0f68@xxxxxxxxxxxxxx> <878xc4yla9.fsf@xxxxxxxxxxxxxxxxxxxxxxxxxxx> <463B068C.7060808@xxxxxxxxx> <874pmsyini.fsf@xxxxxxxxxxxxxxxxxxxxxxxxxxx> <463B0F34.10603@xxxxxxxxx> <876475lnpy.fsf@xxxxxxxxxxxxxxxxxxxxxxxxxxx> <463E5C9F.4090005@xxxxxxxxx> <7eaa835c0705071214p175f7e15r1d702112a6e8467@xxxxxxxxxxxxxx> <46404EB8.8000901@xxxxxxxxx>
Sender: xen-users-bounces@xxxxxxxxxxxxxxxxxxx
I'm not sure to understand where's your snapshot are...

but there's how to mount an "internal" partition available in your LV.. if you shutdown your DomU then mount the partition you'll be able to access your data in your Dom0..

- hda (physical disk)
  hda1 ( / Dom0 )
  hda2 ( swap Dom0 )
  hda3 (partition system id=8e
         LV1 DomU (hda virtuel XEN)
             hda1 ext3 /
             hda2 swap

There's a partition table in : /dev/vg1/lv1

Whith this command you can see the partition contained in your LV
fdisk -l -u /dev/vg1/lv1

"Don't forget the "-u" it's important this will show you the size in sector"

Disk /dev/vg1/lv1: 4294 MB, 4294967296 bytes
255 heads, 63 sectors/track, 522 cylinders, total 8388608 sectors
Units = sectors of 1 * 512 = 512 bytes

        Device Boot      Start         End      Blocks   Id  System
/dev/vg1/lv1p1              63      899639      449788+  82  Linux
swap / Solaris
/dev/vg1/lv1p2   *      899640     8385929     3743145   83  Linux

Now if you want to mount the second partition in your LV type:

mount -o loop,offset=460615680 /dev/vg1/lv1p2 /mnt

460615680 is equal to 899640 * 512 (512 are the size of each sector and
899640 the starting point of the partition. (You can get these numbers with the fdisk command..)

Thanks to Jean-Francois Saucier ;) for the recipe! And I hope this can help you..


On 5/8/07, Nico Kadel-Garcia <nkadel@xxxxxxxxx> wrote:
Rene Purcell wrote:
> did you create partition in your LV ? I mean you added something like
> "phy:/dev/main/xen_DomU_logs,hda,w" when you've installed your
> distribution did you create a partition hda1 in the installation
> process or did you just copy some data into hda ?
> what's the distro you've installed ?
I'm working with RedHat and CentOS. The installer itself insists on
having a local disk device to load up and install a boot loader, and I
haven't worked out the details of a pitiful excuse for documentation of
the Xen config files to figure out how to gracefully over-ride the use
of pygrub. The result is that I have a disk image, not a partition image
or set of partition images, where an LVM partition claled
/dev/XEN/xenguest1 will be seen by the guest domain as /dev/xvda, and
have internal partitions of /dev/xdva1 /dev/xvda[whatever].

I *want* to be able to snapshot the LVM partitions mount the snapshots,
and run backup operations against those on Dom0 instead of paying the
overhead of running them from DomU.

René Jr Purcell
Chargé de projet, sécurité et sytèmes
Techno Centre Logiciels Libres, http://www.tc2l.ca/
Téléphone : (418) 681-2929 #124
Xen-users mailing list
<Prev in Thread] Current Thread [Next in Thread>