Hi, I was wondering if there''s a way to force a certain partitioning schema when using LVM. Let me explain: I would like to create two LVM volumes in the dom0, format one as ext3 and the other one as a swap partition. Then I''d like to install CentOS using the first one as the root partition and the second one as the swap partition. The problem is the installer wants to repartition both volumes. It says: "/dev/hda1 currently has a loop partition layout" Is there a way to create and format those volumes in a way that will be usable by the installer. If not, how can I mount and expand/shrink such volumes in the dom0? Thanks a lot for your help! :) - Michele _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
On Wed, Aug 05, 2009 at 03:41:39PM +0200, Michele wrote:> Hi, > > I was wondering if there''s a way to force a certain partitioning > schema when using LVM. > > Let me explain: I would like to create two LVM volumes in the dom0, > format one as ext3 and the other one as a swap partition. Then I''d > like to install CentOS using the first one as the root partition and > the second one as the swap partition. The problem is the installer > wants to repartition both volumes. It says: "/dev/hda1 currently has a > loop partition layout" > Is there a way to create and format those volumes in a way that will > be usable by the installer. >First of all you should present the LVM volumes as /dev/xvda1 and /dev/xvda2, or even better as /dev/xvda and do the partitioning in the CentOS installer in the domU. -- Pasi _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
I do pretty much what you are describing with LVM. I create LVs named
vm_whatever_root and vm_whatever_swap (more if I need them), then
present each one to my domains as xvda, xvdb, and so on and mount those
block devices directly, no partition table.
In my experience all the installers for the various Linux distros don''t
know how to handle this.
What I did to get through this was to first install onto an external USB
drive first (any additional storage outside of LVM will work). After
that base install was complete I mounted the root fs from the dom0 on my
xen host and made a tarball of the whole fs (including directories like
/proc and /dev BUT excluding their contents):
tar -c -z -v -f /vm.tar.gz --exclude=''/cdrom''
--exclude=''/initrd.img''
--exclude=''/media/*'' --exclude=''/selinux/*''
--exclude=''/sys/*''
--exclude=''/tmp/*'' --exclude=''/vmlinuz.old''
--exclude=''/boot/*''
--exclude=''/dev/*''
--exclude=''/initrd.img.old''
--exclude=''/lost+found''
--exclude=''/mnt/*'' --exclude=''/proc/*''
--exclude=''/srv/*''
--exclude=''/vmlinuz''
--exclude=''/nearcore.tar.gz'' /*
(For HVM deploys, you will not want to exclude the contents of /boot or
the root link to vmlinuz)
Now on the dom0 I create the LVs that I want for a new VM, create
filesystems on them, mount them on the dom0, and untar this tarball into
them. While the filesystem is still mounted I make the necessary
changes for fstab, networking, hvc0 console, and so on.
The nice part is once you do the xen specific modification you can
re-tar up the filesystem and have an almost ready to go install for your
choice distribution.
For fstab you mount just the xvd* block devices, no partition numbers.
Here is my domain config and fstab for a VM I created this way:
Fstab:
proc /proc proc defaults 0 0
/dev/xvda / ext3 noatime,errors=remount-ro 0 1
/dev/xvdb none swap sw 0 0
/dev/xvdc /data jfs defaults 0 0
Xen Config:
vast:~# cat /etc/xen/vm_store.cfg
name = ''store''
kernel = ''/vm/vmboot/u904_64/vmlinuz-2.6.28-11-server''
ramdisk = ''/vm/vmboot/u904_64/initrd.img-2.6.28-11-server''
root = ''/dev/xvda ro''
vcpus = 1
memory = 1024
disk = [ ''phy:/dev/sysvg/vm_store_root,xvda,w'',
''phy:/dev/sysvg/vm_store_swap,xvdb,w'',
''phy:/dev/datavg/datalv,xvdc,w'',
''phy:/dev/sysvg/bananaw7lv,xvde,w'' ]
vif = [ ''bridge=br0,mac=00:16:3e:00:00:01'' ]
on_shutdown = ''destroy''
on_reboot = ''restart''
on_crash = ''rename-restart''
There are big advantages to the way you want to handle storage as
logical volumes in the dom0. In addition to being able to resize the
storage under the VMs devices, one thing I have found really useful is
using snapshots to centralize backups on the host rather than backing up
each client. You can make an LVM snapshot of an LV that is presented to
a domU on the dom0, then mount it and do whatever you want with it.
Hope this helps!
-- Thaddeus
Michele wrote:> Hi,
>
> I was wondering if there''s a way to force a certain partitioning
> schema when using LVM.
>
> Let me explain: I would like to create two LVM volumes in the dom0,
> format one as ext3 and the other one as a swap partition. Then I''d
> like to install CentOS using the first one as the root partition and
> the second one as the swap partition. The problem is the installer
> wants to repartition both volumes. It says: "/dev/hda1 currently has a
> loop partition layout"
> Is there a way to create and format those volumes in a way that will
> be usable by the installer.
>
> If not, how can I mount and expand/shrink such volumes in the dom0?
>
> Thanks a lot for your help! :)
>
> - Michele
>
> _______________________________________________
> Xen-users mailing list
> Xen-users@lists.xensource.com
> http://lists.xensource.com/xen-users
>
_______________________________________________
Xen-users mailing list
Xen-users@lists.xensource.com
http://lists.xensource.com/xen-users
Hi Pasi, That''s the point: I''d rather not partition them in the installer and instead create the two partitions myself. Is it possible? Thanks, - Michele On Wed, Aug 5, 2009 at 4:10 PM, Pasi Kärkkäinen<pasik@iki.fi> wrote:> On Wed, Aug 05, 2009 at 03:41:39PM +0200, Michele wrote: >> Hi, >> >> I was wondering if there''s a way to force a certain partitioning >> schema when using LVM. >> >> Let me explain: I would like to create two LVM volumes in the dom0, >> format one as ext3 and the other one as a swap partition. Then I''d >> like to install CentOS using the first one as the root partition and >> the second one as the swap partition. The problem is the installer >> wants to repartition both volumes. It says: "/dev/hda1 currently has a >> loop partition layout" >> Is there a way to create and format those volumes in a way that will >> be usable by the installer. >> > > First of all you should present the LVM volumes as /dev/xvda1 and > /dev/xvda2, or even better as /dev/xvda and do the partitioning in the > CentOS installer in the domU. > > -- Pasi > >_______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
On Wed, Aug 05, 2009 at 04:34:34PM +0200, Michele wrote:> Hi Pasi, > > That''s the point: I''d rather not partition them in the installer and > instead create the two partitions myself. Is it possible? >I don''t know; I haven''t tried. Try it? Present the LVM-volumes as /dev/xvda1 and /dev/xvda2 and don''t partition during the installer; use the existing partitions. -- Pasi> Thanks, > - Michele > > On Wed, Aug 5, 2009 at 4:10 PM, Pasi Kärkkäinen<pasik@iki.fi> wrote: > > On Wed, Aug 05, 2009 at 03:41:39PM +0200, Michele wrote: > >> Hi, > >> > >> I was wondering if there''s a way to force a certain partitioning > >> schema when using LVM. > >> > >> Let me explain: I would like to create two LVM volumes in the dom0, > >> format one as ext3 and the other one as a swap partition. Then I''d > >> like to install CentOS using the first one as the root partition and > >> the second one as the swap partition. The problem is the installer > >> wants to repartition both volumes. It says: "/dev/hda1 currently has a > >> loop partition layout" > >> Is there a way to create and format those volumes in a way that will > >> be usable by the installer. > >> > > > > First of all you should present the LVM volumes as /dev/xvda1 and > > /dev/xvda2, or even better as /dev/xvda and do the partitioning in the > > CentOS installer in the domU. > > > > -- Pasi > > > >_______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
On Wed, Aug 5, 2009 at 9:34 PM, Michele<ftf@interfree.it> wrote:> Hi Pasi, > > That''s the point: I''d rather not partition them in the installer and > instead create the two partitions myself. Is it possible?No. Not when you need to use the installer. If you can set it up manually (copy form an existing installation, for example) it will work just fine. -- Fajar _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
2009/8/5 Michele <ftf@interfree.it>> > If not, how can I mount and expand/shrink such volumes in the dom0?To mount the virtual disk on the dom0, use this tool : http://www.albar.fr/downloads/vbdmount.py> > > - Michele > > _______________________________________________ > Xen-users mailing list > Xen-users@lists.xensource.com > http://lists.xensource.com/xen-users >_______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users