Slackware Linux Installation
This document shows briefly how to install Slackware Linux version 3.1 on a
PC, starting from a CD-ROM. The minimum system you will need is a 386SX PC
with 4MB RAM.
A 6-CD set containing several Linux distributions (Slackware, RedHat,
GNU), plus images of the main Linux FTP sites, is available from
Infomagic for around $25 + shipping.
Create boot and root disks
Since you have to start Linux from floppy disk before the installation can
proceed, you need to create startup floppy disks. You can do this under
DOS; here we assume your Slackware CD-ROM is accessible as drive D:
d:
cd \bootdsks.144
rawrite bare.i a:
cd \rootdsks
rawrite color.gz a:
Note that there are a lot of boot disks to choose from in the
\bootdsks.144 directory; type edit which.one to view a
file which describes them. bare.i is suitable for installation
from an ATAPI/IDE CD-ROM to an IDE hard drive. If you have a non-IDE CD-ROM
or wish to install to a SCSI hard drive, you will need to choose a different
boot disk which has the relevant drivers built in.
Make space for a Linux partition
If you want to install Linux alongside your current operating system, you
will need to run FIPS to make space for new
partitions. This is not necessary if the machine will be dedicated to Linux
and you don't mind erasing whatever is currently on the hard disk.
Boot up from the Linux disks
Insert the BOOT disk and reboot your computer. At the boot: prompt
hit enter. The kernel will then load from the disk and try to find the hardware
in your system.
You will then be asked to insert the ROOT disk. Do this and hit Enter. The
root disk will be copied into RAM. You should get a slackware login: prompt.
Set up partitions
Login as 'root'. At the command prompt, type
fdisk /dev/hda
(for an IDE drive; if you have SCSI it may be /dev/sda for the first SCSI
drive found, /dev/sdb for the second one etc). See the
sample session for details of how to
use fdisk.
Set up swap
If you have 8MB or more of RAM you can skip this step because the
setup program can do this for you. But if you have less than 8MB, you must
set up swap space by hand because otherwise the setup program won't have
enough memory in which to run.
The commands to use are as follows, assuming /dev/hda3 is your swap
partition:
mkswap /dev/hda3
swapon /dev/hda3
Type free to check that the swap space is active. Remember that
when you install from setup, you can let the program select your swap space
but when it asks you whether to use mkswap or swapon on that partition, you
must say NO (because the swap space is already active and being used)
Install using 'setup'
Type setup and you will be taken into the setup system. Start by
selecting the KEYMAP option (especially important if you don't have a US
keyboard)
Keymap
Choose a keyboard from the list, and then you will be given
an option to test it. If you think it's the right one, enter "1" on a line
of its own. You will then carry on to the next step.
Swap space
You will be asked if you wish to install the swap partition. Say yes.
However if you have already enabled swapping (with mkswap and swapon), when
asked whether the program should use mkswap or swapon, you must say NO.
Otherwise, the program will erase the swap partition, which is already
being used, and will very likely crash your machine.
Target partition
You will be asked which partition you wish to use as your root Linux
filesystem, and if you have only created one Linux partition (apart from the
swap partition) you will only have one to choose.
You will be asked how you wish to format it (safest is to select 'slow with
bad block check') and how many inodes to create (use the default which is
1 inode per 4096 bytes).
If you have a DOS or
Windows partition, you can choose to make it available from within Linux;
to do so, you must give the name of a subdirectory which it will be mounted
under, for example /windows. Then when you are in Linux you can
copy files to or from your Windows partition as if they were Linux files,
e.g.
more /windows/autoexec.bat
to view your AUTOEXEC.BAT file.
Source media
Next you will be prompted to select which source media you will use.
Select CD-ROM. You will be asked to select the type (probably ATAPI/IDE)
and then how it is connected. If it is on the same cable as your hard
drive it is probably /dev/hdb; if it is on its own cable from a second
IDE interface in your computer, it is probably /dev/hdc.
Installation
At this point you can choose which groups of packages (known as "disk sets"
because originally people installed from bunches of floppy disks)
to install. You have to install the A (base) set. Any other sets can be
installed later if you like. However I recommend that you also install
at least:
AP - extra applications
D - development tools (for compiling kernels etc)
F - Frequently Asked Questions and HOWTO documents
N - Networking software
At this point you can choose which method the system will use for prompting
you for the individual packages to install. I prefer the "MENU" option
because it offers the fastest install, as long as you know which packages
you want. The "NORMAL" option will give you a more verbose description of
each package as it goes along, making it easier to decide whether you want
to install that package or not.
With the "MENU" option, certain recommended packages will already be
selected. You can deselect them, or select other packages, by moving the
cursor and hitting the space bar. You might wish to try the following:
- A - remove scsi, add getty
- AP - add bc
- D - add m4, perl and ncurses
- F - keep the default, which is to install both parts
- N - add apache, dip, ppp, lynx,
uucp, elm, pine, smailcfg
In Slackware 3.1 before Jan 13th 1997, the kernel source (set K) is for
version 2.0.0 which is very old, so you should leave this out. If you
wish to build your own kernel, you can get
the latest source and install that instead (2.0.29 at the time of writing)
After all of the disk sets have been installed, you will be prompted to
choose a kernel. You should normally choose the kernel on the bootdisk you
installed from (since it at least has the driver for your CD-ROM), in which
case, you will be asked to reinsert the Boot disk. You can always build a
new kernel later.
Configure your System
At this stage Linux will have been copied to your hard drive but there
is some important configuration still to be done.
- Make a boot disk? If you have a spare, formatted floppy to hand,
you can create a boot disk which can be used to start your machine in case
there is any problem with the installation of LILO (the Linux Loader) later.
- Configure your modem? All this does is create a link from
/dev/modem to your device. This is actually NOT a good idea because it
interferes with the locking system used to prevent simultaneous use of
the modem by more than one process, so say NO.
- Configure your mouse? If you have a mouse, you can do this.
You will have to select the type of mouse you have and where it is
connected.
- Configure your CD-ROM? Select this, and choose the type of
CD-ROM you have. This will create a link from /dev/cdrom to the actual
device which represents your CD-ROM.
- Choose custom screen fonts? Gives you a choice of different
typeface appearances. Especially nice for laptops where the screen is
not always very clear. If you're happy with the default Linux font you
can skip this.
- Install LILO. This is an important section as LILO enables
your computer to boot directly into Linux, or for you to get a choice at
bootup time of which operating system to use. You can decide not
to install LILO. In this case, you will need either a boot floppy (which
you made earlier), or you can boot into DOS and then run LOADLIN.EXE
(in which case you will also need a copy of your kernel in your DOS
partition)
Start by selecting "Begin LILO install". You will be asked if you need to
pass any parameters to the kernel at boot time; you will almost certainly
not need anything, so leave this blank. You can choose how LILO chooses
an operating system: it can boot immediately into the default O/S; wait
5 or 30 seconds before booting the default (during which time you can hit
ALT to choose another O/S); or wait for ever at the boot: prompt for you
to select an O/S.
Next, you will select "Add a Linux partition", and if you have a DOS or
Windows partition, "Add a DOS partition". The first one you select will be
the default. In each case you have to enter the partition device name
(e.g. /dev/hda1) and give a name to this operating system, such as "linux"
or "windows". These are the names you will use at the LILO boot prompt to
choose which operating system you want to run when the system starts up.
Finally, select "Install LILO". There are two main places you can install
it: in the Master Boot Record, or in the Linux partition itself. I suggest
you choose as follows:
- If your machine is dedicated to Linux, install LILO in the MBR. This
ensures you are not dependent on the MBR from any other operating system.
This is very useful in the case of a brand new hard drive, which has never
had any operating system installed; there must be some program in
the MBR, and LILO can do this job easily.
- If you will always want to boot your system through LILO, you can
also put LILO in the MBR. In this case, beware that you may have a little
difficulty removing LILO later on. The normal method is to boot from a DOS
floppy disk which contains FDISK.EXE, then run "fdisk /mbr"
- If your machine is mainly for DOS/Windows use, you might prefer to
install LILO in the root partition. This means that the MBR will contain
code from your other operating system. To activate LILO, you must set
the "active boot partition" flag on your Linux partition.
You can do this after the installation is complete, but before you reboot,
by running fdisk again. Let us say that your DOS/Windows partition is
/dev/hda1 and your Linux data partition is /dev/hda2. Start like this:
fdisk /dev/hda
p << print the partition table
You will probably see an asterisk (*) next to /dev/hda1. You can toggle this
flag using the 'a' command; once to remove it from /dev/hda1, once to add
it to /dev/hda2.
a << toggle active boot flag
1 << for partition 1
a << toggle active boot flag
2 << for partition 2
p << print the partition table again
w << write it to disk
Later, if you want to disable LILO on your machine, you can just toggle
the flags back again (using either DOS or Linux FDISK). This approach also
has the advantage that if you install a new operating system, say reinstall
Windows 95, it may overwrite the MBR - but by putting LILO in the Linux
data partition, it will remain intact.
- Configure your network? Select Yes. Give your hostname and
domain name. If you don't have an ethernet card, select "use only loopback".
If you _do_ have an ethernet card, and know your IP parameters (IP number,
netmask, gateway, nameserver) you can enter them.
- GPM (mouse-based cut and paste) If you have a mouse, and
enabled it previously, select Yes and you will have the facility to cut and
paste between virtual consoles using the mouse (drag with left button to
select an area, click right button to paste).
- Configure sendmail. The ready-made config files are not always
appropriate. A safe choice is SMTP (Internet with no nameserver). You
can reconfigure sendmail later.
- Select your timezone - choose the most appropriate one from
the list provided.
Finish off and reboot
You should now be back at the main setup menu. Select Exit and you will
be returned to the Unix prompt. Reboot by typing "reboot" or pressing
Ctrl-Alt-Del. The system will shut down and reboot; remember to remove
the root floppy disk if it is still in the drive. It is very important to
always shut down a Linux system properly, rather than just removing the
power, because it needs an opportunity to write altered data blocks back
to the hard drive.
When you see the LILO prompt you can hit ALT (if you chose to have a
5 or 30 second wait before booting the default O/S). This will then give you
a "boot:" prompt. Hit TAB to get a list of operating systems; type the name
of the one you wish to boot.
When you get your machine's login: prompt, login as root. The
first thing you must do now is to set a root password (with the
passwd command) and create a normal user account for yourself
(with adduser)
Fixing bugs
There are some problems with Slackware 3.1 which you have to fix manually.
This sort of problem is difficult to fix on an already-running Slackware;
you would have to uninstall the package, get hold of an updated package, and
reinstall again (which may delete your configuration files in the process).
For this reason I strongly recommend Red Hat over Slackware, as its package
management system is much, much better.
What to do in an emergency!
It is possible to modify your system in such a way that it hangs during
bootup. For example, if you make a bad error in /etc/inittab, and then
reboot, your machine could hang when INIT starts up; or if you change
the shell for 'root' to a non-existent program, you won't be able to
log in as root at all; or you might just forget the root password.
To help you with these problems, Slackware has a 'rescue' disk. This
is made in the same way as the color.gz root disk:
d:
cd \rootdsks
rawrite rescue.gz a:
You then boot up with an install boot disk as if you were installing
Slackware, but use the rescue disk for the root disk. This boots up and
you can mount your hard drive onto /mnt:
mount -t ext2 /dev/hda2 /mnt
You can then use vi on the system configuration files. For example, to
fix a problem with the root account:
vi /mnt/etc/passwd
Edit the first line (for 'root') so that it looks like this:
root::0:0:root:/root:/bin/bash
then exit and save. Reboot with Ctrl-Alt-Del.
Last updated 4 Mar 1997