Linux Installation Preliminaries

Advance preparation for a first-time Linux installation


Linux development since 1998 has seen impressive advances with regard to the ease of which a Linux distribution can be installed on your computer. Installation programs have become quite sophisticated compared to the scripts employed several years back. Hardware detection and configuration have improved to the point where all but the most exotic hardware stands a good chance of being properly configured for your Linux system. What still must be dealt with is making room on your machine for Linux particularly if you have one hard drive partition and only one operating system installed. There several different ways this can be accomplished and you will want to consult the documentation for the distribution you want to install for its recommendations.

On this page I've presented five topics that I think should be explored before installing Linux.

Page Index


Start with some reading

Everybody likes to get new software and jump right in to the installation, right? I'm one of those folks who likes to install it first and read about it later, especially when there are problems. Installing Linux requires planning especially if you want to install it along side DOS/Win on your hard drive (more on this below).

A good reference for getting familiar with Linux installation options, Bash (the command line shell) commands and syntax, and GNU/Linux file system layout is Linux Installation and Getting Started by Matt Welsh, et. al. The guide is also available in several formats including Post Script, HTML, Portable Document Format for Acrobat Reader, and plain text at The Linux Documentation Project Documentation page. The guide details installing Linux as a second operating system and covers partitioning of the hard drive and how to boot either operating system. This manual is part of the Linux Documentation Project (LPD) and their site is the clearing house for Linux documentation. Unfortunately, this excellent document has become unmaintained and has apparently been superceeded by Running Linux described below.

A trip to your favorite computer book store should give you a choice of several good books on Linux. Some of the best books on Linux and UNIX tools are published by O'Reilly and Associates. Running Linux is one of their titles. Now in its fourth edition, Running Linux was updated in December 2002 and is highly recommended as a good reference for learning the basics of working in a Linux based system.

When looking for a book in the book store, try to find one that covers version 2.4.x or later of the kernel. Setup and configuration has changed considerably since the 2.0.x and 2.2.x kernel series, especially with regard to the networking code, a new kernel module daemon, and a number of new and other improved features. If you are running a later mainboard chipset and/or an AGP video card, or USB , then my suggestion is to use 2.4.21 or later for support of these devices or you may want to try one of the 2.6 series kernels (if you're brave!). It appears that the 2.6 kernel's AX.25 support is much improved over the 2.4 series.

Okay, get reading!

Top


Picking a distribution

For a much better resource on current distributions, check out The LWN Linux Distribution List by Linux Weekly News.

Since 1999, when this was originally written, distributions have changed some. Since that time Caldera has all but disappeared from the scene after purchasing SCO and splitting into two companies, Caldera and Lineo. Lineo now calls itself Metrowerks and concentrates on embedded software systems and Caldera is now The SCO Group and is suing everyone in sight for whatever reason. Corel has withdrawn completely from the Linux space. Slackware is now on its own and Walnut Creek has apparently been absorbed by Simtel.

Debian remains as one of the last independent distributions that has survived from the early days, the other being Slackware. Red Hat has dropped their distribution into a community supported distribution called Fedora that plans to use community involvement to build the base of Red Hat Enterprise Linux. S.u.S.E. has recently been bought by Novell. The following remains as information.

Unlike MS-DOS, the various flavors of MS Windows, or Mac OS (up to and including X), the Linux operating system is available in several different flavors called distributions. The most popular distributions are developed, packaged, and sold by commercial entities (yes this is allowed under the terms of the GNU Public License for the Free Software they include). Here are a few of the current major distributions in alphabetical order.

Debian GNU/Linux is the official GNU Project operating system distribution using the Linux kernel (Debian also supports the GNU Hurd kernel). The development team is a volunteer group dedicated to producing a complete Linux distribution based on Free Software. The significance of this venture is that while Debian doesn't directly sell their distribution on CD-ROM, the CD-ROM resellers often donate a portion of their proceeds to support Debian and other GNU projects. As this distribution is the only one developed by a not for profit organization, it is worthy of the support of those of us committed to the idea of Free Software.

I am currently working with Debian Testing, a.k.a Sarge, and am pleased with the packaging system. Debian offers aptitude which is a full screen text utility for package management. In concert with apt (a package retrieval utility) and dpkg, aptitude allows keeping the system up to date with the latest security releases. Debian is famous for its packaging system being so thorough and stable that systems can usually be upgraded to the next release with at most one reboot (to start the latest kernel if desired). Hams will find Debian to be a good distribution to use as the AX.25 and other packages are kept current for the latest stable release.

If it's the ultimate in customization, then Gentoo Linux may be to your liking. This is a distribution that compiles the source and installs the package on your computer allowing complete control and customization of your system. A nice article about Gentoo appeared recently on Linux Weekly News.

Knoppix and branches of it, Gnoppix and Morphix, are live CD-ROM images ready to boot and run. The advantage of these distributions is that no installation is required. You simply boot from the CD and you have a working Linux system. Knoppix has been very clever with hardware detection. All three are based on Debian and may be installed to the hard drive and then updated/upgraded from the main Debian archive. It's a great way to try a Linux system.

Mandrake has been around for a few years and received a running start by basing its first release on a recent version of Redhat. Mandrake has extended the Redhat distribution in many ways and has garnered a large and favorable user base. Unfortunately, Mandrake has undergone bankrupcy in the past year, but is still fighting the good fight.

Redhat is a commercial distribution of Linux. Redhat is positioning their product toward businesses interested in using Linux in the "Enterprise Data Center". Redhat is famous for their Redhat Package Manager which makes installing and removing software quite easy. Software packages whose names end in .rpm can be used with Redhat. Other packages can be too, you just have to do it manually.

Slackware is one of the more popular distributions among the "do it yourself crowd". Slackware is popular with those of us with the hacker bend because it is more of a do-it-yourself system. Even though the learning curve is probably more steep than that associated with most other distributions, in the long run you will gain by learning your Linux system very well and you'll be able fix those little problems that arise.

S.u.S.E. is a distribution from Germany. SuSE includes all the tools and applications one would expect from a current commercial distribution. SuSE's claim to uniqueness lies in its Yast administration tool. SuSE may also be a good choice for the ham considering Linux as traffic on the Linux-hams mailing list indicates a maintainer is active keeping the AX.25 utilities working with the latest SuSE releases. Note! S.u.S.E. was aquired by Novell in late 2003 so it remains to be seen what happens to its ham radio support.

This is a sampling of some of the current popular distributions. It is likely that in the next few months today's star distributions could be yesterday's news. Within recent history Mandrake went from being ideas to one of the hottest distributions and then into bankrupcy. Mandrake is unique that it started with and became extensions of well known current distributions. This "running start" is not new to the world of Linux distributions as to paraphrase someone, "to reach higher one should stand on the shoulders of giants" (okay, that probably wasn't fair to the original quote ;> ). To get an idea of the extent of current Linux distributions check out Linux Weekly News and follow the Distributions link.

Top


Getting Prepared for Your Linux Installation.

Like everything else, this information is quickly becoming outdated. The newer versions of Windows seem to be much more sensitive to dual-booting and resizing of partitions. The information below is several years old and may not reflect the current state of the art. I'm leaving it here for a technical reference and aquired knowledge is never totally useless.

What is your current setup?

As I alluded to above, grabbing a couple of texts on installing and running Linux will prove its worth once you decide to actually take the plunge. The very first thing you'll need to do is find some space to install your new Linux system. Most likely your machine is one of the popular PC architectures, has a 386 or newer processor and has one large hard drive that is partitioned and formatted as your drive C: under DOS or Windows. Chances are, unless you've saved all those pictures from the newsgroups ;-), your drive is about 50 to 70% full leaving 300 to 500 Megabytes of free space. While you will still need some of that space to add more stuff to your Win side of the computer, most of that space can be dedicated to Linux. If you're really lucky, your large hard drive has been partitioned into a primary partition and one or more logical DOS drives in an Extended DOS partition. If this is the case, then your life is considerably easier! Another option is to add another hard drive. With drive prices as low as they've ever been, this is a serious option as it has the least impact on your existing setup.

Adding a second hard drive

Let's start with what should be the easiest way to add more drive capacity to your computer, installing a second hard drive. Most drives these days are IDE (Integrated Drive Electronics) and standard bus interface cards allow two drives to be "daisy chained" together on the same cable. (Okay, the following on jumpers is dated for current drives and BIOS that support CS (cable select). The concept is the same, in this case position on the cable determines master and slave...) The catch is that one drive must be the Master and the other the Slave. The drives actually have jumpers on them that will need to be set appropriately. Your BIOS will select the Master drive to be C: and the Slave to be D: (this is actually a bit more complex if either drive has been partitioned and logical DOS drives created). Make sure you have technical literature for each drive available as well as documentation for setting the BIOS if it doesn't have a drive search feature. Finally, before ordering that new hard drive, you might wish to verify that only one drive is currently installed! This can be performed by checking the BIOS drive settings or pulling the cover and looking...

Existing drive with partitions

If you have one drive that has been partitioned (often the case if the drive was larger than 512 MB and used with an older motherboard that did not do LBA (Logical Block Addressing--a way to re-map physical drive characteristics so MS-DOS can access the entire disk as one drive)) you may wish to dedicate one or more of those partitions to Linux. Historically, MS-DOS can only boot from the Primary partition of the first hard drive in the computer. The FDISK utility provided by MS-DOS can only create one primary partition per drive. It then can create only one more partition on the drive called the Extended DOS Partition. In the extended DOS partition FDISK creates Logical DOS drives. The drive hierarchy looks something like this:

	First Hard Drive
	|
	|
	+-- Primary Partition "C:\"
      	|
	|
	+-- Extended DOS Partition
       		|
       		|
		+ Logical DOS Drive "D:\"
		|
		|
		+ Logical DOS Drive "E:\"	<== Anything after D: is optional
		|
		|
		+ Logical DOS Drive "F:\"
		|
		|
		+ Logical DOS Drive "G:\"

Except for limitations related to older versions of DOS and BIOS issues, the actual sizes allocated to each of these partitions or logical drives are totally arbitrary. Although the PC BIOS supports up to four primary partitions per disk, MS-DOS only recognizes one primary, the first one on the drive. All other DOS drives on a hard disk reside in the extended partition in which a maximum of four logical drives can exist (this is a DOS limitation).

By moving the data out of one or more of the logical DOS drives, Linux can be easily installed to this portion of your hard disk.

Repartitioning an existing drive

If your situation involves having just one hard drive that is only a primary partition and not enough cash for another hard drive, don't despair as there are a couple of programs available that will allow you to repartition your drive "without data loss" (their claims, not mine). A freely available (under the GNU Public License) utility is FIPS and a commercial program to do this is called Partition Magic. Read their instructions carefully and back up your data before fooling around with any drive partitions. Typically such programs required that you use a disk defragmenter such as Norton's Speed Disk or MS-DOS' DEFRAG to move the data up to the from part of the drive so the new partition(s) can be created toward the end (higher numbered cylinders) of the drive.

If you're repartitioning your drive, you need to consider how much free space you have available and whether that will be enough for a working Linux system (roughly 500 MB or so with X) and allow you some growth for DOS/WinX programs. which you will likely use for a while until you are familiar with Linux and UNIX type commands and programs.

Top


How Linux Views Your Hard Drive Structure

As you might suspect, after reading to this point, Linux is very flexible and has support for a variety of hardware configurations. Chief among these is the hard drive structure of your computer. Since IDE drives are the most common (and the only type I have experience with) I will be focusing the way Linux deals with them.

Recent PC hardware has support for two IDE drives. Special interface cards and motherboards have boosted this limit to four. Linux refers to these drives in order from hda to hdd. Think of this as shorthand for "hard drive a", etc. Partitions add a numeric designator so that the first primary partition on the first hard drive would be hda1. On any drive, numbers 1 to 4 are reserved for the four primary partitions (remember, the limit on primary partitions is four!), while 5 to 8 refer to logical partitions (logical DOS drives) in the extended partition. Confused? Here's an illustration.

The only hard drive in the system has one primary and one extended partition with two logical DOS drives.

	Physical		DOS		Linux
	Primary Partition	C:\		hda1
	Extended Partition			hda2
	First Logical Drive	D:\		hda5
	Second Logical Drive	E:\		hda6

Linux's hda2 seems to require some explanation. Linux must keep track of the extended partition and assigns it a primary partition number, yet it is smart enough to know that it will contain other partitions. Linux has been cleverly designed to fully understand and work with PC hardware and MS-DOS/Win and their limitations and features. Let's look at another example.

Here we have a two drive system. The first drive is MS-DOS drive C: and the second drive is divided between MS-DOS and Linux.

	Physical		DOS	Linux
	Drive 1 primary		C:\	hda1
	Drive 2 primary 1	D:\	hdb1
	Drive 2 primary 2	?	hdb2	< Linux Native
	Drive 2 primary 3	?	hdb3	< Linux Swap

Since MS-DOS has no support for Linux partitions, those partitions are essentially ignored. DOS' FDISK may at best tell you the partition is owned by some unknown OS. hdb2 is the main Linux partition where its file system will reside. hdb3 is the swap partition. While Linux can swap to a file, using a separate partition is widely used and is essentially a "set it and forget it" arrangement its size usually being equal to the installed ram (yes, Linux uses disk swapping to create virtual memory).

Linux will happily start and operate no matter which drive or partition it is placed. The difficult part of this process is figuring out where to create the room for Linux and then putting it there. Linux has a very flexible fdisk utility (notice I used lower case for the the name of the Linux command and upper case for the DOS counterpart of the same name) that you will use to set up your new Linux partitions.

Top


Introducing Linux fdisk

The fdisk included with a Linux distribution is quite robust and recognizes about every OS ever designed to be installed on PC hardware (there is also cfdisk that uses a curses UI for easier navigation). When you begin your Linux installation, this is the first actual Linux program you will work with. Like MS-DOS, a partition must be created and labeled as to the type of OS that will occupy that portion of the disk. For Linux you will probably use it to create two partitions, one for the file system and the other for the swap area.

fdisk is menu driven using one letter commands. It allows you to play with various configurations as it will not write the information to the partition table until you give it the write command. At anytime you can quit the program and any changes will be discarded and nothing on the drive you are working on will be changed. When you first start fdisk you are greeted with a rather deceptive prompt:

~ # /sbin/fdisk

Using /dev/hda as default device!

Command (m for help):

If you know your way around you can get right to work, otherwise pressing m gives you a menu of available commands:

Command (m for help): m
Command action
   a   toggle a bootable flag
   b   edit bsd disklabel
   c   toggle the dos compatibility flag
   d   delete a partition
   l   list known partition types
   m   print this menu
   n   add a new partition
   p   print the partition table
   q   quit without saving changes
   t   change a partition's system id
   u   change display/entry units
   v   verify the partition table
   w   write table to disk and exit
   x   extra functionality (experts only)

Command (m for help):

Most of these are self explanatory, but the first thing you need to do is type p to see the current partition table so you know which hd devices you'll be dealing with:

Command (m for help): p

Disk /dev/hda: 64 heads, 63 sectors, 1023 cylinders
Units = cylinders of 4032 * 512 bytes

   Device Boot   Begin    Start     End   Blocks  Id  System
/dev/hda1   *       1        1      153  308416+  6  DOS 16-bit >=32M
/dev/hda2         154      154      915 1536192  83  Linux native
/dev/hda3         916      916      932   34272  82  Linux swap
/dev/hda4         933      933     1022  181440   5  Extended
/dev/hda5         933      933     1022  181408+  6  DOS 16-bit >=32M

Command (m for help):

As you can see, the p command provides you with a great deal of information. Notice that fdisk uses the proper Linux terminology for hard drive devices. As you get to know Linux, you'll find that you'll be referring to these device names often. When creating or modifying your Linux partitions you'll only need to work with the partition numbers. When adding new partitions, you can specify the size in cylinders or bytes. Using the n command, fdisk prompts you for the starting cylinder of the partition. Since everything up to cylinder 933 is allocated, it shows it as the lowest cylinder that can be used. The last cylinder in the partition you are creating can be entered either as a size value or by a specific cylinder. Once you've entered valid information, fdisk returns you to the main command prompt. If you are satisfied with your configuration, use the w command to write the changes to the partition table and exit the program. Since my motherboard's BIOS provides LBA, the drive has been re-mapped so there are more heads and more sectors/track than are physically on the drive. LBA keeps the total cylinder count from exceeding 1024 so MS-DOS can access the entire disk. Linux has no problem dealing with LBA mapped drives, although it can access cylinder counts beyond 1024.

Command (m for help): n
First cylinder (933-1022): 933
Last cylinder or +size or +sizeM or +sizeK ([933]-1022): 1022

Command (m for help):

Examine the following sequence of commands where I delete the swap partition shown in the p command output above and add it back in.

Command (m for help): d
Partition number (1-5): 3

Command (m for help): p

Disk /dev/hda: 64 heads, 63 sectors, 1023 cylinders
Units = cylinders of 4032 * 512 bytes

   Device Boot   Begin    Start     End   Blocks   Id  System
/dev/hda1   *       1        1      153  308416+   6  DOS 16-bit >=32M
/dev/hda2         154      154      915 1536192   83  Linux native
/dev/hda4         933      933     1022  181440    5  Extended
/dev/hda5         933      933     1022  181408+   6  DOS 16-bit >=32M

Command (m for help): n
Command action
   l   logical (5 or over)
   p   primary partition (1-4)

Now fdisk asks what kind of partition to create, I'll pick p as I want to add /dev/hda3 back in.

p
Partition number (1-4): 3
First cylinder (916-1023): 916
Last cylinder or +size or +sizeM or +sizeK ([916]-932): 932

Command (m for help):

It appears one has to be careful here as fdisk will allow a starting cylinder anywhere from 916 to 1023, yet the extended partition starts at 933 which I wish to keep. However, once I specified cylinder 916, fdisk seemed to know that 932 was the highest available cylinder. Go figure.

By default fdisk assigns the Id of 83, or Linux Native, to any partition it creates as the following p output shows.

Command (m for help): p

Disk /dev/hda: 64 heads, 63 sectors, 1023 cylinders
Units = cylinders of 4032 * 512 bytes

   Device Boot   Begin    Start     End   Blocks   Id  System
/dev/hda1   *       1        1      153  308416+   6  DOS 16-bit >=32M
/dev/hda2         154      154      915 1536192   83  Linux native
/dev/hda3         916      916      932   34272   83  Linux native
/dev/hda4         933      933     1022  181440    5  Extended
/dev/hda5         933      933     1022  181408+   6  DOS 16-bit >=32M

Command (m for help):

If you look back you'll see that Linux Swap has an Id of 82, so we need to change it using the t command.

Command (m for help): t
Partition number (1-5): 3
Hex code (type L to list codes): L

 0  Empty           17  Hidden HPFS/NTF 5c  Priam Edisk     a6  OpenBSD        
 1  FAT12           18  AST Windows swa 61  SpeedStor       a7  NeXTSTEP       
 2  XENIX root      1b  Hidden Win95 FA 63  GNU HURD or Sys b7  BSDI fs        
 3  XENIX usr       1c  Hidden Win95 FA 64  Novell Netware  b8  BSDI swap      
 4  FAT16 <32M      1e  Hidden Win95 FA 65  Novell Netware  c1  DRDOS/sec (FAT-
 5  Extended        24  NEC DOS         70  DiskSecure Mult c4  DRDOS/sec (FAT-
 6  FAT16           3c  PartitionMagic  75  PC/IX           c6  DRDOS/sec (FAT-
 7  HPFS/NTFS       40  Venix 80286     80  Old Minix       c7  Syrinx         
 8  AIX             41  PPC PReP Boot   81  Minix / old Lin db  CP/M / CTOS / .
 9  AIX bootable    42  SFS             82  Linux swap      e1  DOS access     
 a  OS/2 Boot Manag 4d  QNX4.x          83  Linux           e3  DOS R/O        
 b  Win95 FAT32     4e  QNX4.x 2nd part 84  OS/2 hidden C:  e4  SpeedStor      
 c  Win95 FAT32 (LB 4f  QNX4.x 3rd part 85  Linux extended  eb  BeOS fs        
 e  Win95 FAT16 (LB 50  OnTrack DM      86  NTFS volume set f1  SpeedStor      
 f  Win95 Ext'd (LB 51  OnTrack DM6 Aux 87  NTFS volume set f4  SpeedStor      
10  OPUS            52  CP/M            93  Amoeba          f2  DOS secondary  
11  Hidden FAT12    53  OnTrack DM6 Aux 94  Amoeba BBT      fd  Linux raid auto
12  Compaq diagnost 54  OnTrackDM6      a0  IBM Thinkpad hi fe  LANstep        
14  Hidden FAT16 <3 55  EZ-Drive        a5  BSD/386         ff  BBT            
16  Hidden FAT16    56  Golden Bow     

Hex code (type L to list codes): 82
Changed system type of partition 3 to 82 (Linux swap)

Command (m for help):

It's obvious fdisk can work with quite a number of partition types. A final p command shows things have been returned to the original configuration.

Command (m for help): p

Disk /dev/hda: 64 heads, 63 sectors, 1023 cylinders
Units = cylinders of 4032 * 512 bytes

   Device Boot   Begin    Start     End   Blocks   Id  System
/dev/hda1   *       1        1      153  308416+   6  DOS 16-bit >=32M
/dev/hda2         154      154      915 1536192   83  Linux native
/dev/hda3         916      916      932   34272   82  Linux swap
/dev/hda4         933      933     1022  181440    5  Extended
/dev/hda5         933      933     1022  181408+   6  DOS 16-bit >=32M

Command (m for help):

All these changes were performed without ever changing the partition table on the disk. When I was finished the q command quit the program without saving any changes.

While fdisk will happily work with DOS partitions, creating and deleting, it is probably best that you use DOS' FDISK.EXE for the job. Given the fussy nature of MS-DOS, I would consider this wise advice...

Top


Summary

Preparing your computer to install Linux seems like a daunting task and while there are a few traps a little bit of preparation and planning will go a long way toward a smooth Linux installation. The primary object of this trouble is to allow you to work with your computer in your current environment as you always have while having a complete Linux system available at your beck and call. From here follow whatever Linux installation guide you choose and begin to learn your new operating system.

Good Luck!

Top

Next: Linux Setup Notes


Take me back to the Index!

The Linux Webring:
[ Prev | Next | Random | List | Home | Stats ]

Original content Copyright © 1997-2024 Nate Bargmann NØNB n0nb@n0nb.us
any other content copyright by respective author(s).

This page last modified
February 10, 2005
Valid XHTML 1.0! Valid CSS! Built with WSMake!