How to set up debian or ubuntu with debootstrap

Aus Markus' Wiki
Wechseln zu: Navigation, Suche

debootstrap Mini-HOWTO Installing a fully fledged Debian or Ububtu linux system on a remote computer through a rescue disk with debootstrap


  1. take care that debootstrap is available on your system
  2. take care that you have a good bandwidth and that downloading 500 MB won't jeopardize your finances!
  3. take care of the partition architecture with fdisk on the device where you'd like to install the system
  4. format the partitions with a filesystem of your choice. I prefer ext3 (mkfs.ext3). Also, initialize the swap space. (mkswap)
  5. mount your file systems in a way you want them to act later on. Use /mnt as the root directory.
  6. use debootstrap in order to bootstrap the complete base installation into /mnt
  7. then chroot /mnt
  8. take care of the devices: /dev/hda or /dev/sda and their partitions need to have their according node files. If they don't exist, generate them with mknod: mknod /dev/hda b 3 0 and mknod /dev/hda1 b 3 1 and mknod /dev/hda2 b 3 2 and mknod /dev/hda3 b 3 3 etc. For scsi devices proceed accordingly. If you have scsi or serial ATA (SATA) devices, the major ID is 8 instead of 3. The device names will be /dev/sda, /dev/sda1, /dev/sda2, etc.
  9. If you have two identical hard disks and if you want to organize a software raid, please follow this description
  10. pick a kernel with apt-cache search linux | grep kernel. Make sure it corresponds with your CPU. Install it with apt-get install <kernel package name>. apt will tell you in case you need to configure /etc/kernel-img.conf. It is likely that you have to configure usage of an initrd... I have the following statements in there: do_symlinks = Yes and do_initrd = Yes
  11. install grub. grub needs a directory /boot/grub and a number of files therein. Use dpkg -L grub to find out whereabout the sample files are. Don't forget to copy the stage files over to /boot/grub. Don't forget to set up grub. The German instuctions here are very good.
  12. configure the system to use a shadow password system by shadowconfig on
  13. set the root password with passwd
  14. edit /etc/fstab in a manner you have mounted the partitions
  15. turn swap on with swapon /dev/hda1, off course with your swap partition...
  16. edit /etc/resolv.conf so that your new machine can resolve system names
  17. edit /etc/network/interfaces in order to make your new system reachable on the network
  18. edit /etc/hosts in order to facilitate network and loopback traffic - even though this is not crucial...
  19. set the /etc/hostname according to your preferences
  20. install the openssh-server in order to log into your new machine from remote. Don't forget this!!

Now reboot. The machine should come up with the new kernel.