Installing Slackware Linux

Slackware Linux is one of the oldest Linux distributions remaining. Over the years, it has stayed true to its roots and form.

Here's what the author, Patrick Volkerding has to say about it.

http://www.slackware.com/info/

The Slackware Philosophy

Since its first release in April of 1993, the Slackware Linux Project has aimed at producing the most "UNIX-like" Linux distribution out there. Slackware complies with the published Linux standards, such as the Linux File System Standard. We have always considered simplicity and stability paramount, and as a result Slackware has become one of the most popular, stable, and friendly distributions available.


What's this about "friendly"? You heard that Slackware was too damned hard, didn't you? If you are expecting cute graphical wizards and penguins automating every configuration step for you, that may be true. However, in essense, Slackware is one of the simplest distributions there is if you are proficient with a Linux system. If you aren't, a little perseverance with Slackware and you will be.

The reason it is easy for an experienced user is, first of all the init scripts and configuration files are easy to follow. They are generally well commented and it's easy to make changes using an ordinary text editor.

Not only that, you are getting the full, complete, standard releases of software in this distribution, installed in a sane manner. The way the developers intended. Therefore, when you go to install additional software not provided by the distribution vendor, you don't run into as many snags.

The packaging system in Slackware is quick, dirty and simple too. Slackware packages (.tgz files) are basically just tar.gz archives, that have install scripts that the packaging utilities execute. No dependency checking, which can be good or bad, depending on how you look at it. To me it's good, because I don't get annoyed by packages that won't install because of some brain dead mechanism that checks for things in specific places. The catch is, you need to be a bit careful installing system software.

Slackware also provides an excellent environment for building your own software from sources.

I could go on at length about why you should give Slackware an honest try but I'll let you follow this guide and see for yourself. We are going to be installing Slackware 9.1, which is the latest release at the time of writing.

Note: Slackware is now at version 10.2 and the installation routine has not changed appreciably, so this installation guide is still applicable.

Starting the Installation

First of all, if you intend to dual boot with Windows, take care of that first. If you're starting with a fresh hard disk, create a partition for Windows, and leave the rest unallocated (unpartitioned). Install Windows first.

Boot with the first disk in the Slackware CD set. (or the first CD that you created from the ISO files you downloaded).

If your computer is unable to boot from the CDROM for whatever reason, it is also possible to create a floppy boot disk set for the installation. Read the file README.TXT in the bootdisks directory on the Slackware CD, as well as the rootdisks directory. In Slackware 9.1, this directory is on the first CD.

Once you boot with the installation media, this is the first screen you will see:



Most people with plain IDE systems, can just hit enter here, to load the bare.i kernel image. The README.TXT in the bootdisks directory, describes the precompiled kernel images available on the Slackware CD. If you have SCSI disks, you must read that file, because adaptec.s, scsi.s, scsi2.s and scsi3.s each contain drivers for different SCSI controllers.

So press Enter to load bare.i, or type the name of the kernel image you wish to load (e.g. scsi.s)

The kernel will boot, and then you will be instructed to log on as root.



Just type root and hit enter. You will not be prompted for a password at this time.

Now we must partition the disk. This is probably the trickiest part of Slackware Setup, for there are no point and click partitioning utilities provided. We are going to use the Linux Fdisk utility. It seems scary at first, a bit alien, but it's very easy to operate and you're unlikely to make mistakes if you follow the steps correctly, and do not write the tables to disk until you're sure. I have never had a mishap with this program, and it has never damaged any existing (Windows) partition table entries on the disk.

What I did here was, I hooked up a new Western Digital 40 Gb hard disk for this install. I booted with the Windows XP CD and during setup, created an 8 Gb partition, formatted it NTFS and blasted a quick Windows XP install on there so we can have a dual boot. I left the rest of the disk unallocated.

Fdisk must be invoked with the device name of the hard disk you wish to partition. In this case, we're using the primary master hard disk, so we use the /dev/hda devicename. Here is how IDE disks are named:

/dev/hda - Primary Master
/dev/hdb - Primary Slave
/dev/hdc - Secondary Master
/dev/hdd - Secondary Slave

Note that these do not refer to partitions or filesystems, but the hard disk devices themselves. (/dev/hda1, /dev/hda2 and so on, is how partitions are addressed)

SCSI disks are named /dev/sda, /dev/sdb, /dev/sdc and so on, according to which are first enumerated on the bus.

We need to type fdisk /dev/hda



Don't worry about the informational message about the number of cylinders. Unless you're installing a very old Linux distribution, the boot loader won't have a problem.

Now what? Press m to see a list of commands.



The first thing we want to do is press p to print (display) the partition table. We do this after every step, so we can see the results. Nothing is really changed, until we press w to write the partition table to disk.



There's our 8 Gb NTFS partition, /dev/hda1. The first partition on the disk, and in Windows terms, the active partition. It's going to stay that way.

The units (for Start and End) are in cylinders of 8225280 bytes. Just remember that each unit is rougly 8 megabytes (7.84 if you do the math). It's also displayed in blocks of rougly 1 kb. Don't worry about it, we will be specifying partition sizes in megabytes.

Now, how we partition depends greatly on personal preference. All you really need to install and run Linux is a root partition, and a swap partition, and you may find that easier to deal with. It is perfectly acceptable to do that. However, that's a fairly large chunk of disk and we can mount parts of the Linux filesystem on separate partitions.

This is basically how I would allocate this space, for use with Slackware. It's just the way I do things, you can choose other partitioning schemes and sizes. If disk space is tight, you should create only a root partition, and save some space for a swap partition. For example, if you have 4 Gb of space to allocate, create a 3.7 Gb root partition and use the rest for swap. That would be a half decent setup.

Using multiple partitions is a bit wasteful, because we have to allow room on each partition for growth. This may result in some disk space staying unused. Err on the side of caution, and allocate plenty of space.

This is what I would do for my own use:

1 Gb root partition (primary partition)
The root filesystem, contains system software and libraries, configuration data (/etc), local state data (/var) and all other filesystems are mounted under it.

Extended partition utilizing the rest of the disk
We then create logical drives on the extended partition.

1 Gb swap partition (logical drive)
Note that you probably don't need a swap partition that large but I like the extra insurance and I have plenty of space. It allows me to work on absolutely huge files, and provides extra memory addressing in the event of some sort of race condition. 256 Mb should probably be enough swap though, if disk space is tight.

8 Gb partition for /usr (logical drive)
Most all of your software and libraries get installed in /usr. It is useful to have a large partition for this.

2 Gb partition for /opt (logical drive)
"Optional" software can be installed here. For example, KDE will be installed to /opt/kde. I install some other software to /opt as well.

18 Gb (roughly) for /home (logical drive)
We use what is leftover, for /home. This is where the user directories are, and where users will store personal files. You may also install some software to /home if desired. I do, and I keep build directories there as well.

Now, we will start creating these partitions.

To create a new partition, press n



We are prompted to choose primary, or extended. We want to create a primary partition here. (though the root partition could be a logical partition on the extended)

Press p to create a primary partition.



We then have to give it a partition number. The Windows XP partition is already partition 1, so we have to choose 2

We are then prompted for the starting cylinder. We will be just hitting enter, to accept the default value. (the first available cylinder). We will be accepting the default starting cylinder for each partition we create. We will specify the ending cylinder, by specifying the size in megabytes. For the value of "last cylinder", we type +1024M to create a partition of roughly 1 gigabyte. Partitions have to end on a cylinder boundary (or waste sectors), and partitioning software automatically adjusts that.



Now, press p to display the partition tables, and you'll see what you've done so far. At this point, if you've made a mistake, simply press d and type the partition number that you want to delete (2 in this case... just don't touch partition 1 or you'll destroy Windows). Nothing has been written yet, you can just delete the partition you've created and repeat the last step. This is why we view the partition info at every step. If satisfied, proceed with the next step. At the command prompt, you can press q at any time to quit without writing anything to disk, if you've made a serious mistake and just want to start over.

Now we are going to create an extended partition, to act as a container for our logical drives.



Press n to create a new partition then press e to choose extended. Press 3 when prompted for the partition number and it will be designated as /dev/hda3. We will never be accessing this partition, just the logical drives we are going to create on it.

Note: How the partition numbers work is, partitions 1 to 4 are reserved for primary partitions. (the extended partition is considered a primary partition). It is an architectural limitation of PC BIOS partition tables, that only 4 primary partitions are allowed on a disk. You can have many logical drives though. Logical drives start being numbered at 5, in the Linux scheme.

Press enter when prompted for the first cylinder, to accept the default of the next available.

When prompted for the last cylinder, this time, simply press enter again. It will allocate the rest of the disk, ending at the last cylinder 4865.

Press p to display the partition tables.

Now we are going to create logical drives until we've used up the extended partition, starting with swap. I generally like to put swap in between the root partition and /usr.



You know the drill. Press n to create a new partition, but this time press l for logical. (In our case, we can't create any more primary partitions because we've already allocated the disk)

Note that we are not prompted to choose a partition number for a logical drive, as it will be assigned 5 as the first one.

Press enter to accept the default value of the first cylinder. For the last cylinder, I'll type +1024M to create a 1 Gb partition.

Press p to display the partition table, and note that our new partition is /dev/hda5. There will be no /dev/hda4, because there will be no more primary partitions on this disk.

Aside: Just so you understand how this works, let's say that when we created the extended partition, we didn't allocate the rest of the disk. We left some space unallocated. If we were to create a primary partition using that space now or some time in the future, it would become /dev/hda4.

OK, now, note the Id column in the display of the partition table. By default, when we create partitions they are of type 83, Linux Native.

We must change the partition type of the one we just created to 82, Linux Swap.



Press t to "change a partition's system id" and then press 5 when prompted for the partition number. (Following my partitioning scheme, that is. Use the correct number for your swap partition of course)

When prompted for the Hex Code (partition ID), if you were to press L, you would see a long list of possible partition types that the Linux fdisk utility is aware of.

Type 82 for Linux Swap, and hit enter. When you press p to display, you will see the change.

The rest of the partitions we'll create, will be the default type 83, Linux.



Press n to create a new partition. Choose l for logical. Press enter to accept the default first cylinder. For the last cylinder, type +8192M to create an 8 Gb partition for /usr.



Again, n for a new partition, and l for logical. Press enter for the first cylinder. For the last cylinder, type +2048M to create a 2 Gb partition for /opt.

Now, we'll allocate the last partition for /home.



When asked for the first and last cylinders, just press enter for both of those this time, as we're using up the extended partition.

If satisfied with your changes, press w to write the partition table to disk, and exit the Linux fdisk utility.



If you see a warning like that, restart the system (with the slackware CD). I am seeing that message, because I altered the partition tables on a live system (to get those screenshots easily), but I have seen similar warnings when writing the partition tables to disk if I've gone back and redone them after already writing. You should just see "Calling ioctl() to re-read partition table", and "Syncing Disks". You only need to reboot if there were warnings.

Note: I said I altered the partition tables on a live system. That means, the data on those partitions was effectively lost. The next reboot would have been oblivion. Not a problem because it was just a test install, and I planned to install the OS again (Slackware installs very quickly), but know that you can't adjust partitions on the fly, as the partitions must be formatted afterwards.

Take note of which partition devices you created to correspond with your mount points. You'll need to specify them, during setup.

Now we are ready to proceed with the Slackware installation.