2. Installation of the base system

2.1. Investigating the hardware

Before starting the installation, I boot from a KNOPPIX CD to ensure that all hardware is detected properly and the Internet connection works. While in a running system it is a good time to check your hardware and get an idea which drivesr are needed later on:

# cat /proc/cpuinfo

# cat /proc/interrupts

# cat /proc/ioports

# cat /proc/modules

# cat /proc/pci

# cat /proc/bus/usb/devices

# cat /proc/ide/piix

# ls -al /proc/ide

Other usefuls commands are

# lspci -v

# lsusb -v

You get even more detailed output using the -vv flag instead of -v.

2.2. Partitions

Working with debian-amd64 I find it beneficial to have three systems installed: the pure64 port, the gcc-3.4 port, and a classical ia32, i.e. the standard i386 Debian port. The ia32 is mainly used as a chroot environment for applications which are not yet compilable or executable for 64-bit, however, I decided to install ia32 as a fully workable system as well. My standard working environment (default boot) however is gcc-3.4.

Additionally, I have created one /boot partition which is shared by all three linuxes. This partition also keeps the GRUB configuration files, all kernel images and initrd files in order to have easy access to them independently of the system currently running.

2.3. Installing Linux from another system

If you have another system running on the same architecture (e.g. i386) and want the almsot same setup on your new machine, you can easily clone the existing installation. Start any boot system, e.g. Knoppix, and mount the installation partition e.g. to /mnt. Give write-access to this partition. Now one command is sufficient:

# ssh <IP address of remote host> tar clf - / | (cd /mnt; tar xf - )

Check your mountpoints in /mnt/etc/fstab, and - if you do this on olde laptops - you should check APM/ACPI settings.

2.4. Installing Linux with debootstrap

The easiest for me to create a Debian system from scratch is using debootstrap and then copy settings (e.g. for KDE, but also /etc from another existing system).

Boot from a random linux system, e.g. KNOPPIX, become root, and create a directory for your new installation (in my case, most often this is sid/unstable):

# mkdir /sid

Now mount the partition of your hard drive which should contain the new system. You can check existing partitions with fdisk –l or qtparted, and you can create a new filesystem with mkfs.ext3 /dev/hdaX.

# mount /dev/hdaX /sid

Now debootstrap Debian to the partition:

# debootstrap --arch i386 sid /sid/ http://ftp.de.debian.org/debian/

The --arch i386 is optional and supports e.g. debootstrapping amd64 (--arch amd64) from within an ia32-KNOPPIX. Now copy some basic network settings into the /sid hierarchy. Ideally, you do this from another system. If you copy the KNOPPIX files be aware that some of these are symbolic links, copy the real files and not the links.

# cd /etc

# cp hosts hostname resolv.conf modules /sid/etc

# cp /etc/network/interfaces /sid/etc/network/interfaces

# cp /atc/apt/sources.list /sid/etc/apt/sources.list

To finish the base configuration change into the new system and run a base-config:

# chroot /sid

# apt-get -f install

# base-config

# mount -t proc none /proc

Everything very self-explaining. It is important to adopt the sources list to Alioth. This can be done either directly in /etc/apt/sources.list, or within the base-config.

# /etc/apt/sources.list

# Unstable
deb http://ftp.de.debian.org/debian unstable main contrib non-free
deb http://ftp.de.debian.org/debian-non-US unstable/non-US main contrib non-free

# Sources
deb-src http://ftp.de.debian.org/debian unstable main contrib non-free
deb-src http://ftp.de.debian.org/debian-non-US unstable/non-US main contrib non-free

Then do

# install-keymap de-latin1-nodeadkeys

2.5. Configuring the bootloader (GRUB)

  1. First of all, prepare GRUB as the bootloader. Make sure you are still in the chroot environment. Otherwise

    # chroot /sid

  2. Install GRUB:

    # apt-get install grub

    # mkdir /boot/grub

    # cp /usr/lib/grub/i386-pc/* /boot/grub

    Configuration of grub is done in /boot/grub/menu.lst:

    # /boot/grub/menu.lst
    
    hiddenmenu
    timeout 0
    default 0
    fallback 0
    
    # /dev/hda10 = (hd0,9):     /boot (contains kernels, initrds etc.)
    # /dev/hda8  = (hd0,7):     /     (contains amd64/pure64 port)
    
    title Debian Linux AMD64 - 2.6.7-k8 (pure64)
            root (hd0,7)
            kernel (hd0,9)/vmlinuz-2.6.7-4-k8 root=/dev/hda8 vga=0x317
            initrd (hd0,9)/initrd.img-2.6.7-4-k8

    The kernel parameter vga=0x318 boots into a 1024x768 console, for 1280x1024 use vga=0x31b.

  3. Before proceeding with the kernel installation and configuring GRUB ensure that /etc/fstab is configured properly and contains the new partitons (particularly, / must be set to the correct mount point for the new installation). ALso, when GRUB is to be installed to floppy /dev/fd0 must be included into /etc/fstab.

  4. Install the kernel (check for latest version), and adopt /boot/grub/menu.lst

    # apt-get install kernel-image-2.6.7-4-k8-amd64

    Because I have to compile some modules on my own (e.g. WLAN driver, amaroK etc.) I also need the kernel sources.

    # apt-get install kernel-image-2.6.7-4-k8-amd64 kernel-source-2.6.7-4-k8-amd64

  5. If you run into any errors check whether initrd has been installed properly in /boot. You may run

    # dpkg-reconfigure kernel-image-2.6.7-4-k8-amd64

    to repair the installation. There will be some messages informing you that you have to manually configure your bootloader. This is okay and has been done already above. I prefer to not have the symlinks but configure the kernel versions straight ahead (as above).

  6. Leave the chroot environment (exit), then install the bootloader. For testing (remember, I am extremely cautious regarding my existing installations) I installed GRUB to a floppy first:

    # grub-install --root-directory=/sid '(fd0)'

    You may also stay in the chroot and can then omit the --root-directory option.

  7. Now reboot from the disk… works. Good to have a boot disk anyway.

  8. GRUB is so much more capable than the Windows bootloader, so replace this one completely. Expand the configuration in /boot/grub/menu.lst to also boot my Windows sytems

    # /boot/grub/menu.lst
    
    timeout 10
    default 1
    fallback 1
    
    # Booten sollte immer von erster Platte erfolgen
    
    # /dev/hda10 = (hd0,9):  kenrnels, initrd, boot partition for all Linux
    # /dev/hda8  = (hd0,7):  amd64 pure64
    # /dev/hda9  = (hd0,8):  amd64 gcc-3.4
    # /dev/hda11 = (hd0,10): ia32
    
    title Debian Linux AMD64 - 2.6.7-k8 (pure64)
            root (hd0,7)
            kernel (hd0,9)/vmlinuz-2.6.7-4-k8 root=/dev/hda8 vga=0x317
            initrd (hd0,9)/initrd.img-2.6.7-4-k8
    
    title Debian Linux AMD64 - 2.6.8-3-amd64-k8 (gcc-3.4)
            root (hd0,8)
            kernel (hd0,9)/vmlinuz-2.6.8-3-amd64-k8 root=/dev/hda9 vga=0x317
            initrd (hd0,9)/initrd.img-2.6.8-3-amd64-k8
    
    title Debian Linux i386 - 2.6.8-1-i686
            root (hd0,10)
            kernel (hd0,9)/vmlinuz-2.6.8-1-686 root=/dev/hda11 vga=0x317
            initrd (hd0,9)/initrd.img-2.6.8-1-686
    
    title Microsoft Windows XP 32-bit
            rootnoverify (hd0,0)
            chainloader +1
  9. Install GRUB in the MBR of the hard drive:

    # grub-install --root-directory=/debian /dev/hda

  10. Reboot to test.

2.6. Lessons learned

  • Installation of amd64 base system as outlined in my installation report. Incidentially used the monolithic kernel as suggested in the AMD64 HOWTO, run into module issues very soon and to change to 2.6.7-k8 (non-monolithic kernel).

  • Kernel version can be checked with

    # uname -a

  • In order to share the 160GB with Windows I have formatted it with FAT32 (vfat), however, had to realize later on that FAT filesystem have a filesize limitation of 2GB which is unsuitable to store partition images. I therefore repartioned the drive into a 120GB ext3 and 40GB fat and mounted both below my home directory.

2.7. Further ressources

The APT HOWTO in german or english.

The Debian Documentation Project.

Debian Forum.