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

Re: [Xen-users] Howto install domU CentOS 5 directly on partition


  • To: kanour-xen <xen@xxxxxxxxxx>
  • From: "trilok nuwal" <tc.nuwal@xxxxxxxxx>
  • Date: Tue, 31 Jul 2007 19:11:19 +0530
  • Cc: Liam Kirsher <liamk@xxxxxxxxxxx>, xen-users@xxxxxxxxxxxxxxxxxxx, nkadel@xxxxxxxxx
  • Delivery-date: Tue, 31 Jul 2007 06:39:05 -0700
  • 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=UQMIJI+1nQDoJman01PSHrcnBgyivJS7uE7jNDxSKPLo3Thj38bZsppXOVjRZYAMz58d+US72LUnxMM4Pl8mtXybWNT3lkPG21FAPRrZLB0XVjEVNlSojr3pkkUDsf26SBpN06gbIGdB+UajJsBn6NrWJSARQqyJfQzYqZCy4fk=
  • List-id: Xen user discussion <xen-users.lists.xensource.com>

Hi all,

I have a more simple way for this problem.

Use virt-install to install the domU.
Create only one partition that is root partition on the exported disk.

for example : /tmp/disk is exported for the domU then it will be exported as hda. then create a single partition ( Dont use LVM ) and dont install bootloader as we dont need for pv domain.

Now after installation we can mount the partition 1 in dom0 using lomount. as below and can see the contents also. then u can can make the tarball and can copy wherever u want.

lomount  -diskimage /tmp/disk -partition 1 /mnt

Hope it would be worthful.
Thanks,
Trilok

On 7/30/07, kanour-xen <xen@xxxxxxxxxx> wrote:
Hi Guys.

I just would like to share how I completed installation of  domU CentOS 5 directly on partition. I used some of yours ideas which I did not know (kpartx)

1/
I created new Logical Volume "X01"

2/
I installed domU normally through graphical virtual-manager on Logical Volume "X01" (LVM). I used 1000MB Ram and I created only one partition / (root). No swap.
After installation I stoped this domU.

3/
I created new Logical Volume "Z01"

From Dom0:
  • Copy all files From "X01" to "Z01" (I mounted that Logical Volume "X10" with kpartx and mount. I also mounted "Z01".)
  • Copy kernel and initrd from "Z01" to Dom0 /boot. The one you want to use for VM. I name it with extension -domU-Z01 to better recognize which kerlnel is which. (Generally, You have to boot the DomU from the same kernels as are in DomU!!! Otherwise you can get kernel panic. Example of my /boot (notice ...-domU-Z01):
          (ls -al /boot)
drwxr-xr-x  4 root root    1024 Jul 31 07:07 .
drwxr-xr-x 24 root root    4096 Jul 31 05:26 ..
-rw-r--r--  1 root root   58604 Jul 10 21:26 config-2.6.18-8.1.8.el5xen
-rw-r--r--  1 root root   58600 Mar 16 11:02 config-2.6.18-8.el5xen
drwxr-xr-x  2 root root    1024 Jul 23 23:58 grub
-rw-------  1 root root 1669017 Jul 23 23:58 initrd-2.6.18-8.1.8.el5xen.img
-rw-------  1 root root 1437797 Jul 31 06:53 initrd-2.6.18-8.1.8.el5xen.img-domU-Z01
-rw-------  1 root root 1669035 Jul 22 01:55 initrd-2.6.18-8.el5xen.img
drwx------  2 root root   12288 Jul 22 01:52 lost+found
-rw-r--r--  1 root root   80032 Apr  2 00:49 message
-rw-r--r--  1 root root   85349 Jul 10 21:26 symvers-2.6.18-8.1.8.el5xen.gz
-rw-r--r--  1 root root   85349 Mar 16 11:02 symvers-2.6.18-8.el5xen.gz
-rw-r--r--  1 root root 1091680 Jul 10 21:26 System.map-2.6.18-8.1.8.el5xen
-rw-r--r--  1 root root 1091650 Mar 16 11:02 System.map-2.6.18-8.el5xen
-rw-r--r--  1 root root 1893500 Jul 10 21:26 vmlinuz-2.6.18-8.1.8.el5xen
-rw-r--r--  1 root root 1893500 Jul 10 21:26 vmlinuz-2.6.18-8.1.8.el5xen-domU-Z01
-rw-r--r--  1 root root 1893708 Mar 16 11:02 vmlinuz-2.6.18-8.el5xen
-rw-r--r--  1 root root  276912 Jul 10 20:33 xen.gz-2.6.18-8.1.8.el5
-rw-r--r--  1 root root  276329 Mar 16 10:45 xen.gz-2.6.18-8.el5
-rwxr-xr-x  1 root root  642368 Jul 10 21:31 xen-syms-2.6.18-8.1.8.el5
-rwxr-xr-x  1 root root  642368 Mar 16 11:08 xen-syms-2.6.18-8.el5

  • Create config file for new domU with kernel and ramdisk. Example
kernel='/boot/vmlinuz-2.6.18-8.1.8.el5xen-domU-Z01'
ramdisk='/boot/initrd-2.6.18-8.1.8.el5xen.img-domU-Z01'
memory='1000'
name='Z01'
root='/dev/sda1'
disk=['phy:/dev/vm_vg/zimbra02_root,sda1,w',
      'phy:/dev/vm_vg/zimbra02_swap,sda2,w']
vif = [ 'mac=00:16:3e:67:bc:33, bridge=xenbr0', ]
vfb = ["type=vnc,vncunused=1"]
> on_reboot   = 'restart'
on_crash    = 'restart'

  • Edit /etc/fstab in Logical Volume "Z01" for / and swap. (notice /dev/sda[12] which coresponds to config_file) Example:
/dev/sda1               /                       ext3    defaults        1 1
devpts                  /dev/pts                devpts  gid=5,mode=620  0 0
tmpfs                   /dev/shm                tmpfs   defaults        0 0
proc                    /proc                   proc    defaults        0 0
sysfs                   /sys                    sysfs   defaults        0 0
/dev/sda2               swap                    swap    defaults        0 0

  • my network card in domU was already configured for DHCP. Make sure you have the config OK.
  • umount all Logical Volumes
  • xm create -c config_file
Note: If you update kernels in domU make sure you update them in dom0 otherwise you can get Kernel Panic.

Cheers kanour-xen



Liam Kirsher wrote:
I used virt-install, and selected custom partitioning during the install
process, removing the LVM stuff and reducing it to one partition. Then
the install proceeded fine. That created my "template" OS, with a
single partition and no swap (ignore the warning about missing swap
during install). That is created on a logical volume accessible from
dom0, can be mounted with kpartx and mount.

Now I just create logical volumes for data and swap, and copy (using dd)
the template to the data, mkswap on swap.
Then, mount the data volume, make a few changes, and just start it up.
I can send more details if you like, but I've got to run now.
It took me a *looooong* time to figure out exactly how to do it, but now
I can set up a new domU in less than ten minutes, and it´s easy to
access the domU files from dom0.

Liam


kanour-xen wrote:
Hi.

I am new to CentOS (Debian user) and I am looking for way how to
install CentOS 5 on domU in the way that I have it directly on dom0
LVM partition.
If I install it with virtual-manager then the installation program
takes that partition as a disk and then creates new partitions on it.
I don't want it that way because I cannot then mount it from dom0.

Is there some way how to install it directly on partition as for
example in Debian with debootstrap?

Thank you

Jiri

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


  


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

_______________________________________________
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®.