Introduction:

Imagine you have rented a system at a provider where you want to install remotely
a totally new Debian Squeeze from scratch. You will need the following components:
– A Remote KVM Switch where you can view and control the system via a console remotely.
– A knoppix or any relatively recent bootable live Linux CD inserted in the CDROM drive
– Connection to Internet from live system once booted from CDROM

The procedure steps:

– Boot the live cd from CDROM
– Install the debootstrap package in live CD
– Prepare the new system’s environment: Swap and Root partitions
– Install the new Debian Squezze onto the root partition
– Do preliminary configuration on the new system
– Mount the /proc, /sys and /dev in the new system
– Chroot to the new system
– Install some extra packages you might need
– Install the Grub onto the MBR
– Unmount everything and reboot the system but this time from Hard disk.

START

– Boot knoppix from CD, start a terminal and login as root
sudo su -
– Create the swap and rot partitions on first internal drive
eg.
/dev/sda1 SWAP partition (swap)
/dev/sda2 ROOT partition (Linux)

– Reboot the live CD for it to recognize the ne partition table
reboot
– Format the swap and root partition as ext3 format
mkswap /dev/sda1
mkfs.ext3 /dev/sda2

– Mount the root partition
mkdir /mnt/sda2
mount /dev/sda2 /mnt/sda2

– Install the bootstrap program in Knoppix
apt-get install debootstrap
– Start the creation of the Debian Squeeze system using bootstrap
debootstrap squeeze /mnt/sda2 http://ftp.us.debian.org/debian/
……. watch the minimal system being installed.

– Prepare the new system for chrooting to it:
echo "proc /proc proc defaults 0 0" > /mnt/sda2/etc/fstab
echo "/dev/sda1 none swap sw 0 0" >> /mnt/sda2/etc/fstab
echo "/dev/sda2 / ext3 defaults,errors=remount-ro 0 1" >> /mnt/sda2/etc/fstab
echo "deb http://ftp.us.debian.org/debian squeeze main contrib non-free" >/mnt/sda2/etc/apt/sources.list
echo "deb-src http://ftp.us.debian.org/debian squeeze main contrib non-free" >>/mnt/sda2/etc/apt/sources.list
mount proc /mnt/sda2/proc -t proc
mount sysfs /mnt/sda2/sys -t sysfs
mount --bind /dev /mnt/sda2/dev

– chroot to the new system
chroot /mnt/sda2 /bin/bash
– Install a couple needed packages (includes the needed grub-install program)
Note: Choose the appropriate kernel conform to the hardware and environment you want.
apt-get install linux-image-2.6-686 grub grub-pc bash-completion
– If you get an error during the setting-up of grub-pc then try manually to install Grub in MBR again.
grub-install /dev/sda
– If you get some errors then you can also run the following command:
grub-install --recheck /dev/sda
– Set a password for root superuser
passwd
Now you can exit the chroot, umount the new system and reboot to your new Debian Squeeze system
exit
umount /mnt/sda2/dev
umount /mnt/sda2/proc
umount /mnt/sda2/sys
umount /mnt/sda2
reboot

You can install other needed packages after the system is been rebooted.