Debootstrap – all steps

Installing Debian GNU/Linux from another Unix/Linux System

This article will show how to install a Debian GNU/Linux on a existing
Linux server which is up and running.

A more detailed information about this stuff you will be able to get
on http://www.debian.org/releases/stable/i386/apds03.html

Following steps should be followed in order.

Getting debootsrap:

cd /root
mkdir tmp
cd tmp
wget http://ftp.debian.org/debian/pool/main/d/debootstrap/debootstrap_1.0.26+squeeze1_all.deb
ar -x debootstrap_1.0.26+squeeze1_all.debar -x debootstrap_1.0.26+squeeze1_all.deb
cd /
zcat /root/tmp/data.tar.gz | tar xv

Making the base directory for the chroot enviroment:

mkdir /mnt/debian

Mounting the target partition (we are assuming target partition is a Linux
metadevice):

mount /dev/md1 /mnt/debian/
/usr/sbin/debootstrap --arch amd64 squeeze /mnt/debian/ http://ftp.us.debian.org/debian

Copying the reusable information:

cp /etc/hosts /mnt/debian/etc/
cp /etc/hostname /mnt/debian/etc/
cp /etc/network/intefaces /mnt/debian/etc/network/
cp /etc/fstab /mnt/debian/etc/

/dev/md1 / ext4 defaults 1 1
devpts /dev/pts devpts gid=5,mode=620 0 0
none /proc proc defaults 0 0
none /tmp tmpfs defaults 0 0
sysfs /sys sysfs defaults 0 0

cp /etc/mdadm.conf /mnt/debian/etc/

MAILADDR root
AUTO +imsm +1.x -all
DEVICE /dev/sda* /dev/sdb*
ARRAY /dev/md1 devices=/dev/sda1,/dev/sdb1
ARRAY /dev/md3 devices=/dev/sda3,/dev/sdb3

cp /etc/inittab /mnt/debian/etc/

# getty in a serial console:
T0:2345:respawn:/sbin/getty -L ttyS0 57600 vt100

Cheking if serial console port is in seccuretty file:

vim /mnt/debian/etc/securetty
# ttyS0 must be listen into this file

Adjusting the source.list

vim /mnt/debian/etc/apt/sources.list

Mounting needed resources:

mount -t proc proc /mnt/debian/proc
mount -o bind /dev/ /mnt/debian/dev/

Entering in the chroot enviroment:

LANG=C chroot /mnt/debian/ /bin/bash

Mounting extra resources needed

mount /dev/pts/
mount /sys

Changing password. We usually  forget this step and due to this fact then we can
not login into the server.

passwd root

Installing needed packages (kernel, tools, modeules required, bootloader):

apt-get install vim ssh lvm2 mdadm bridge-utils
apt-cache search linux.image
apt-get install linux-image...
apt-get install grub2

Configuring grub

vim /etc/default/grub
# set console output on grub

update-grub

Reviewing all settings:

vim /boot/grub/grub.cfg
vim /etc/inittab
vim /etc/fstab
vim /etc/network/interfaces

Finally, exit to the chroot enviroment and execute the reboot command.

… and Good luck !!!

Advertisements

One thought on “Debootstrap – all steps

  1. # If you change this file, run ‘update-grub’ afterwards to update
    # /boot/grub/grub.cfg.

    GRUB_DEFAULT=0
    GRUB_TIMEOUT=5
    GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
    GRUB_CMDLINE_LINUX_DEFAULT=”quiet”
    GRUB_CMDLINE_LINUX=”console=tty0 console=ttyS0,57600n8″

    # Uncomment to enable BadRAM filtering, modify to suit your needs
    # This works with Linux (no patch required) and with any kernel that obtains
    # the memory map information from GRUB (GNU Mach, kernel of FreeBSD …)
    #GRUB_BADRAM=”0x01234567,0xfefefefe,0x89abcdef,0xefefefef”

    # Uncomment to disable graphical terminal (grub-pc only)
    GRUB_TERMINAL=serial
    GRUB_SERIAL_COMMAND=”serial –speed=57600 –unit=0 –word=8 –parity=no –stop=1″

    # The resolution used on graphical terminal
    # note that you can use only modes which your graphic card supports via VBE
    # you can see them in real GRUB with the command `vbeinfo’
    #GRUB_GFXMODE=640×480

    # Uncomment if you don’t want GRUB to pass “root=UUID=xxx” parameter to Linux
    #GRUB_DISABLE_LINUX_UUID=true

    # Uncomment to disable generation of recovery mode menu entries
    #GRUB_DISABLE_LINUX_RECOVERY=”true”

    # Uncomment to get a beep at grub start
    #GRUB_INIT_TUNE=”480 440 1″

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s