Installing Debian without the installer.

Share your own howto's etc. Not for support questions!

Installing Debian without the installer.

Postby edbarx » 2012-03-06 21:33

Unlike MS Windows GNU/Linux (including Debian) can be installed without using the installer. This procedure requires the use of a Live Linux CD and obviously a free partition where to install the new Debian base system.

The installation makes use of official Debian mirrors and debootstrap which installs the base system without the kernel and without doing any sort of configuration. This means, for any user to be able to log into the newly installed system, some files in /etc need to be modified just after the installation.

The installation procedure:
  1. mount the new partition:
    Code: Select all
    # mount /mnt /dev/sdax

    sdax stands for the partition to be mounted. x is a number from 1 upwards.

  2. Install the base system.
    Code: Select all
    # debootstrap --arch amd64 stable /mnt http://ftp.us.debian.org/debian

    Instead of amd64, you can use any other architecture, for example, i386 is another viable option. However, be aware that the architecture type you chose is comptable with your hardware.
    Instead of ftp.us.debian.org/debian, you can use any other mirror. Choose one that is not too far away from where you are doing the installation.

  3. Now that the base system is installed, we have to borrow /dev and /proc from the working Live Linux system.
    Code: Select all
    # mount -o bind /dev /mnt/dev

    Code: Select all
    # mount -o bind /proc /mnt/proc

  4. Copy /etc/network/interfaces and /etc/mtab from the working Live Linux system.
    Code: Select all
    # cp /etc/mtab /mnt/etc/mtab

    Code: Select all
    # cp /etc/network/interfaces /mnt/etc/network/interfaces

  5. Enter the new installation through chroot.
    Code: Select all
    # chroot /mnt /bin/bash

  6. Add the installation partition to the /etc/fstab file.
    Code: Select all
    # echo '/dev/sdax / ext4 defaults 0 0' >> /etc/fstab

    Be careful to replace ext4 with the appropriate file system for your partition.

  7. Update the new installation repository.
    Code: Select all
    # apt-get update

  8. Install a kernel. To check which kernels are available for your system, run:
    Code: Select all
    #apt-get install linux-image

    The system will respond by providing a list of viable options.

    Install a kernel.
    Code: Select all
    apt-get install linux-image-amd64

  9. Install a bootloader unless you know how to boot an installation without having menu links or you have other reasons why you would opt not to install a bootloader.
    Code: Select all
    # apt-get install grub-pc

  10. Create a root password for the installation.
    Code: Select all
    # passwd

  11. Clean the system from unnecessary files.
    Code: Select all
    # apt-get clean

  12. Exit the chroot environment.
    Code: Select all
    # exit

  13. Unmount the installation partition to flush any pending journals.
    Code: Select all
    # umount /dev/sdax


Exit the chroot environment, reboot and enjoy.
Debian == { > 30, 000 packages }; Debian != systemd
The worst infection of all, is a false sense of security!
It is hard to get away from CLI tools.
User avatar
edbarx
 
Posts: 5394
Joined: 2007-07-18 06:19
Location: 35° 50 N, 14 º 35 E

Return to Docs, Howtos, Tips & Tricks

Who is online

Users browsing this forum: No registered users and 2 guests

fashionable