The Debian Maintenance HOWTO
Chapter 2 - Installation
The installation section only covers installation on intel x86 compatible
systems. Except for the boot medium all chapters also apply for other
architectures. Please also read the official
installation documentation.
2.1 Boot Medium
There are several ways to install Debian on your computer. While the most convenient method which runs from the network entirely requires the machine to be able to boot off of the network, only few machines can do that, especially non-intel-based ones like sparc, mips or powerpc machines. Other ways use a CD or a floppy disk.
The following will describe some ways to install Debian. Please keep in mind that you can still do a full floppy installation if this doesn't work. However, you will need to have 17 sane floppy disks available (for Debian woody). This can become a showstopper... So you may want to consider purchasing a professionally pressed CD set.
If still doesn't work because your BIOS may be too old and may not support
ISOLINUX you write the Smart Boot Manager image sbm.bin to a
floppy which you can find in the install directory. This will
boot an OS independent boot manager. To write the image to a floppy use
dd if=sbm.bin of=/dev/fd0 (for GNU/Linux or Unix) or use
rawrite (for MS-DOS).
If you can't boot off of your CD-ROM drive, create your own boot and root disk
(rescue.bin and root.bin) and try to use the
remaining (drivers, base, packages) from CD-ROM. If you can't get your CD-ROM
recognized by the kernel, you can copy the entire cd to your harddisk and use
it from there. Since Linux can read vfat you can copy it file by file to your
windows partition or by copying the image and using mount -t iso9660 -o
loop /path/to/image /mnt to mount it via loopback.
2.1.1 Floppy Images
Proper floppy disk images are provided by debian.org at ftp.debian.org
for various architectures. There are images for 1.2, 1.44 and 2.88 MB large
disks. Images are called *.bin, you will have to write them to a
floppy by using dd under unix or rawrite under dos.
2.1.2 CD Images
The Debian project also provides readily mastered cd images for their stable
distribution. They are bootable and optionally contain non-US stuff as well.
Please find them on cdimage.debian.org or at linuxiso.org. Both
places contain images for various architectures.
2.2 Hardware
Debian uses the Kernel produced and maintained by Linus Torvalds. Due to this fact there is no special Debian Hardware list available. All the hardware that will work with the same kernel version, will work with Debian as well.
Debian GNU/Linux 2.2 alias potato is shippped with Linux Kernel 2.2 and a possibility to upgrade to Linux Kernel 2.4.0. This includes support for all kind of IDE and SCSI devices. Using the newer kernel you will also be able to use USB mostly out-of-the-box.
If you occur hardware problems or want to know if something is supported by
Linux, a good address seems to be the SuSE
Support Database. Even though this database is maintained by a
different vendor, much of its content applies not only to their distribution
but to any, which makes it a worthful resource.
2.3 Preload Modules
From Debian GNU/Linux 2.2r2 you are able to preload modules during the installation. This step should only be required if your harddrives are not recognized or you need a network connection during installation. Your harddrive may not be automatically recognized by Linux if it uses a hardware raid devices.
The preload-step will read additional modules from a special floppy disk that you have to create. You'll need to format the floppy disk with the msdos, ext2 or minix filesystem and place all required modules in the main directory of it.
The driver modules on this special floppy disk have to match the kernel used on
the boot disk. If your driver is already in the standard kernel, try to use
the one from the drivers.tgz file. If that doesn't work, compile
the module on your own.
2.4 Configuring Device Driver Modules
During installation you are asked to configure your device driver modules.
This is just another name for kernel modules, thus the modules in question are
stored in the /lib/modules directory. Normally you can and should
skip most of the modules. Only a few are required to be configured.
The Linux kernel uses a sophisticated mechanism to automatically load modules that are to be used. This feature makes it almost superflous to load modules at boot time. The only exception refers to modules that interact with certain hardware which is not unique (such as an ethernet card, a scsi adapter, a soundcard etc.)
In this step you should only configure your ethernet card, your ISDN card and
if possible your soundcard. Leave everything else untouched, i.e don't install
any filesystems and additional stuff, it will only eat up processor cycles and
ram space. These modules will be loaded automatically by the kernel. On the
other hand, the modules you have configured will be loaded at boot time when
your machine boots. The name of these modules will be added to
/etc/modules and may be edited at any time later.
If you feel that you have skipped too much of the device driver configuration
and want to repeat this step, you can do that at any later time. The program
called was modconf which may be
issued at any later time to configure device drivers. It will read modules
from /lib/modules, so if you have comiled your own kernel without
modules, modconf won't be able to do much.
2.5 Network
During the installation you have the opportunity to configure your network. If you plan to use the system as something else than a single system with no network access, please configure your network here. You won't be presented another simple way to configure it. If you forget to configure your network during the installation routine you have to edit the files named below manually.
2.5.1 /etc/hostname
This file contains the simple hostname of the machine (i.e. klecker instead of klecker.debian.org). This is the name that will be displayed at part of the login prompt, for example. You can use the fully qualified domain name (fqdn), *getty would use it instead.
2.5.2 /etc/hosts
This file contains the local mapping of ip addresses and hostnames, both simple and fqdn. Depending on your host order this file has the power to override even DNS entries. There should be at least one entry in that file like the following:
127.0.0.1 localhost hostname.domain.org hostname
If your host is connected to a network with an official IP address and an
official hostname, you should leave out all names except of localhost. For
details please refer to the manpage of hosts.
2.5.3 /etc/host.conf
This file controls how name lookups are performed on your system. Normally the
file /etc/hosts is queried before nameserver lookups are
performed. This is controlled by the following contents. For details please
refer to the manpage of host.conf.
order hosts,bind
multi on
reorder on
2.5.4 /etc/resolv.conf
This file tells your resolver library which nameserver to query. Normally one
or two nameservers are listed there, or localhost if the machine runs its own
nameserver. The file's contents look like the following. For details please
refer to the manpage of resolv.conf.
search infodrom.ffis.de infodrom.north.de north.de
nameserver 134.106.1.7
nameserver 127.0.0.1
2.5.5 /etc/network/interfaces
Since Debian 2.2 alias potato the network configuration is handled by this
file. It is read by /etc/init.d/network if that is a proper
start/stop (you will notice by scanning through the file and looking for a
case-statement). In that case the file contains the entire
configuration of network devices. For a machine with a real ethernet card
(contrary to PCMCIA) it should look like the following example. For details
please refer to the manpage of interfaces.
iface lo inet loopback
iface eth0 inet static
address 206.246.226.45
network 206.246.226.0
netmask 255.255.255.0
broadcast 206.246.226.255
gateway 206.246.226.1
If you are already running the unstable distribution you need to add one more statement or no devices would be initialized at boot time:
auto lo eth0
If your machine is connected to a network that provides BOOTP or DHCP for maintaining IP addresses, this is supported as well, please read the manpage to find out the syntax.
2.5.6 /etc/init.d/network
This file reflects the network setup prior to Debian 2.2 alias potato. While
it is a real init-script in potato, it was a plain and simple script to
activate the network. If your /etc/init.d/network-file looks like
the following and doesn't contain start- and
stop-entries it should contain the entire network configuration as
given in the following example:
ifconfig lo 127.0.0.1
route add -net 127.0.0.0 dev lo
IPADDR="195.27.69.162" # Your IP address.
NETMASK="255.255.255.240" # Your netmask.
NETWORK="195.27.69.160" # Your network address.
BROADCAST="195.27.69.175" # Your broadcast address (blank if none).
GATEWAY="195.27.69.161" # Your gateway address.
/sbin/ifconfig eth0 ${IPADDR} netmask ${NETMASK} broadcast ${BROADCAST}
/sbin/route add -net ${NETWORK}
[ ! -z "$GATEWAY" ] && /sbin/route add default gw ${GATEWAY}
2.6 Passwords
Once the base system is installed on your new Debian machine you'll have to reboot the system and will be asked to set your root password and create a user account.
You should always create a user account since you should not overstress your root-account. Especially for new users to Unix/Linux the root account should only be used as exception. The account is dangerous since it bypasses nearly all security limitations and permissions. Even worse, programs designed to be started as user and run as different user may misbehave when started as root.
Installing Debian you'll have some possibilities to maintain passwords. The following list should explain some of the differences.
2.6.1 Shadow Passwords
Shadow passwords will give you a little bit more security since encrypted
passwords won't be stored in a publically readable file
(/etc/passwd) anymore but in a special file
(/etc/shadow) that only root and certain programs may read. You
should always select this option if your system is not a single-user system and
you don't plan to use NIS. With NIS there are reports that it won't work with
shadow passwords.
2.6.2 DES-Encrypted Passwords
Normally a unix system uses a variant of DES (Data Encryption Standard) algorith for encrypting passwords. This algorithm is said to be quite secure, however exhaustive searches of its key space are possible using massively parallel computers.
2.6.3 MD5-Encrypted Passwords
Linux libraries support another algorithm to encrypt passwords, it is MD5. This algorithm is said to be more secure than the above DES and thus should be preferred among those.
2.7 Selecting Tasks
During the installation you will be provided with a list of less than 50 so called task packages. This will allow you to skip the selection of more than 3900 single packages. Each task package reflects one task that your future system will perform. Once you have selected the tasks the program manager will install the referenced packages.
If you have forgotton something you can repeat this step at any later stage by
calling the program tasksel. This requires the similar named
package to be installed already (issue apt-get install tasksel
otherwise).
2.8 Installing Packages
At the end of the installation all selected packages will be installed. Below you'll find several ways to repeat package installation and information how to install new packages. Debian packages may use several ways to configure themself. During the installation some packages need interact with the user and ask a couple of questions.
You should answer these questions as good as you can. For example exim (or any
other mail transport agent) want to know about the hostname, a smart host and
others. If you are absolutely unsure, select the 'No configuration at all'
item, but please run eximconfig (or a similar tool) as soon as you
can afterwards. (Warning: I've once seen an smail going mad while not
configured trying to deliver a mail to root.)
2.9 Configuring X11
For new users who want to run a graphical environment on their machine this is the most important task. First of all you should know what kind of graphics card is in your system. Depending on this information you'll need to select the X-server (e.g. xserver-svga for Matrox G200 cards). You will be asked for every server if that server should become the default X-Server and if you want to configure it. Deny this for every wrong server.
The utilities used to configure your X-Server are xf86config and
XF86Setup. If you don't manage to get your x-server configured
properly during installation, please skip that and retry later by using one of
these tools directly.
To find out which X-Server you need, I can only direct you to the XFree86 web site at the moment. More
information to be expected.
In Debian unstable or XFree86 4.x there is a new configuration utility called
dexconf to be used with that version of XFree86.
2.9.1 Using XDM
Wether XDM is started upon system boot and provides a graphical login is
controlled by the package xdm. It will only work that way if that
package is installed. The same applies to GDM and KDM and their respective
packages gdm and kdm.
2.9.2 Keyboard Layout
There are three or four places where the keyboard layout for X11 is configured. They are listed in the order of their appearence/overwrite capability.
2.9.2.1 /etc/X11/XF86Config
This is the main configuration file for XFree86. To configure the keyboard a section of its own has to be edited. For example, to use an american keyboard you would use the following:
Section "Keyboard"
Protocol "Standard"
XkbKeymap "xfree86(us)"
EndSection
If you have a German keyboard and want to use it with the same keybinding, you would use something like the following configuration section:
Section "Keyboard"
Protocol "Standard"
XkbLayout "de"
XkbVariant "nodeadkeys"
EndSection
2.9.2.2 xmodmap
You can modify your keyboard mapping with xmodmap. Please find an
example in /usr/X11R6/lib/X11/etc/xmodmap.std and read about the
syntax in the xmodmap manpage. To find out the keycode for
pressed key, use the xev program to display.
2.9.2.3 xkeycaps
This program provides a graphical interface to the keyboard and its mapping.
2.9.2.4 KDE/Control Center
KDE uses its own method to map the keyboard, overloading the regular X11 settings. You are able to modify the keyboard mapping on each session.
2.10 Configuring ISDN
Many users in Europe use ISDN as a means to connect their machine to the internet in favour to slower modem connections. Once your card was detected setting up ISDN for dialin is quite easy.
First of all you need the kernel detect your isdn card. To make this happen,
start the program modconf. The HiSax module (given that you use
one of many cards that ship with that Siemens chipset) is in section misc.
Upon configuration you'll have to specify which ISDN card you use. After that
is done, the kernel should recognize the card and provide an interface to the
ISDN subsystem. modconf will display if it was successful or not.
Once the card is detected properly install the isdnutils package
and run the program isdnconfig. This program will create some
template files for you that help you set up ISDN services. For dial on demand
you will need to create network devices (device.ippp0) and
synchronous ppp (ipppd.ippp0).
These files are only template files and you have to edit them manually in order
to get ISDN configured. As a hint: the password may be stored in
/etc/ppp/chap-secrets or /etc/ppp/pap-secrets instead
of within the /etc/isdn directory where the isdn configuration
resides.
2.11 Custom Boot Floppies
If you want to run Debian GNU/Linux on hardware that is not supported by the boot-floppies you will have to create your own boot floppies. This may be required if you want to install Linux on a hardware raid system, LVM or ReiserFS and you can't use a preloaded module with the regular installation process.
Before modifying the Debian boot-floppies you should first understand how they work. The following list should spread some light on this.
-
Debian boot-floppies contain a dos filesystem which make it easy to modify for anybody.
-
Debian uses
syslinuxto boot an intel-based pc off of floppies. This means that each boot-floppy has to contain a fileldlinux.systhat is used like a driver in dos-speaking.
-
syslinuxis configured through the filesyslinux.cfg. That file contains information about the boot process, i.e. additional parameters for the Linux kernel.
-
The boot floppy contains a file named
linuxwhich is a compressed (bzip2orgzip) Linux kernel.
-
Additionally you'll find
sys_map.gzwhich is copied to/boot/System.maplater.
-
The root image (
root.bin) is an ext2 filesystem, compressed and padded with zeros.
If you have to modify the boot-floppy you'll have to mount the floppy loopback, modify it and umount it. Mounting is done with the following command.
mount -o loop -t msdos rescue.bin /mnt/
Modifying the root image (e.g. for including lvmtools) this process is a little bit more trickier. You'll have to stake the following stages:
-
Since the root image is a compressed file you'll have to decompress it. This is done by
zcat root.bin > /tmp/rootfs
-
Now you can mount it just like the boot image, except that you'll have to use a different filesystem.
mount -o loop -t ext2 /tmp/rootfs /mnt/
-
Now you can freely modify it. Please take into account that there is not much space left over on the root filesystems and that the included glibc is a stripped down version that may not work with regular executables. Thus it may be required to build static binaries for additional programs. Since they are larger than shared binaries, you may need a third floppy disk for supplying it.
-
Once you have modified the root filesystem you have to fold it back into the compressed root image. Normally it is not required to padd it with zeroes, though it's more reliable if you do. After umounting the directory the following steps will work:
gzip -9 < root > root.gz dd if=/dev/zero of=root.bin bs=1k count=1440 dd if=root.gz of=root.bin bs=1k count=1440 conv=notrunc
The Debian Maintenance HOWTO
November 23rd, 2014Joey Schulze, joey@infodrom.org
