Centos-3 on Xen: Difference between revisions

From ConShell
Jump to navigation Jump to search
No edit summary
Line 1: Line 1:
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.
Here are the commands I used to bootstrap a basic [http://www.centos.org/ centos3] system. It is important to realize this bootstrapping was <b>done on a centos3 system</b>, 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.
 
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 <b>done on a centos3 system</b>, 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.
In any case, the "it takes one to know one" cliche held true.


== Build (bootstrap) a centos3 system on captain (also centos3) ==
== Build (bootstrap) a centos3 system ==
  [mf1@captain ~]$ cd /tmp/
mkdir -p /tmp/buildroot
  [mf1@captain /tmp]$ mkdir centos3-template1
cd /tmp/buildroot
  [mf1@captain /tmp]$ dd if=/dev/zero of=centos3-template1/diskimage bs=1024k count=750
dd if=/dev/zero of=diskimage bs=1024k count=750
  [root@captain /tmp]$ su -
mkfs.ext3 diskimage
  [root@captain root]# mkfs.ext3 centos3-template1/diskimage
   diskimage is not a block special device.
   centos3-template1/diskimage is not a block special device.
   Proceed anyway? (y,n) y
   Proceed anyway? (y,n) y
  [root@captain tmp]# mkdir -p /mnt/disk
mkdir -p /mnt/disk
  [root@captain tmp]# mount -o loop /tmp/centos3-template1/diskimage /mnt/disk
mount -o loop diskimage /mnt/disk


=== Get the centos3 "release" RPM, setup rpm database and so on ===
Now we have a fresh, blank disk image (inside a file called diskimage), time to bootstrap the operating system into it.
  wget ftp://ftp.osuosl.org/pub/centos/3.7/os/i386/RedHat/RPMS/centos-release-3-7.1.i386.rpm
wget ftp://ftp.osuosl.org/pub/centos/3.7/os/i386/RedHat/RPMS/centos-release-3-7.1.i386.rpm
  rpm --root /mnt/disk/ --initdb
rpm --root /mnt/disk/ --initdb
  rpm --root /mnt/disk/ -ivh --nodeps centos-release-3-7.1.i386.rpm
rpm --root /mnt/disk/ -ivh --nodeps centos-release-3-7.1.i386.rpm


=== Make sure that you have the correct GPG keys installed ===
The correct GPG keys must be installed - the "takes one to know one" rule applies here!
The "takes one to know one" rule applies here
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
rpm --root /mnt/disk/ --import /usr/share/doc/centos-release-3/RPM-GPG-KEY-CentOS-3
  rpm --root /mnt/disk/ --import /usr/share/doc/centos-release-3/RPM-GPG-KEY-CentOS-3


=== Install the "Base" group of RPM packages using yum ===
Install the "Base" group of RPM packages using yum. This assumes your yum repo(s) are setup correctly.


   yum --installroot=/mnt/disk/ -y groupinstall Base
   yum --installroot=/mnt/disk/ -y groupinstall Base
Line 41: Line 35:
   /dev/MAKEDEV -d /mnt/disk/dev zero
   /dev/MAKEDEV -d /mnt/disk/dev zero
   /dev/MAKEDEV -d /mnt/disk/dev random
   /dev/MAKEDEV -d /mnt/disk/dev random
  /dev/MAKEDEV -d /mnt/disk/dev pts


=== Fixup /etc/fstab as shown ===
=== Setup /mnt/disk/etc/fstab as shown ===
   /dev/sdb1    /    ext3    errors=remount-ro    0    1
   /dev/sdb1    /    ext3    errors=remount-ro    0    1
   /dev/sdb2    none  swap    sw                    0    0
   /dev/sdb2    none  swap    sw                    0    0

Revision as of 16:49, 31 July 2006

Here are the commands I used 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

mkdir -p /tmp/buildroot
cd /tmp/buildroot
dd if=/dev/zero of=diskimage bs=1024k count=750
mkfs.ext3 diskimage
 diskimage is not a block special device.
 Proceed anyway? (y,n) y
mkdir -p /mnt/disk
mount -o loop diskimage /mnt/disk

Now we have a fresh, blank disk image (inside a file called diskimage), time to bootstrap the operating system into it.

wget ftp://ftp.osuosl.org/pub/centos/3.7/os/i386/RedHat/RPMS/centos-release-3-7.1.i386.rpm
rpm --root /mnt/disk/ --initdb
rpm --root /mnt/disk/ -ivh --nodeps centos-release-3-7.1.i386.rpm

The correct GPG keys must be installed - the "takes one to know one" rule applies here!

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

Install the "Base" group of RPM packages using yum. This assumes your yum repo(s) are setup correctly.

 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

Setup /mnt/disk/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