Contents
This article shows how to create a chroot environment. Why? –> http://en.wikipedia.org/wiki/Chroot#Uses
My initial use case was to set up Oracle Express - which only comes as a 32 bit package - on my 64 bit box:
+------------------------+
| jaunty amd64 |
| +------------------+ |
| | jaunty i386 | |
| | +------------+ | |
| | | oracle | | |
| | +------------+ | |
| +------------------+ |
+-------------------------+
We will not create a bootable system! If you want that, see
Get debootstrap (what is wajig?):
wajig install debootstrap
Get admin rights to eliminate the need of typing sudo before every command:
sudo bash
Create target directory:
target_dir=/usr/local/mychroot
mkdir $target_dir
Choose a release, i.e. the release code name. http://archive.ubuntu.com/ubuntu/dists/:
release=jaunty
Choose a fast mirror for your release to increase debootstrap’s download speed:
mirror=ftp://ftp.fu-berlin.de/linux/ubuntu/releases/
Choose an architecture! It is important to choose the right architecture in the next step. You probably want i386 (aka. x86 aka. 32 bit) or amd64 (aka. 64 bit). For a full list of supported architectures see http://archive.ubuntu.com/ubuntu/dists/jaunty/Release:
arch=i386
And put it all together:
debootstrap --arch $arch $release $target_dir
This takes a while. Upon completion, have a look:
ls $target_dir
Create and run the Bash script mountall:
cd /var/tmp # or ~/bin if you like
cat > mountall << EOF
mount -t proc proc ${target_dir}/proc # for bash completion
mount --bind /dev ${target_dir}/dev
mount -t sysfs sysfs ${target_dir}/sys
EOF
chmod +x mountall
./mountall
Create the Bash script umountall for later use:
cat > umountall << EOF
umount ${target_dir}/proc
umount ${target_dir}/dev
umount ${target_dir}/sys
EOF
chmod +x umountall