Linux Abcde
Linux Abcde
packages are included, whereas you have to download these from the web if you
are using the business card image. If you'd rather, you can get a full size CD
image which will not need the network to install. You only need the first CD of
the set.
Download whichever type you prefer and burn it to a CD. To boot the CD, you may
need to change your BIOS configuration, as explained in Section 3.6.1,
"Invoking the BIOS Set-Up Menu".
A.2.2. Floppy
If you can't boot from CD, you can download floppy images to install Debian.
You need the floppy/boot.img, the floppy/root.img and possibly one of the
driver disks.
The boot floppy is the one with boot.img on it. This floppy, when booted, will
prompt you to insert a second floppy -- use the one with root.img on it.
If you're planning to install over the network, you will usually need the
floppy/net-drivers.img, which contains additional drivers for many ethernet
cards, and support for PCMCIA.
If you have a CD, but cannot boot from it, then boot from floppies and use
floppy/cd-drivers.img on a driver disk to complete the install using the CD.
Floppy disks are one of the least reliable media around, so be prepared for
lots of bad disks (see Section 5.3.1, "Floppy Disk Reliability"). Each .img
file you downloaded goes on a single floppy; you can use the dd command to
write it to /dev/fd0 or some other means (see Section 4.3, "Creating Floppies
from Disk Images" for details). Since you'll have more than one floppy, it's a
good idea to label them.
It's also possible to install from removable USB storage devices. For example a
USB keychain can make a handy Debian install medium that you can take with you
anywhere.
The easiest way to prepare your USB memory stick is to download hd-media/
boot.img.gz, and use gunzip to extract the 128 MB image from that file. Write
this image directly to your memory stick, which must be at least 128 mb in
size. Of course this will destroy anything already on the memory stick. Then
mount the memory stick, which will now have a FAT filesystem on it. Next,
download a Debian netinst CD image, and copy that file to the memory stick; any
filename is ok as long as it ends in .iso.
There are other, more flexible ways to set up a memory stick to use the
debian-installer, and it's possible to get it to work with smaller memory
sticks. For details, see Section 4.4, "Preparing Files for USB Memory Stick
Booting".
Some BIOSes can boot USB storage directly, and some cannot. You may need to
configure your BIOS to boot from a "removable drive" or even a "USB-ZIP" to get
it to boot from the USB device. If it doesn't, you can boot from one floppy and
use the USB stick for the rest of the install. For helpful hints and details,
see Section 5.1.3, "Booting from USB Memory Stick".
The easiest thing to set up is probably PXE netbooting. Untar the file netboot/
pxeboot.tar.gz into /var/lib/tftpboot or wherever is appropriate for your tftp
server. Set up your DHCP server to pass filename /pxelinux.0 to clients, and
with luck everything will just work. For detailed instructions, see
Section 4.6, "Preparing Files for TFTP Net Booting".
It's possible to boot the installer using no removable media, but just an
existing hard disk, which can have a different OS on it. Download hd-media/
initrd.gz, hd-media/vmlinuz, and a Debian CD image to the top-level directory
of the hard disk. Make sure that the CD image has a filename ending in .iso.
Now it's just a matter of booting linux with the initrd. Section 5.1.2,
"Booting from Linux Using LILO or GRUB" explains one way to do it.
A.3. Installation
Once the installer starts, you will be greeted with an initial screen. Press
Enter to boot, or read the instructions for other boot methods and parameters
(see Section 5.2, "Boot Parameters"). If you want a 2.6 kernel, type linux26 at
the boot: prompt. ^[10]
After a while you will be asked to select your language. Use the arrow keys to
pick a language and press Enter to continue. Next you'll be asked to select
your country, with the choices including countries where your language is
spoken. If it's not on the short list, a list of all the countries in the world
is available.
You may be asked to confirm your keyboard layout. Choose the default unless you
know better.
Now sit back while debian-installer detects some of your hardware, and loads
the rest of itself from CD, floppy, USB, etc.
Next the installer will try to detect your network hardware and set up
networking by DHCP. If you are not on a network or do not have DHCP, you will
be given the opportunity to configure the network manually.
Now it is time to partition your disks. First you will be given the opportunity
to automatically partition either an entire drive, or free space on a drive.
This is recommended for new users or anyone in a hurry, but if you do not want
to autopartition, choose manual from the menu.
If you have an existing DOS or Windows partition that you want to preserve, be
very careful with automatic partitioning. If you choose manual partitioning,
you can use the installer to resize existing FAT or NTFS partitions to create
room for the Debian install: simply select the partition and specify its new
size.
On the next screen you will see your partition table, how the partitions will
be formatted, and where they will be mounted. Select a partition to modify or
delete it. If you did automatic partitioning, you should just be able to choose
Finished partitioning from the menu to use what it set up. Remember to assign
at least one partition for swap space and to mount a partition on /.
Appendix B, Partitioning for Debian has more information about partitioning.
Now debian-installer formats your partitions and starts to install the base
system, which can take a while. That is followed by installing a kernel.
The last step is to install a boot loader. If the installer detects other
operating systems on your computer, it will add them to the boot menu and let
you know. By default GRUB will be installed to the master boot record of the
first harddrive, which is generally a good choice. You'll be given the
opportunity to override that choice and install it elsewhere.
debian-installer will now tell you that the installation has finished. Remove
the cdrom or other boot media and hit Enter to reboot your machine. It should
boot up into the next stage of the install process, which is explained in
Chapter 7, Booting Into Your New Debian System.
If you need more information on the install process, see Chapter 6, Using the
Debian Installer.
If you did not reach base-config or ran into other trouble, you probably found
a bug in debian-installer. To improve the installer it is necessary that we
know about them, so please take the time to report them. You can use an
installation report to report problems; if the install completely fails, see
Section 5.3.5, "Bug Reporter".
We hope that your Debian installation is pleasant and that you find Debian
useful. You might want to read Chapter 8, Next Steps and Where to Go From Here.
--------------
^[10] The 2.6 kernel is available for most boot methods, but not when booting
from a floppy.
Table of Contents
Most people choose to give GNU/Linux more than the minimum number of
partitions, however. There are two reasons you might want to break up the file
system into a number of smaller partitions. The first is for safety. If
something happens to corrupt the file system, generally only one partition is
affected. Thus, you only have to replace (from the backups you've been
carefully keeping) a portion of your system. At a bare minimum, you should
consider creating what is commonly called a "root partition". This contains the
most essential components of the system. If any other partitions get corrupted,
you can still boot into GNU/Linux to fix the system. This can save you the
trouble of having to reinstall the system from scratch.
The only real drawback to using more partitions is that it is often difficult
to know in advance what your needs will be. If you make a partition too small
then you will either have to reinstall the system or you will be constantly
moving things around to make room in the undersized partition. On the other
hand, if you make the partition too big, you will be wasting space that could
be used elsewhere. Disk space is cheap nowadays, but why throw your money away?
Debian GNU/Linux adheres to the Filesystem Hierarchy Standard for directory and
file naming. This standard allows users and software programs to predict the
location of files and directories. The root level directory is represented
simply by the slash /. At the root level, all Debian systems include these
directories:
+------------------------------------------------------------------------+
|Directory| Content |
|---------+--------------------------------------------------------------|
|bin |Essential command binaries |
|---------+--------------------------------------------------------------|
|boot |Static files of the boot loader |
|---------+--------------------------------------------------------------|
|dev |Device files |
|---------+--------------------------------------------------------------|
|etc |Host-specific system configuration |
|---------+--------------------------------------------------------------|
|home |User home directories |
|---------+--------------------------------------------------------------|
|lib |Essential shared libraries and kernel modules |
|---------+--------------------------------------------------------------|
|media |Contains mount points for replaceable media |
|---------+--------------------------------------------------------------|
|mnt |Mount point for mounting a file system temporarily |
|---------+--------------------------------------------------------------|
|proc |Virtual directory for system information (2.4 and 2.6 kernels)|
|---------+--------------------------------------------------------------|
|root |Home directory for the root user |
|---------+--------------------------------------------------------------|
|sbin |Essential system binaries |
|---------+--------------------------------------------------------------|
|sys |Virtual directory for system information (2.6 kernels) |
|---------+--------------------------------------------------------------|
|tmp |Temporary files |
|---------+--------------------------------------------------------------|
|usr |Secondary hierarchy |
|---------+--------------------------------------------------------------|
|var |Variable data |
|---------+--------------------------------------------------------------|
|opt |Add-on application software packages |
+------------------------------------------------------------------------+
* The root partition / must always physically contain /etc, /bin, /sbin, /lib
and /dev, otherwise you won't be able to boot. Typically 150-250 MB is
needed for the root partition.
* /var: variable data like news articles, e-mails, web sites, databases, the
packaging system cache, etc. will be placed under this directory. The size
of this directory depends greatly on the usage of your system, but for most
people will be dictated by the package management tool's overhead. If you
are going to do a full installation of just about everything Debian has to
offer, all in one session, setting aside 2 or 3 gigabyte of space for /var
should be sufficient. If you are going to install in pieces (that is to
say, install services and utilities, followed by text stuff, then X, ...),
you can get away with 300-500 MB. If hard drive space is at a premium and
you don't plan on doing major system updates, you can get by with as little
as 30 or 40 MB.
* /home: every user will put his personal data into a subdirectory of this
directory. Its size depends on how many users will be using the system and
what files are to be stored in their directories. Depending on your planned
usage you should reserve about 100 MB for each user, but adapt this value
to your needs. Reserve a lot more space if you plan to save a lot of
multimedia files (MP3, movies) in your home directory.
B.3. Recommended Partitioning Scheme
For new users, personal Debian boxes, home systems, and other single-user
setups, a single / partition (plus swap) is probably the easiest, simplest way
to go. However, if your partition is larger than around 6GB, choose ext3 as
your partition type. Ext2 partitions need periodic file system integrity
checking, and this can cause delays during booting when the partition is large.
For multi-user systems or systems with lots of disk space, it's best to put /
usr, /var, /tmp, and /home each on their own partitions separate from the /
partition.
You might need a separate /usr/local partition if you plan to install many
programs that are not part of the Debian distribution. If your machine will be
a mail server, you might need to make /var/mail a separate partition. Often,
putting /tmp on its own partition, for instance 20 to 50MB, is a good idea. If
you are setting up a server with lots of user accounts, it's generally good to
have a separate, large /home partition. In general, the partitioning situation
varies from computer to computer depending on its uses.
For very complex systems, you should see the Multi Disk HOWTO. This contains
in-depth information, mostly of interest to ISPs and people setting up servers.
With respect to the issue of swap partition size, there are many views. One
rule of thumb which works well is to use as much swap as you have system
memory. It also shouldn't be smaller than 16MB, in most cases. Of course, there
are exceptions to these rules. If you are trying to solve 10000 simultaneous
equations on a machine with 256MB of memory, you may need a gigabyte (or more)
of swap.
On 32-bit architectures (i386, m68k, 32-bit SPARC, and PowerPC), the maximum
size of a swap partition is 2GB. That should be enough for nearly any
installation. However, if your swap requirements are this high, you should
probably try to spread the swap across different disks (also called "spindles")
and, if possible, different SCSI or IDE channels. The kernel will balance swap
usage between multiple swap partitions, giving better performance.
As an example, an older home machine might have 32MB of RAM and a 1.7GB IDE
drive on /dev/hda. There might be a 500MB partition for another operating
system on /dev/hda1, a 32MB swap partition on /dev/hda3 and about 1.2GB on /dev
/hda2 as the Linux partition.
For an idea of the space taken by tasks you might be interested in adding after
your system installation is complete, check Section C.3, "Disk Space Needed for
Tasks".
Linux disks and partition names may be different from other operating systems.
You need to know the names that Linux uses when you create and mount
partitions. Here's the basic naming scheme:
* The master and slave disks of the secondary controller can be called /dev/
hdc and /dev/hdd, respectively. Newer IDE controllers can actually have two
channels, effectively acting like two controllers.
Here is a real-life example. Let's assume you have a system with 2 SCSI disks,
one at SCSI address 2 and the other at SCSI address 4. The first disk (at
address 2) is then named sda, and the second sdb. If the sda drive has 3
partitions on it, these will be named sda1, sda2, and sda3. The same applies to
the sdb disk and its partitions.
Note that if you have two SCSI host bus adapters (i.e., controllers), the order
of the drives can get confusing. The best solution in this case is to watch the
boot messages, assuming you know the drive models and/or capacities.
Linux represents the primary partitions as the drive name, plus the numbers 1
through 4. For example, the first primary partition on the first IDE drive is /
dev/hda1. The logical partitions are numbered starting at 5, so the first
logical partition on that same drive is /dev/hda5. Remember that the extended
partition, that is, the primary partition holding the logical partitions, is
not usable by itself. This applies to SCSI disks as well as IDE disks.
partman
Recommended partitioning tool in Debian. This swiss army knife can also
resize partitions, create filesystems ("format" in Windows speak) and
assign them to the mountpoints.
fdisk
cfdisk
A simple-to-use, full-screen disk partitioner for the rest of us.
Note that cfdisk doesn't understand FreeBSD partitions at all, and, again,
device names may differ as a result.
One of these programs will be run by default when you select Partition a Hard
Disk. If the one which is run by default isn't the one you want, quit the
partitioner, go to the shell (tty2) by pressing Alt and F2 keys together, and
manually type in the name of the program you want to use (and arguments, if
any). Then skip the Partition a Hard Disk step in debian-installer and continue
to the next step.
If you will be working with more than 20 partitions on your ide disk, you will
need to create devices for partitions 21 and beyond. The next step of
initializing the partition will fail unless a proper device is present. As an
example, here are commands you can use in tty2 or under Execute A Shell to add
a device so the 21st partition can be initialized:
# cd /dev
# mknod hda21 b 3 21
# chgrp disk hda21
# chmod 660 hda21
Booting into the new system will fail unless proper devices are present on the
target system. After installing the kernel and modules, execute:
# cd /target/dev
# mknod hda21 b 3 21
# chgrp disk hda21
# chmod 660 hda21
If you have an existing other operating system such as DOS or Windows and you
want to preseve that operating system while installing Debian, you may need to
resize its partition to free up space for the Debian installation. The
installer supports resizing of both FAT and NTFS filesystems; when you get to
the installer's partitioning step, select the option to partition manually and
then simply select an existing partition and change its size.
The PC BIOS generally adds additional constraints for disk partitioning. There
is a limit to how many "primary" and "logical" partitions a drive can contain.
Additionally, with pre 1994-98 BIOSes, there are limits to where on the drive
the BIOS can boot from. More information can be found in the Linux Partition
HOWTO and the Phoenix BIOS FAQ, but this section will include a brief overview
to help you plan most situations.
Linux limits the partitions per drive to 15 partitions for SCSI disks (3 usable
primary partitions, 12 logical partitions), and 63 partitions on an IDE drive
(3 usable primary partitions, 60 logical partitions). However the normal Debian
GNU/Linux system provides only 20 devices for partitions, so you may not
install on partitions higher than 20 unless you first manually create devices
for those partitions.
If you have a large IDE disk, and are using neither LBA addressing, nor overlay
drivers (sometimes provided by hard disk manufacturers), then the boot
partition (the partition containing your kernel image) must be placed within
the first 1024 cylinders of your hard drive (usually around 524 megabytes,
without BIOS translation).
This restriction doesn't apply if you have a BIOS newer than around 1995-98
(depending on the manufacturer) that supports the "Enhanced Disk Drive Support
Specification". Both Lilo, the Linux loader, and Debian's alternative mbr must
use the BIOS to read the kernel from the disk into RAM. If the BIOS int 0x13
large disk access extensions are found to be present, they will be utilized.
Otherwise, the legacy disk access interface is used as a fall-back, and it
cannot be used to address any location on the disk higher than the 1023rd
cylinder. Once Linux is booted, no matter what BIOS your computer has, these
restrictions no longer apply, since Linux does not use the BIOS for disk
access.
If you have a large disk, you might have to use cylinder translation
techniques, which you can set from your BIOS setup program, such as LBA
(Logical Block Addressing) or CHS translation mode ("Large"). More information
about issues with large disks can be found in the Large Disk HOWTO. If you are
using a cylinder translation scheme, and the BIOS does not support the large
disk access extensions, then your boot partition has to fit within the
translated representation of the 1024th cylinder.
Table of Contents
C.5.1. Requirements
C.5.2. Setting up source
C.5.3. Installing target
Note
In order to be able to properly present this example in the manual, we've had
to split some lines. This is indicated by the use of the
line-continuation-character "\" and extra indentation in the next line. In a
real preconfiguration file, these split lines have to be joined into one single
line. If you do not, preconfiguration will fail with unpredictable results.
#### Startup.