Installing Debian on a small partition

From NewbieDOC


Chris Lale
chrislale AT berlios DOT de

Revision History

Revision 1.0 27th August 2005 Revised by Chris Lale
Initial Release.
Revision 1.1 24th January 2006 Revised by Chris Lale
Adapted for NewbieDOC by converting source to wikitext. Made a few minor corrections and minor additions.
Revision 1.2 16th September 2007 Revised by Chris Lale
Updated for Debian 4.0 Stable (Etch).

Latest version

You can find the latest version of this document at http://newbiedoc.berlios.de.

Abstract

This article explains how to install desktop Debian GNU/Linux 4.0 (Etch) from CD/DVD on a small hard disk or partition (around 1 GB). The instructions can also be used for installations to larger discs/partitions or installation from a preconfigured ADSL broadband ethernet modem/router, preferably with built-in DHCP. You still need the Binary-1 CD or DVD (or the 160 MB network install CD) containing the installer itself. If you do not have a CD drive, refer to the Debian GNU/Linux 4.0 -- Installation Guide. You can download ISO images of the CDs/DVDs from http://www.debian.org/CD/.


Contents


1 Documentation

Debian GNU/Linux 4.0 -- Installation Guide

Debian Reference

2 Requirements

32 MB RAM.

Hard disc space for a new partition (256 MB for the base system plus space for additional software). If you want to install the X-Window System, you'll need at least 490MB plus space for applications. For a complete desktop system, you will need a few gigabytes.

Preferably, you also need a small swap partition (rule of thumb: twice the size of your RAM).

Install HDD space needed
Basic system about 490 MB
Swap partition 50-150 MB
X Window System about 145 MB
and X window manager 1 MB upwards
or lightweight desktop (Xfce4) about 40 MB
or heavyweight desktop (KDE/Gnome) about 220 - 920 MB
Space for applications and user files

So the smallest text only installation would require at least 550MB plus space for applications and user files. The smallest X installation would be about 700MB plus space for applications and user files. An installation with a lightweight desktop would need around 740 MB plus space for applications and user files. A basic Gnome or KDE desktop needs 1GB or more and a full Gnome or KDE desktop needs 1600 MB plus space for applications and user files.

Installation will be much smoother if you know a little bit about the Linux filesystem, partition naming and other Debian basic features. If in doubt during installation, accepting the default usually works.

3 Outline

A simple install gives you a 2.4 kernel and the option to install the full desktop environment (around 1.5 Gb). There is no point in installing an old kernel in a fresh installation. Use the 'linux26' install for a 2.6 kernel. If you do not have enough room for a full desktop environment installation, you can install the base system and opt not to install the desktop environment. Then finish the installation, login as root and install the X-Window System and your own choice(s) of desktop environment (see summary below). You can run both Gnome applications and KDE applications without either the Gnome or KDE desktops installed. The package manager will automatically install any required libraries.

Although the installer is on CD or DVD, you have the option of installing the bulk of the software from CD/DVDs, PPP (dial-up modem) or network (eg ADSL/broadband ethernet router). Dial-up is unrealistic, 50M broadband takes 2-3 hours, CD/DVD less than an hour. You can setup networking during installation, but if you do, the installer will assume that you want to install from the network. This will result in delays if you are actually installing from CD/DVD as the installer checks for the (unused) network connection at various times. It is straightforward to set up the network after installation.

If you have an ethernet ADSL broadband connection, Debian will recognise any DHCP server in your modem/router and accept a connection lease from it. Otherwise you will need to know the gateway IP address provided by your modem/router (often 192.168.1.1). If you do not run a DHCP server on your network, you must give your computer a static IP address on the same network. For example, if your private network is 192.168.1.0 and the gateway is 192.168.1.1, you could assign your computers 192.168.1.2, 192.168.1.3, etc with netmasks 255.255.255.0.

3.1 Recommended approach

Disconnect any network cables and boot from the Binary-1 DVD (unless you wish to install from the network). Install the base system from DVD with the 2.6 kernel ('linux26' at the boot prompt). If you are short of space, do not install the Desktop Environment during installation. After installation you can choose leaner options separately - install X, desktop(s), X screensaver, graphical login (Gdm) and graphical software package installer (Synaptic).

3.2 Summary

install the base system with the 2.6 kernel (299 MB)

install and test the X-Window System (143MB)

install

  • full Gnome heavyweight desktop (919 MB)
  • or install minimal Gnome heavyweight desktop (391 MB)
  • or install full KDE heavyweight desktop (903 MB)
  • or install minimal KDE heavyweight desktop (213 MB)
  • or install Icewm lightweight desktop (7 MB)
  • or install a combination of desktops

install xscreensaver, gdm, synaptic

install applications

4 Installing the base system

Boot from DVD Binary-1. At the prompt enter install.

boot: install

The blue screen text interface is known as ncurses. Navigate with arrow keys, tab key, space bar and enter key.

4.1 Choose regional settings for the installer

Select regional settings to suit your computer. The examples below are typical for the UK.

Choose language
English- English
Choose country or region
United Kingdom
Select a keyboard layout
British English

4.2 Automatically detect CD/DVD and network

Detecting hardware to find CD-ROM drives
Scanning CD-ROM
Loading additional components

If a network card is detected and connected to a network with a DHCP server (eg an ADSL broadband ethernet modem/router):

Detecting network hardware
Configuring the network with DHCP

or if a network card is detected but not connected to a network:

Network autoconfiguration failed

If you know that you are connected to a network, you can configure the network manually:

Configure network manually

You must supply the following information about the new installation:

  • IP address
  • Netmask
  • Gateway
  • Name server addresses
  • Hostname
  • Domain name

If you are installing from CD/DVD and not from a network, you can leave any network configuration until after installation is complete.

Do not configure the network at this time

4.3 Set the hostname

The hostname is the nme of the computer as it appears to a network. It also appears on the commandline prompt so keep it short eg 'mybox'..

Hostname: mybox

If DHCP autoconfiguration succeded, you also need to enter the domain name (name of the local network) eg 'home'. Otherwise, go on to the next section to partition the hard disk.

Domain name: home

4.4 Partition the hard disc

Detecting disks
Starting up the partitioner

You should have a disc with enough space on it - either an empty, unpartitioned disc or a disc with some free space. The simplest option is to use all of the free space on the hard disc, although this will erase any existing systems (eg Windows). If you want to install Debian in addition to an existing system and have dual booting, read the Debian Installation Guide. Assuming that you wish to use the whole disc for Debian, follow these instructions.

Partition disks
Guided - use entire disk

Select the disc to partition and install to:

Select disk to partition
IDE1 master (hda) - 2.0 GB SOME_MANUFACTURER HARDDISK

4.4.1 All files in one partition

The easiest method is to select the simplest partitioning scheme which installs all the files into one partition. Alternatively, use guided partitioning (see next section).

All files in one partition - (recommended for new users)

Skip the next section and go straight to "Finish partitioning".

4.4.2 Guided partitioning

The hard drive will be identified by "hda", "sda" or something similar.

IDE1 master (hda) - 2.0 GB SOME_MANUFACTURER HARDDISK

If you are doing a simple installation and overwriting the whole disc, you will see one primary partition. It will be partition number 1 formatted with the "ext3" filesystem and a mountpoint of "/" ("root of filesystem")

>   #1 primary   1.9 GB B f ext3    /

There will be another small "logical" partition for the swap space. Partition number 5 is the first available logical partition. It will be formatted for use as swap.

>   #5 logical  148 MB   f swap    swap

Select the option to finish partitioning, and continue.

Finish partitioning and write changes to disk

The installer will warn you that you are about to erase your hard drive.

WARNING: This will destroy all data on any partitions ... that are going to be formatted.
[...]
Write the changes to disks?

Select "Yes", and continue.

Yes

4.4.3 Finish partitioning

Finish partitioning and write changes to disk
Write the changes to disks?
Yes

The installer creates the new partitions, formats them and sets the clock. The coloured bars show progress.

Partitions formatting
Setting up the clock

4.5 Setting up users and passwords

Your new Debian system must have an all-powerful superuser called "root". You must enter a password for user root.

Root password: ******
Re-enter password to verify: ******

Continue to the next screen. You should normally login to your new system only as a normal user. You must set up a normal user and password now. You can add more users when the installation is complete.

Full name for the new user: Firstname Surname

Continue to the next screen to set the username for the account. This name will be used to login, regulate access to certain files and to define a user area for storing personal work and configuration files called a "home directory".

Username for your account: nickname

Continue to the next screen to set a password for your new normal user.

Choose a password for the new user: ******
Re-enter password to verify: ******

4.6 Installing the base system and the boot loader

This should procede automatically. You can follow progress on the screen.

Installing the base system

The installer configures the package manager. Debian's Advanced Package Tool (APT) is a system that makes finding and installing software very easy. The installer configures APT with the settings you need. The coloured bar shows progress.

Configuring apt

The installer may ask you whether you wish to use a network mirror server for supplementary software. It is wise to answer "yes" if you are connected to a network. You can answer "No" if you are installing software only from CD/DVD.

Use a network mirror?
Yes or No (see text)

The installer tries to access security updates from a repository on the Debian website. This will fail if you are not yet connected to the internet. If you get a failure message, just continue to the next screen. You can enable security updates after installation (eg by editing the file /etc/apt/sources.list and uncommenting the line for security updates).

Cannot access security updates

The installer fetches and installs some of the files needed for the core of a Debian system. The coloured bar shows progress.

Select and install software

4.6.1 You configure the popularity contest

The popularity contest is software that sends statistics to Debian software developers about the software you use most frequently. Popularity contest needs a network connection. If you do not want to participate at the moment, choose "No" and continue. If you change your mind later, you can reconfigure "popularity-contest" with the "dpkg-reconfigure" program.

No

4.6.2 The installer selects and installs more software

The installer fetches and installs more of the files needed for the core of a Debian system. The coloured bar shows progress.

Select and install software

4.6.3 You choose some software collections to install

You will need just the core of the Debian system to start with.

Standard system

Then continue. You can watch progress with the coloured bar as the installer selects and installs the software.

Select and install software

4.6.4 Install the Grub bootloader

The bootloader is a little program used by the computer's BIOS to boot your new Debian system.

Installing GRUB boot loader

You normally install the bootloader to the MBR (Master Boot Record). The MBR is a small sector at the beginning of your first hard disc.

Install the GRUB boot loader to the master boot record? 
Yes

The coloured bar shows progress.

4.6.5 Finish the installation

Installation complete

When the installation is finished, the CDROM is ejected. You can remove the CD and continue.

Continue

Your computer will now boot into the wonderful world of Debian. This is just a basic installation without the X Window System or graphical desktops. It takes up about 476 MiB (488 MB) plus the swap partition (145 MiB, 148 MB in the example). Of course, you will need more space for applications, work/data files etc.

5 Installing X and desktop(s) after base system configuration

Login as a normal user (eg fred).

login: fred
Password: *****
$

Use Aptitude to install the packages you need from the command line. You need root's privileges for this. You can do this by switching user temporarily using Su and supplying the password you chose for user root. A normal user's prompt is $ and root's prompt is #. When you have finished, switch back by entering 'exit' or pressing Ctrl-D.

$ su
Password: *****
#

5.1 Install X using Aptitude

If you will be installing from a network (eg the internet) and not using any CDROMs or DVDs, make sure that you comment out any "deb cdrom" lines in /etc/apt/sources.list.

# nano /etc/apt/sources.list
# deb cdrom:[Debian GNU/Linux 4.0 ...]/ etch main non-free contrib

If you comment out the CDROM lines, make sure that there is a line for a Debian mirror eg http://ftp.uk.debian.org.

deb http://ftp.uk.debian.org/debian/ etch main non-free contrib
# aptitude install xorg
...119 newly installed... After unpacking 143 MB will be used.
Do you want to continue? [Y/n/?] y

5.2 Configure the X server to suit your hardware

#dpkg-reconfigure xserver-xorg
Configuring xserver-xorg
Attempt to autodetect video hardware?
Yes

Please select the XKB rule set to use
xorg

Please select your keyboard model.
pc105

Please select your keyboard layout.
gb

Please select your keyboard variant.
(leave blank)

Please select your keyboard options.
(leave blank)

Please choose your mouse port.
(eg /dev/input/mice)

If your monitor is an LCD device (eg a notebook), answer 'yes' to the next question. If it is a CRT (Cathode Ray Tube) device, answer 'no'.

Is your monitor an LCD device?

Set up your monitor. If you do not know anything about your CRT monitor except its size, choose Simple. Otherwise, Medium should be fine.

Choose a method for selecting your monitor characteristics.
Medium

Set the best video mode for your monitor/video card combination. A fairly recent monitor should be capable of 1024x768 @ 75Hz. Select the video modes using the space bar.

Please select your monitor's best video mode.
(eg 1024x768 @ 75Hz)

Please select the video modes you would like the X server to use.
[*] 1024x768
[*] 800x600
[*] 640x480

Please select your default color depth in bits.
eg 24


5.3 Testing X and the TWM window manager

# aptitude install twm
...2 newly installed... After unpacking 2060 kB will be used.
Do you want to continue? [Y/n/?] y

Enter the command startx to start X.

$ startx

You should see a coarse grey screen with an X cursor. Check that the cursor responds to the mouse. Move the cursor over the terminal window to activate it (outline cursor becomes solid).

Run twm from the command prompt.

$twm

Twm provides only basic window functions). Hold down the left mouse button for the menu. Move down the menu and to the right for sub-menus. To exit, highlight 'Exit', move to the right highlight 'Yes, really quit' and release the mouse button.

Exit -> Yes, really quit

5.4 Testing X and the metacity window manager

# aptitude install metacity
...29 newly installed... After unpacking 47.3 MB will be used.
Do you want to continue? [Y/n/?] y

5.5 Testing X and the enlightenment window manager

# aptitude install enlightenment
...13 newly installed... After unpacking 8989 kB will be used.
Do you want to continue? [Y/n/?] y

5.6 Testing X and the blackbox window manager

# aptitude install blackbox
...2 newly installed... After unpacking 1040 kB will be used.
Do you want to continue? [Y/n/?] y

5.7 Testing X and the fluxbox window manager

# aptitude install fluxbox
...2 newly installed... After unpacking 2425 kB will be used.
Do you want to continue? [Y/n/?] y

5.8 Testing X and the icewm window manager

# aptitude install icewm
...12 newly installed... After unpacking 1256/2059 kB will be used.
Do you want to continue? [Y/n/?] y

5.9 Testing X and the xfce4 lightweight desktop environment

# aptitude install xfce4
...91 newly installed... After unpacking 29.6 MB/38.3 MB kB will be used.
Do you want to continue? [Y/n/?] y

5.10 Installing heavyweight desktops

These are the commands for installing various desktops. Remember to switch user to root first and switch back again when you have finished.

Full Gnome

# aptitude install gnome
...428 newly installed... 919MB will be used

Basic Gnome (accept defaults for configuration).

# aptitude install gnome-core
...221 newly installed... 391MB will be used

Fix error running due to no xscreensaver package (optional). Accept defaults for configuration.

# aptitude install xscreensaver
...8 newly installed... 12.9 MB will be used

Full KDE

# aptitude install kde
...493 newly installed... 903 MB will be used

Basic KDE

# aptitude install kde-core
118 newly installed, 213 MB will be used

5.11 Installing lightweight desktop Icewm

# aptitude install icewm
...8 newly installed... 6275kB will be used

5.12 Installing graphical login Gdm

The default graphical login is provided by X Display Manager (Xdm), but Gnome Display Manager (Gdm) has more features. The chosen display manager is loaded automatically after next reboot.

To install gdm

# aptitude install gdm
...34 newly installed... 16.7MB will be used

Later, you can configure gdm from its own login screen or using the gdmsetup command. This may be available from the desktop menu. For example, in Icewm:

Programs -> Apps -> System -> GDM Setup

5.13 Installing the graphical software installer Synaptic

Synaptic is a graphical package manager for APT (Debian's Advanced Package Tool). If you are running X, you will want to use this instead of Aptitude.

# aptitude install synaptic
...? newly installed... ???MB will be used

Synaptic may be available from the desktop menu. For example, in Icewm:

Programs -> Apps -> System -> Synaptic Package Manager

5.14 Configuring the network for broadband

Make sure that your modem/router is already configured, switched on, connected to the telephone system and connected to your PC.

If you are in X, open a terminal window.

Switch user to root and edit the file /etc/network/interfaces using Nano.

$ su
Password:
# nano /etc/network/interfaces

If you have DHCP running on the network, add these lines:

auto eth0
iface eth0 inet dhcp

If you wish instead to allocate a static IP address to your computer, add something like this (modify as needed):

auto eth0
iface eth0 inet static
 address 192.168.1.2
 netmask 255.255.255.0
 network 192.168.1.0
 broadcast 192.168.1.255
 gateway 192.168.1.1

Then save the file and exit

Ctrl-O
Ctrl-X

See man interfaces for the manual page.

Bring the interface up with Ifup and test it using Ping.

# ifup eth0
# ping google.co.uk
PING google.co.uk (216.239.39.104) 56(84) bytes of data.
64 bytes from 216.239.39.104: icmp_seq=1 ttl=243 time=107 ms
64 bytes from 216.239.39.104: icmp_seq=2 ttl=243 time=107 ms
64 bytes from 216.239.39.104: icmp_seq=3 ttl=243 time=107 ms
64 bytes from 216.239.39.104: icmp_seq=4 ttl=243 time=107 ms

Ctrl-Z

Switch back to the normal user.

# Ctrl-D
$

The 'auto' line in the /etc/network/interfaces file ensures that the interface is brought up automatically at boot time.

6 Appendix A: Licence

Copyright (c) 2005 Chris Lale. chrislale AT berlios DOT de.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts. A copy of the license can be found at http://www.fsf.org/copyleft/fdl.html.

Content is available under GNU Free Documentation License 1.2, unless otherwise stated.