Centos EL 4.4 domU installation for Xen using Yum
requirements
- minimum of 700M free disc space (based on core group install only)
- network connectivity for remote repositorys
using LVM Backend for Disc
- create a Logical Volume for the domU (assume Volume Groupname is Grp_XEN)
$ lvcreate -L 700M -n Centos4domU Grp_XEN
- create the filesystem of your choice (default ext3)
$ mkfs.ext3 /dev/Grp_XEN/Centos4domU
- mount the file system
$ mount /dev/Grp_XEN/Centos4domU /mnt
using Filebased Backend for Disc
- create an empty file for the device
$ dd if=/dev/zero of=Centos4domU bs=1M count=700
- create the filesystem of your choice (default ext3)
$ mkfs.ext3 Centos4domU
- mount the file system
$ mount -o loop Centos4domU /mnt
create necessary directorys and layouts for installation
$ mkdir -p /mnt/etc/yum.repos.d /mnt/proc /mnt/var/lock/rpm /mnt/dev
$ for i in console null zero random ; do MAKEDEV -d /mnt/dev -x ${i} ; done
$ mount -t proc none /mnt/proc
- add root useraccount from domU
$ head -1 /etc/passwd > /mnt/etc/passwd
$ head -1 /etc/shadow > /mnt/etc/shadow && chmod 0400 /mnt/etc/shadow
create fstab for domU (copy&paste adds empty lines to your fstab file, remove them)
$ cat <<EOF> /mnt/etc/fstab
/dev/sda1 / ext3 defaults 1 1
none /dev/pts devpts gid=5,mode=620 0 0
none /proc proc defaults 0 0
none /sys sysfs defaults 0 0
EOF
- copy the Yum configs from your existing Centos installation or from the centos website
$ wget -O /mnt/etc/yum.repos.d/Centos-Base.repo http://isoredirect.centos.org/centos/4/CentOS-Base.repo
- modify the Repo config by editing the strings '$releasever' and '$basearch' to reflect your needs
- (for Centos 4.4 and Arch i386)
$ sed -e " s#\$releasever#4#; s#\$basearch#i386#g; " < /mnt/etc/yum.repos.d/Centos-Base.repo > /mnt/etc/yum.repos.d/Centos-Base \
&& mv /mnt/etc/yum.repos.d/Centos-Base /mnt/etc/yum.repos.d/Centos-Base.repo
- install Centos using yum components 'Group Core'
$ yum -y --installroot=/mnt groupinstall core
if you don't know which groups or components you want to install you can get a list (in XML) from the repositorys by calling
$ yum -y --installroot=/mnt grouplist
the group files are located in /mnt/var/cache/yum/$reponame/*.xml for example installing everything (required disc space ~8G) can be achieve by calling
$ yum -y --installroot=/mnt install \*
things you still need to adopt after successful installation for base functionality
- /etc/resolv.conf
- /etc/sysconfig/network-scripts/ifcfg-eth*
- umount /mnt/proc
sync
- umount /mnt
- edit your domU Config File and start the domU
