WARNING - OLD ARCHIVES

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/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-users

[Xen-users] Re: Get rid of the partition table in a domU LVM

To: xen-users <xen-users@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-users] Re: Get rid of the partition table in a domU LVM
From: "Nuno L. Ferreira" <nunolf@xxxxxxxxx>
Date: Sun, 28 Mar 2010 16:28:25 +0200
Delivery-date: Sun, 28 Mar 2010 07:29:21 -0700
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=7raASU2K/a7IY5aWGQIW1CdHzPoFzcgeIJL5zlCnfbs=; b=u0XoemIWg9Q3OFnm+Mh2WL8AGA5bAxJ/KXHHkm8yP4JOEhAJj3G/T3RYNW3crB+xW0 +iPnzTMgye96VAr1Soo15KxDZmdoZ8dq4wJ4G+phQLkS1AHflPKcNgPxC/7GGNl9JD3o sb6LCrLPH/cNZxAhEydDl+hMlypFBa6OcTD68=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; b=XboluvQ0ctV4culF9teD0ogQlvDk9PSiLMUxrWU3NpYjaTVjz7nuSecoh1Thj+qv0V YXJ6wdMBrcQYoKd/sVi4TLmGhR4GkGA/WF09T8W6b5Q85NRmOdIuNPzbZ2V5XcvTpmFK 8/QtYkvmifEoSMFtHE4EwaRdb7QrdcOXeMsvY=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <4BAF5CCA.3060403@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/mailman/listinfo/xen-users>, <mailto:xen-users-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-users>, <mailto:xen-users-request@lists.xensource.com?subject=unsubscribe>
References: <4BAF5CCA.3060403@xxxxxxxxx>
Sender: xen-users-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.8) Gecko/20100205 SeaMonkey/2.0.3
As an example to complement, the step by step protocol, knowing the following:

1 - dom0 is a CentOS 54 x86_64 AMD server
2 - /dev/vg1/domu.pristine hosts a SL 54 x86_64 PV domU which runs just fine; For simplicity, only one partition resides inside this LVM (/dev/xvda1 --> /). 3 - /dev/vg1/test will be my new LV domU host (lvcreate -L5G -n test vg1 ; mkfs.ext3 /dev/vg1/test)
4 - domU to copy is down.

[dom0]# lvscan
  ACTIVE            '/dev/vg1/test' [5.00 GB] inherit
  ACTIVE            '/dev/vg1/domu.pristine' [4.00 GB] inherit

[dom0]# fdisk -l /dev/vg1/domu.pristine
Disk /dev/vg1/domu.pristine: 4294 MB, 4294967296 bytes
255 heads, 63 sectors/track, 522 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/vg1/domu.pristine1   *           1         522     4192933+  83  Linux

[dom0]# kpartx -l /dev/vg1/domu.pristine
domu.pristine1 : 0 8385867 /dev/vg1/domu.pristine 63

[dom0]# kpartx -av /dev/vg1/domu.pristine
add map domu.pristine1 : 0 8385867 linear /dev/vg1/domu.pristine 63

[dom0]# ls /dev/mapper/ | grep domu.pristine
domu.pristine1

[dom0]# mount /dev/vg1/test /mnt/test
[dom0]# mount /dev/vg1/domu.pristine /mnt/loop/
[dom0]# cp -ax /mnt/loop/*  mnt/test
[dom0]# umount /mnt/loop/
[dom0]# kpartx -dv /dev/vg1/domu.pristine

After some tweeking on the new domU :

[dom0]# cat /mnt/test/etc/fstab
/dev/xvda1           /                       ext3    defaults        1 1
tmpfs                   /dev/shm                tmpfs   defaults        0 0
devpts                 /dev/pts                devpts  gid=5,mode=620  0 0
sysfs                   /sys                    sysfs   defaults        0 0
proc                    /proc                   proc    defaults        0 0

[dom0]# cat /mnt/test/etc/grub.conf
... snip ...
default=0
timeout=5
splashimage=(hd0,0)/boot/grub/splash.xpm.gz
hiddenmenu
title Scientific Linux (2.6.18-164.2.1.el5xen)
        root (hd0,0)
kernel /boot/vmlinuz-2.6.18-164.2.1.el5xen ro root=/dev/xvda1 console=xvc0 rhgb quiet
        initrd /boot/initrd-2.6.18-164.2.1.el5xen.img

[dom0]# umount /mnt/test
[dom0]# cat test.xen
name        = "test"
maxmem      = 512
memory      = 512
vcpus       = 1
bootloader  = "/usr/bin/pygrub"
on_reboot   = 'restart'
on_crash    = 'restart'
on_poweroff = "destroy"
disk        = [ "phys:/dev/vg1/test,xvda1,w" ]
vif         = [ "bridge=xenbr0" ]


[dom0]# xm dry-run test.xen
Using config file "./test.xen".
Checking domain:
   test: PERMITTED
Checking resources:
   phys:/dev/vg1/test: PERMITTED
Dry Run: PASSED

[dom0]# xm create -c test.xen
Using config file "./test.xen".
Error: Device 51713 (vbd) could not be connected. Hotplug scripts not working.

Pygrub shows up with one entry ... but then nothing else happens, just the above Error.

Cheers,
N.


_______________________________________________
Xen-users mailing list
Xen-users@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-users

<Prev in Thread] Current Thread [Next in Thread>