Centos-3 on Xen: Difference between revisions

From ConShell
Jump to navigation Jump to search
(new page specifically for centos3)
 
No edit summary
 
(10 intermediate revisions by 3 users not shown)
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.
{{deprecated}}
__NOTOC__


So time to try something else.
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.
 
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) ==
mkdir -p /tmp/buildroot
  [mf1@captain ~]$ cd /tmp/
cd /tmp/buildroot
  [mf1@captain /tmp]$ mkdir centos3-template1
dd if=/dev/zero of=diskimage bs=1024k count=750
  [mf1@captain /tmp]$ dd if=/dev/zero of=centos3-template1/diskimage bs=1024k count=750
mkfs.ext3 diskimage
  [root@captain /tmp]$ su -
   diskimage is not a block special device.
  [root@captain root]# mkfs.ext3 centos3-template1/diskimage
   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
 
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


=== Get the centos3 "release" RPM, setup rpm database and so on ===
Install the "Base" group of RPM packages using yum. This assumes your yum repo(s) are setup correctly.
  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
   yum --installroot=/mnt/disk/ -y groupinstall Base
   ...
   ...
Line 32: Line 32:
   Transaction(s) Complete
   Transaction(s) Complete


=== Make necessary devices ===
Make necessary devices
   /dev/MAKEDEV -d /mnt/disk/dev console  
   /dev/MAKEDEV -d /mnt/disk/dev console  
   /dev/MAKEDEV -d /mnt/disk/dev null
   /dev/MAKEDEV -d /mnt/disk/dev null
   /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
Line 45: Line 44:
   none                    /dev/pts                devpts  gid=5,mode=620  0 0
   none                    /dev/pts                devpts  gid=5,mode=620  0 0


=== Unmount and finish ===
Cleanup /lib/tls
   umount /mnt/disk & it (centos3-template1/diskimage) is ready to use!
mv /mnt/disk/lib/tls /mnt/disk/lib/tls.disabled
 
Unmount and finish
   umount /mnt/disk
 
Now diskimage is ready to use!


Actual space used= 528344
Actual space used= 528344


--[[User:Fostermarkd|fostermarkd]] 13:40, 9 Jan 2006 (EST)
 
[[Category:Virtualization]]
[[Category:Xen]]
[[Category:Linux]]
{{BADS}}

Latest revision as of 14:12, 25 January 2015

Important.gif This page contains outdated content. YMMV. Use at your own risk


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.

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

Cleanup /lib/tls

mv /mnt/disk/lib/tls /mnt/disk/lib/tls.disabled

Unmount and finish

 umount /mnt/disk

Now diskimage is ready to use!

Actual space used= 528344