Centos-3 on Xen
Jump to navigation
Jump to search
Before last friday I would recommend the guide for Centos-4 on Xen and just make modifications as necessary. However carrying out the procedure proved unworkable, as the centos3 suite provided by rpmstrap was not listing the same packages as found in my localized mirror of the Centos3 repository.
So time to try something else.
Here are the commands I ended up using to bootstrap a basic centos3 system. It is important to realize this bootstrapping was done on a centos3 system, so things like yum, rpm and so on worked as expected. I initially tried the same procedure on a debian box and it did not go so well.
In any case, the "it takes one to know one" cliche held true.
Build (bootstrap) a centos3 system on captain (also centos3)
[mf1@captain ~]$ cd /tmp/ [mf1@captain /tmp]$ mkdir centos3-template1 [mf1@captain /tmp]$ dd if=/dev/zero of=centos3-template1/diskimage bs=1024k count=750 [root@captain /tmp]$ su - [root@captain root]# mkfs.ext3 centos3-template1/diskimage centos3-template1/diskimage is not a block special device. Proceed anyway? (y,n) y [root@captain tmp]# mkdir -p /mnt/disk [root@captain tmp]# mount -o loop /tmp/centos3-template1/diskimage /mnt/disk
Get the centos3 "release" RPM, setup rpm database and so on
wget http://yum-a.portseattle.org/centos/3.6/os/i386/RedHat/RPMS/centos-release-3-6.1.i386.rpm rpm --root /mnt/disk/ --initdb rpm --root /mnt/disk/ -ivh --nodeps centos-release-3-6.1.i386.rpm
Make sure that you have the correct GPG keys installed
rpm --root /mnt/disk/ --import /usr/share/doc/centos-release-3/RPM-GPG-KEY rpm --root /mnt/disk/ --import /usr/share/doc/centos-release-3/RPM-GPG-KEY-CentOS-3 yum --installroot=/mnt/disk/ -y groupinstall Base ... (filesystem, basesystem and setup are installed, then 267 addl. packages) ... Transaction(s) Complete
Make necessary devices
/dev/MAKEDEV -d /mnt/disk/dev console /dev/MAKEDEV -d /mnt/disk/dev null /dev/MAKEDEV -d /mnt/disk/dev zero /dev/MAKEDEV -d /mnt/disk/dev random /dev/MAKEDEV -d /mnt/disk/dev pts
Fixup /etc/fstab as shown
/dev/sdb1 / ext3 errors=remount-ro 0 1 /dev/sdb2 none swap sw 0 0 proc /proc proc defaults 0 0 none /dev/pts devpts gid=5,mode=620 0 0
Unmount and finish
umount /mnt/disk & it (centos3-template1/diskimage) is ready to use!
Actual space used= 528344
--fostermarkd 13:40, 9 Jan 2006 (EST)