Centos-3 on Xen: Difference between revisions

From ConShell
Jump to navigation Jump to search
No edit summary
No edit summary
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{deprecated}}
__NOTOC__
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 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.


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 ==
  mkdir -p /tmp/buildroot
  mkdir -p /tmp/buildroot
  cd /tmp/buildroot
  cd /tmp/buildroot
Line 36: Line 38:
   /dev/MAKEDEV -d /mnt/disk/dev random
   /dev/MAKEDEV -d /mnt/disk/dev random


Setup /mnt/disk/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 48: Line 50:
   umount /mnt/disk
   umount /mnt/disk


Now /diskimage/ is ready to use!
Now diskimage is ready to use!


Actual space used= 528344
Actual space used= 528344
Line 55: Line 57:
[[Category:Virtualization]]
[[Category:Virtualization]]
[[Category:Xen]]
[[Category:Xen]]
[[Category:CentOS]]
[[Category:Linux]]
[[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