On Sat, 2006-10-21 at 03:34 +0100, Joao Correia wrote:
Hello,
I have CentOS release 4.4 (Final) dom0 and I want to create a CentOS
domU using rpmstrap.
I found several tutorials but I couldn't get a rpmstrap script to work
with the current CentOS repositories. It misses packages and
dependencies and it doesnt install properly.
Any tips ? anyone has a rpmstrap script working for CentOS ?
I followed this tutorial:
http://mark.foster.cc/wiki/index.php/Centos-4_on_Xen
maybe this little howto using yum can help you.
I'm using LVM, if you prefere using loopbacks mark's tutorial explains
creation of loopback disks.
# start creating the disk
# where the Grp_Xen is expected to be the VolumeGroupName
$ lvcreate -L 1G -n XEN01 Grp_Xen
$ mkfs.ext3 /dev/mapper/Grp_Xen-XEN01
# now we need the packages
$ mount /dev/mapper/Grp_Xen-XEN01 /mnt
$ mkdir -p /mnt/proc /mnt/var/lib/rpm /mnt/dev /var/cache/
$ for i in console null zero random ; do MAKEDEV -d /mnt/dev -x ${i} ; \
done
$ mount -t proc none /mnt/proc
# you need enought diskspace for the fetched headers and Packages
# so link it against a disk with enough space ~2GB
# mkdir -p /export/yumspool
$ ln -s /export/yumspool /mnt/var/cache/yum
# if you need additional Yum locations
# $ mkdir /mnt/etc/yum.repos.d/
# $ cp MyRepository.repo /mnt/etc/yum.repos.d/
# then start installing rpms using yum with
# a: groupinstall
# b: install \* for everything but 1G might be not enought diskspace :)
$ yum --installroot=/mnt -y groupinstall core base
# or
# $ yum --installroot=/mnt -y install \*
$ cat <<EOF > /mnt/etc/fstab
/dev/sda1 / ext3 defaults 1 1
none /dev/pts devpts gid=5,mode=620 0 0
none /dev/shm tmpfs defaults 0 0
none /proc proc defaults 0 0
none /sys sysfs defaults 0 0
EOF
# you need to enable shadow authentication in this installation
# first get every installed username (daemon depending)
$ for user in `cut -f1 -d':' /mnt/etc/passwd` ; do
useropts=$(grep ${user} /mnt/etc/passwd | cut --fields=3- -d':')
echo "${user}:x:${useropts}" >> /mnt/etc/passwd.new
# setting shadow passwords as in dom0
grep ${user} /etc/shadow >> /mnt/etc/shadow
done
$ mv /mnt/etc/passwd.new /mnt/etc/passwd
$ chmod 0400 /mnt/etc/shadow
# after finishing the installation you can unount the filesystems
# but you will get an umount error as the minilogd access the mountpoint
# and blocks umount access
$ sync # flushing all changes to disk if needed
$ umount /mnt/proc
$ umount /mnt
# force it with -f force and -l lacy
# $ umount -fl /mnt
adding the disk to your config and booting should be working ...
Kind regards
Michael Lang
Thanks
Joao Correia