|
|
|
|
|
|
|
|
|
|
xen-users
Re: [Xen-users] Howto install domU CentOS 5 directly on partition
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
|
|
|
|
|