[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • To: xen-users <xen-users@xxxxxxxxxxxxxxxxxxx>
  • 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
  • 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=
  • List-id: Xen user discussion <xen-users.lists.xensource.com>

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.