Creating a Bootstrapped Debian Image
September 7th, 2006
Create a 1 GB image file and 500 MB swap file, for larger images increase count.
dd if=/dev/zero of=debian-sarge.img bs=1024k count=1000
dd if=/dev/zero of=debian-sarge-swap.img bs=1024k count=500
Format them accordingly..
mkfs.ext3 debian-sarge.img
mkswap debian-sarge-swap.img
Mount the guest image and bootstrap it.
mount -o loop debian-sarge.img /mnt
Installl a Debian
debootstrap --arch i386 sarge /mnt http://ftp.us.debian.org/debian/
Create a fstab
chroot /mnt
mount /proc
cd /dev && /sbin/MAKEDEV console && /sbin/MAKEDEV std && /sbin/MAKEDEV generic
apt-get install udev locales
You’re set to go….
add to del.icio.us
add to technorati favs
email this
October 24th, 2007 at 9:25 am
Hey,
maybe it should be clarified that you have to make up the fstab yourself and also should install a kernel if you consider booting the image.
I used the method described here with knoppix in a VirtualBox VM. So I created a running system without needing an allready installed one…
Groetjes
Christoph
October 24th, 2007 at 9:37 am
All good points. The reason they were overlooked in this illustration is that the derived image was used on Amazon EC2 where they provide the kernel for you and don’t boot from the one in the image.