Chapter 3 - Tips for installing a Debian system
- 3.1 General installation of a Linux system
- Basics 3.1.1 Hardware compatibility
- 3.1.2 Determining a PC's hardware
- 3.1.3 Determining a PC's hardware via Debian
- 3.1.4 Determining a PC's hardware via other OSs
- 3.1.5 A Lilo myth
- 3.1.6 GRUB
- 3.1.7 Choice of boot floppies
- 3.1.8 Installation
- 3.1.9 Hosts and IP to use for LAN
- 3.1.10 User accounts
- 3.1.11 Creating file system
- 3.1.11.1 Hard disk partition
- 3.1.11.2 Mount filesystems
- 3.1.11.3 Autofs
- 3.1.11.4 NFS mount
- 3.1.12 DRAM memory guidelines
- 3.1.13 Swap space
Official documentation for installing Debian is located at http://www.debian.org/releases/stable/ and http://www.debian.org/releases/stable/installmanual
The development versions are in http://www.debian.org/releases/testing/ and http://www.debian.org/releases/testing/installmanual (work in progress, sometimes this may not exist).
Although this chapter was written during the days of the Potato installer, most of its content has been updated to the Woody installer. Both installers are very similar. Since Sarge will use a totally new installer, please consider the following as a reference point for the Sarge installer. Also some key packages have changed names and priorities. For example, the default MTA of Sarge is exim4 instead of exim and has been included coreutils to replace several packages. You may need some modifications.
3.1 General installation of a Linux system
Do not forget to check http://www.debian.org/CD/netinst/ if you are looking image of the Debian installer CD.
Running the testing or unstable distribution increases the risk of hitting serious bugs. This can be avoided by creating a multi-boot scheme more stable versions of Debian, or using a trick provided by chroot in the most stable version as explained in chroot Section 8.6.35. The latter will enable running different Debian distributions simultaneously on different consoles.
Basics 3.1.1 Hardware compatibility
Linux supports most PC hardware and can be installed in almost any system. For me it was as easy as installing Windows 95/98/Me. The hardware compatibility list just seems to keep growing.
If you have a laptop PC, check Linux on Laptops for installation pointers by brand and model.
My recommendation for the hardware in a desktop PC is "Just be conservative":
- SCSI instead of IDE for work, IDE / ATAPI for personal use.
- CD-ROM IDE / ATAPI CD-ROM (or CD-RW).
- PCI rather than ISA, especially for network cards (NIC).
- Use a cheap NIC. Tulip for PCI, NE2000 for ISA are good.
- Avoid PCMCIA (notebook) as your first Linux install.
- No USB keyboard, mouse, ... unless you want a challenge.
If you have a slow machine, yanking out the hard drive and plugging it into another faster machine for installation is a good idea.
3.1.2 Determining a PC's hardware
During installation, you are asked to identify the hardware or chip in your computer. Often this information is not easy to find. Here is one method
3.1.3 Determining a PC's hardware via Debian
On a Linux system, these commands should give some idea of actual hardware and configuration.
$ Pager / proc / pci $ Pager / proc / interrupts $ Pager / proc / ioports $ Pager / proc / bus / usb / devices
These commands can be run during the installation process from the console screen by pressing Alt-F2.
After the initial setup and installation of optional packages pciutils usbutils and lshw you can obtain more extensive system
$ Lspci-v | pager $ Lsusb-v | pager # Lshw | pager
Typical uses of interrupts:
- IRQ0: timer output (system clock) (8254)
- IRQ1: keyboard controller
- IRQ2: cascade to IRQ8-IRQ15 on PC-AT
- IRQ3: secondary serial port (io-port = 0 × 2F8)
/dev/ttyS1 - IRQ4: primary serial port (io-port = 0 × 3F8)
/dev/ttyS0 - IRQ5: free [sound card (SB16: io-port = 0x220, DMA-low = 1, DMA-high = 5)]
- IRQ6: floppy disk controller (io-port = 0 × 3F0)
/dev/fd0 /dev/fd1 - IRQ7: parport (io-port = 0 × 378)
/dev/lp0 - IRQ8: rtc
- IRQ9: software interrupt (int 0 × 0A), redirect to IRQ2
- IRQ10: free [network interface card (NE2000: io-port = 0x300)]
- IRQ11: free [(SB16-SCSI: io-port = 0x340, SB16-IDE: io-port = 0x1E8, 0x3e)]
- IRQ12: PS / 2
- IRQ13: free (was 80287 math coprocessor)
- IRQ14: primary IDE controller
/dev/hda /dev/hdb - IRQ15: secondary IDE controller
/dev/hdc /dev/hdd
For old ISA card that PnP is not the kind you may want to set IRQ5, IRQ10, and IRQ11 as non-PnP from the BIOS.
For USB devices, device classes are in /proc/bus/usb/devices as Cls = nn:
- Cls = 00: Unused
- Cls = 01: Audio (speaker etc..)
- Cls = 02: Communication (MODEM, NIC, ...)
- Cls = 03: HID (Human Interface Device: keyboard, mouse, joystick)
- Cls = 07: Printer
- Cls = 08: Mass storage (FDD, CD / DVD drive, HDD, Flash, ...)
- Cls = 09: Hub (USB)
- Cls = 255: Vendor specific
If the device class is not 255, Linux supports.
3.1.4 Determining a PC's hardware via other OSs
Hardware information can also be obtained from other OSs:
Install another commercial Linux distribution. Hardware detection is usually better than in Debian as of now (this should change once debian-installer is introduced with Sarge).
Install Windows. Hardware configuration can be obtained by clicking with the right mouse button on "My Computer" to get to Properties / Device Manager. Enter all available information such as IRQ, port address, I / S and DMA. Some old ISA cards may need to be configured under DOS and used accordingly.
3.1.5 A Lilo myth
"Lilo is limited to 1024 cylinders." WRONG!
The new lilo used after Debian Potato has lba32 support. If the BIOS of your motherboard is recent enough to support lba32, lilo should be able to load beyond the old 1024-cylinder limit.
Just be sure to add a line reading "lba32" somewhere near the beginning of your file lilo.conf as it retains an old version of it. See /usr/share/doc/lilo/Manual.txt.gz
3.1.6 GRUB
The new boot loader grub from the GNU Hurd project can be installed on a Debian Woody system:
# Apt-get update # Apt-get install grub-doc # Mc / usr / share / doc / grub-doc / html / ... read contents # Apt-get install grub # Pager / usr / share / doc / grub / README.Debian.gz ... read
To edit the GRUB menu, edit /boot/grub/menu.lst See Setting boot parameters (GRUB), Section 8.1.6 for how to set boot parameters during the boot process since it is slightly different from the configuration of lilo
3.1.7 Choice of boot floppies
For Potato, I liked the IDEPCI disk set for normal install to a desktop PC. For Woody, I like the set of disks bf2.4. Both use a version of boot-floppies to create boot disks.
If you have a PCMCIA network card, you need to use all the standard boot disk (the largest set of floppies but all driver modules available) and configure the NIC in the PCMCIA, not try to set in the configuration dialog standard network.
For special systems, you need to create a custom boot disk. This can be done by replacing the kernel image named "linux" in Debian rescue disk to another compressed kernel image, compiled elsewhere on the machine. The details are documented in the file readme.txt on the rescue disk. The rescue floppy uses the MS-DOS files, so you can use any system to read and edit. This should make things easier for people with a special network card, etc..
For Woody, it is expected that debian-installer and / or pgi be used for creating boot floppies.
3.1.8 Installation
Follow the official instructions found in http://www.debian.org/releases/stable/installmanual or http://www.debian.org/releases/testing/installmanual (work in progress, sometimes this may not exist).
If you are installing a system using discos de arranque from the testing distribution, you may need to open a console terminal during the installation process by pressing Alt-F2 and manually edit /etc/apt/sources.list entries, " stable "to" testing "to adjust APT sources.
I tend to install lilo into places like /dev/hda3 while installing mbr on /dev/hda This minimizes the risk of overwriting boot information.
Here is what I choose during the installation process.
- MD5 passwords "yes"
- shadow passwords "yes"
- Install "advanced" (dselect **) and the selection
- Exclude emacs (if selected), nvi, tex, telnet, talk (d);
- Include mc, vim, nano-tiny or elvis-tiny.Véase
dselectSection 6.2.3. Even if you are an Emacs fan, avoid it now and be content with nano during install. Also avoid installing other large packages such as TeX (Potato used to did). See Rescue editors, Section 11.2 for the reason for installing nano-tiny or elvis-tiny.
- To all the configuration questions = "y" (replace current) during each installation dialog each package.
-
eximselect 2 for machine since I send mail through my ISP's SMTP server.
For more information on dselect, see dselect Section 6.2.3.
3.1.9 Hosts and IP to use for LAN
Example of LAN configuration (C subnet: 192.168.1.0/24):
Internet | + --- External ISP provides POP service (accessed by fetchmail) | Access point ISP provides DHCP service and SMTP relay |: Cable modem (Dialup) |: External port gateway on the LAN: eth0 (IP given by ISP's DHCP) use old notebook PC (IBM Thinkpad, 486 DX2 50 MHz, 20 MB RAM) run the Linux 2.4 kernel with ext3 filesystem. run the package ipmasq "(with protection, NAT and firewall) run the package "dhcp-client" package configured for eth0 (note the DNS configuration) run "dhcp" package configured for eth1 run "exim" as the smarthost (mode 2) run "fetchmail" with a long interval (fallback) run "bind" as the cache nameserver for Internet from LAN as authoritative nameserver for the domain of local network run "ssh" on port 22 and 8080 (connect from anywhere) run "squid" as the cache server for the Debian archive (for APT) Internal port gateway on the LAN: eth1 (IP = 192.168.1.1, fixed) | + - LAN Switch (100 base T )---+ | | Some clients on LAN Some DHCP clients fixed IP LAN (IP = 192.168.1.2-127, fixed) (IP = 192.168.1.128-200, dynamic)
See Network Configuration, Chapter 10 for details of configuring a gateway of a LAN. See Configuring a gateway, Section 10.12 for details of configuring the LAN gateway server.
3.1.10 User accounts
To achieve a consistent feel across machines, on my system the first few accounts are always the same.
I always create a first user account with a name like "admin" (uid = 1000). I forward all root email there. This account belongs to the adm group (see "Why su GNU does not support the wheel group", Section 9.2.2), which can be given a good amount of root privilege through the command su using PAM or the sudo See Add a user account, Section 4.1.3 for details.
3.1.11 Creating file system
3.1.11.1 Hard disk partition
Prefer to use different partitions for different directory trees to limit damage upon system crash. For example,
/ == (/ + / Boot + / bin + / sbin) == 50MB + / tmp == 100MB + / var == 100MB + / home == 100MB + / usr == 700MB + with X / usr / local == 100MB
The size of the directory /usr very dependent on X Window applications and documentation. /usr/ can be 300MB if one runs a console terminal only, whereas 2GB-3GB is not an unusual size if one has installed many Gnome applications. When /usr/ grows too big, move the directory /usr/share/ to another partition is the most effective cure. With prepackaged Linux 2.4 kernels, / may need more than 200MB.
For example, the current status of my Internet gateway machine is as follows (output of df-h command):
Filesystem Size Used Avail Use% Mounted on / dev/hda3 300M 106M 179M 38% / / dev/hda7 100M 12M 82M 13% / home / dev/hda8 596M 53M 513M 10% / var / dev/hda6 100M 834k 94M 1% / var / lib / cvs / dev/hda9 596M 222M 343M 40% / usr / dev/hda10 596M 130M 436M 23% / var / cache / apt / archives / dev/hda11 1.5G 204M 1.2G 14% / var / spool / squid
(The large area reserved for /var/spool/squid is for a proxy cache for package downloading)
Below is the output of fdisk-l gives an idea of partition structure:
# Fdisk-l / dev / hda # comment / dev/hda1 1 41 309928 + 6 FAT16 # DOS / dev/hda2 42 84 325080 83 Linux # (not used) / dev/hda3 * 85 126 3175 20 83 Linux # Main / dev/hda4 127 629 3802 680 5 Extended / dev/hda5 127 143 1284 88 + 82 Linux swap / dev/hda6 144 157 1058 08 + 83 Linux / dev/hda7 158 171 1058 08 + 83 Linux / dev/hda8 172 253 6198 88 + 83 Linux / dev/hda9 254 335 6198 88 + 83 Linux / dev/hda10 336 417 6198 88 + 83 Linux / dev/hda11 418 629 1602 688 + 83 Linux
There are a few unused partitions. These are for installing a second Linux distribution or as space for growing directory trees.
3.1.11.2 Mount filesystems
Correct installation of previous file systems is done through /etc/fstab
# / Etc / fstab: static file system information. # # System point type options dump pass # Files editing / dev/hda3 / ext2 defaults, errors = remount-ro 0 1 / dev/hda5 none swap sw 0 0 proc / proc proc defaults 0 0 / dev/fd0 / floppy auto defaults, user, noauto 0 0 / dev / cdrom / cdrom iso9660 defaults, ro, user, noauto 0 0 # # Keep partitions separate / dev/hda7 / home ext2 rw 0 2 / dev/hda8 / var ext2 rw 0 2 / dev/hda6 / var / lib / cvs ext2 defaults 0 2 / dev/hda9 / usr ext2 rw 0 2 / dev/hda10 / var / cache / apt / archives ext2 defaults 0 2 # Very big partition for proxy cache / dev/hda11 / var / spool / squid ext2 rw 0 2 # Backup bootable DOS / dev/hda1 / mnt / dos vfat rw, noauto 0 0 # Backup bootable Linux system (not done) / dev/hda2 / mnt / linux ext2 rw, noauto 0 0 # # Nfs mounts mickey: / / mnt / mickey nfs ro, noauto, intr 0 0 goofy: / / mnt / goofy nfs ro, noauto, intr 0 0 # Minnie: / / mnt / minnie smbfs ro, soft, intr, credentials = (filename) 0 2
For NFS, I use noauto, intr combined with the default hard option. Thus, it is possible to stop a process blocked by a connection using Ctrl-C.
For a Windows machine connected with Samba (smbfs), rw, auto, soft, intr may be a good idea. See Samba configuration, Section 3.5.
For a floppy drive, using noauto, rw, sync, user, exec instead prevents file corruption after disk eject before unmount accidentally. This slows down the writing process.
3.1.11.3 Autofs
Key points to auto mount:
- Load the vfat module to allow
/etc/auto.miscto contain-fstype = auto:# Modprobe vfat # prior to the floppy access attempt ... or to automate this configuration, # Echo "vfat">> / etc / modules ... and reboot the system.
- Type in the file
/etc/auto.miscas follows:floppy-fstype = auto, sync, nodev, nosuid, gid = 100, umask = 000: / dev/fd0 ... where gid = 100 is "users".
- Create links
cdromandfloppyin/home/ userto point to/var/autofs/misc/cdromand/var/autofs/misc/floppyrespectively. - Add user to group "users".
3.1.11.4 NFS mount
The external Linux NFS server (goofy) resides behind a firewall (gateway). I have a very relaxed security policy on my LAN since I am the only user. To enable NFS access, the server side needs to add the following to /etc/exports
# / Etc / exports: the access control list for systems # Files can be exported to NFS clients. See (5). / (Rw, no_root_squash)
This is needed to activate the NFS server in addition to installing and activating the NFS server and client packages.
For simplicity, I usually create a single partition of 2GB for an experimental Linux install. I optionally share swap and /tmp for these facilities. The multiple partition scheme is too complicated for these uses. If you need a simple console system, 500MB may be more than enough.
3.1.12 DRAM memory guidelines
The following is rough guidelines for DRAM.
4MB: Bare minimum to run the Linux kernel. 16 MB: Minimum for reasonable use of a console system. 32MB: Minimum for simple X system. 64MB: Minimum for X system with GNOME / KDE. 128MB: Comfortable for X system with GNOME / KDE. 256 MB (or more): Why can not afford it? The DRAM is cheap.
Using the boot option mem = 4m (or lilo append = "mem = 4m") will show how the system would perform with 4MB of memory installed. For a system with more than 64MB of memory with an old BIOS requires a lilo boot parameter.
3.1.13 Swap space
Use the following guidelines for swap:
- Each swap partition is <128MB (for an old 2.0 kernel), <2GB (with recent kernels)
- Total = either 1 or 2 times installed RAM or 128 MB to 2 GB
- Them on different drives and mount all with sw, pri = 1 in the
/etc/fstabThis ensures that the kernel does a striping RAID of the swap partitions and offers the maximum performance from them. - If possible use a central portion of the hard drive.
Even if you never need, it is desirable to have some swap space (128MB) the system slow down before it crashes hard with a program which leaks memory.
Popularity: 1%





























