How to set up debian or ubuntu with debootstrap
Aus Markus' Wiki
Version vom 22. Februar 2009, 22:56 Uhr von Markus (Diskussion | Beiträge)
debootstrap Mini-HOWTO Installing a fully fledged Debian or Ububtu linux system on a remote computer through a rescue disk with debootstrap
Steps:
- take care that debootstrap is available on your system
- take care that you have a good bandwidth and that downloading 500 MB won't jeopardize your finances!
- take care of the partition architecture with fdisk on the device where you'd like to install the system
- format the partitions with a filesystem of your choice. I prefer ext3 (mkfs.ext3). Also, initialize the swap space. (mkswap)
- mount your file systems in a way you want them to act later on. Use /mnt as the root directory.
- use debootstrap in order to bootstrap the complete base installation into /mnt
- then chroot /mnt
- 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.
- If you have two identical hard disks and if you want to organize a software raid, please follow this description
- 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
- 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.
- configure the system to use a shadow password system by shadowconfig on
- set the root password with passwd
- edit /etc/fstab in a manner you have mounted the partitions
- turn swap on with swapon /dev/hda1, off course with your swap partition...
- edit /etc/resolv.conf so that your new machine can resolve system names
- edit /etc/network/interfaces in order to make your new system reachable on the network
- edit /etc/hosts in order to facilitate network and loopback traffic - even though this is not crucial...
- set the /etc/hostname according to your preferences
- 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.