Linux and Amateur Radio


Description

Linux is a UNIX-like Operating System that was built upon free software. The core of the system (kernel) was written by Linus Torvalds while he was a student in Finland. Much of the system software surrounding the kernel was written by individuals for GNU.

The Linux operating system was written by people who experimented with technology for fun with no monetary interest. So you can see that Linux and Amateur Radio have a lot in common. In fact, Linux support for Amateur Radio is strong and growing. Links to sites for just a few of other Linux Ham Radio software packages are included below.

Linux is not as easy to install and use as Windows for most people. But it is not as hard as many believe. One of the main efforts underway in the Linux community of developers at the moment is to make setup and configuration even easier.

Once installed Linux is very stable. Some users have systems up and running 24 hours a day for an entire year or more, with no system crashes. So if you would like to set up a packet system without having to reboot once a day or once a week Linux may be for you.

Software Description
CLX PacketCluster (DX spot server software)
DigiInfo Database of packet radio information
FBB Packet Radio BBS
LogConv Log file conversion
Pileup CW and pileup practice
SatTrack Satellite Tracking
XNET Graphical network analyzer

What is Linux?

Linux is an Operating System for computers. Quite simply, the operating system (OS) provides users with the means to manipulate files and execute programs by providing access to the computer's hardware. The OS manages the computer's various programs and the memory they use so they don't interfere with each other (assuming the programs are properly written) and governs each program's access to the CPU so that one application doesn't hog the machine. The OS also manages individual users running programs on the same machine and keeps them from interfering with each other while governing each user's access to various system files and other user's directories through a series of permissions set by the system administrator.

Secondly, the OS provides the means for programmers to access the hardware of the computer and the networks it is connected to. By providing an abstraction of the hardware, programs can take advantage of hardware features through a standard Applications Programming Interface, API. With Linux's aim of POSIX compliance (an IEEE standard for operating systems) and the use of the GNU C library, it provides programmers with an excellent platform to write programs that are portable to other flavors of UNIX. Using ANSI C and one of several portability GUI toolkits, programs can also be written for both UNIX and Windows platforms.

Linux is a clone of UNIX, the oft-maligned as difficult to use OS. While most Linux distributions include the popular command line system administration utilities from from the GNU Project, many developers around the world are working to enhance these tools to make them easy to use by desktop users. The goal is a desktop solution easily administered from a workstation's GUI for Intel x86, Motorola PPC, Sun Sparc, Compaq Alpha, Intel Strong Arm, and a host of other micro-processor based computers.

Linux is Free Software. What does this have to do with ham radio? Well, the same pioneering spirit and desire to develop a technology and make it better and then offer it to the community at large, that has historically characterized amateur radio, now also characterizes the Linux community. Hams used to tinkering with hardware will find Linux a pleasant place to tinker with software as all the major Linux distributions include the tools to create and build a complete software package.


Why use Linux for Amateur Radio?

Given the popularity of MS-DOS and Windows, this is a valid question. For the radio amateur contemplating building an AX.25 based TCP/IP switch or user station, Linux offers a very robust and stable environment. The typical Linux distribution includes all manner of networking tools including AX.25 specific networking utilities. Linux is a true pre-emptive multitasking OS with multiple user capabilities which allows you to do other things while your Linux box performs its AX.25 duties with others using the system over the air or via a Local Area Network. In fact, with sufficient bandwidth a user can execute programs on your box and have the program display its output on their terminal.

Linux helps to put the fun back into using a computer. The full system is available for you to study and tweak, if you care to. Nothing is hidden from view as a result of End User License Agreements (ELUAs) or Non-disclosure Agreements (NDAs). The Linux kernel (the core management routines), the system utilities supplied by the GNU Project, and a multitude of other programs found on most distributions are licensed under the GNU Public License or similar licenses. My Free Software page has additional information.

The latest distributions have made it easier than ever before to install Linux on your computer. If you can free up 500 MB or so you can install enough software to get a very good idea if Linux is for your. I encourage you to read the following pages and the links to other resources and then give Linux a try.

Where do I begin?

The very first thing I'd recommend is getting some reading material. Plan to spend some time getting familiar with the installation procedure and Linux/UNIX terminology and syntax. Adding a second operating is a bit more involved than installing the latest office suite (although not much harder these days!) and requires some study as there will be new ways of doing things to learn.


TCP/IP Networking over AX.25

Linux is quite capable of being a powerful TCP/IP switch offering all of the popular Internet services over the ham radio packet network. If you're a bit rusty on TCP/IP based networks, or need to learn more about TCP/IP, networks in general, or network administration, I recommend the following documents available in a variety of formats at The Linux Documentation Project.

Network Administrator's Guide -- General networking info (HTML)
Linux Networking HOWTO -- A guide to configuring Linux networking (HTML)
AX25-HOWTO -- A guide specific to configuring TCP/IP on Linux (HTML)


Networking is nice, what else is there?

A number of packages are available for the ham running Linux and more are evolving. A Web page with descriptions of the very latest ham software is available at the Linux Hamradio Applications and Utilities Homepage. Some things not listed at the Linux Hamradio Applications and Utilities Homepage are available at Ibiblio formerly known as Metalab and before that Sunsite, sigh. Many non-ham specific packages are available and a good place to look is Freshmeat.Net a site dedicated to the latest software announcements for Linux. Also, don't forget the archives for your particular distribution. The binaries provided are compiled and tested for your system and will require much less effort to get working. If you must have the latest and greatest, then get the source and compile your own.


Programming Opportunities

This section was originally written in early 1998 when Linux was just starting to hit the mainstream. While the main programs in use have certainly changed, the underlying concepts remain.

While there is a fair amount of software already available for ham use under Linux, namely satellite tracking, TCP/IP support, and AX.25 BBS software, I think the development has lagged in one key area--end user software. By this I mean contest logging software on a par with CT, TR, and others, host mode packet software on a level with Ka/PkGold, radio control/daily logging software, SSTV software, and programs that support APRS (although the SSTV and APRS areas now each have a good package available). I think these applications are absolutely critical for Linux to become commonplace in the ham-shack. Other nice things will be schematic drawing programs (CAD, already becoming available) and license training software (although web based practice exams may reduce the need for this).

How long it takes for the ham radio market for Linux software to reach "critical mass" depends on how much longer hams are willing to put up with Microsoft's upgrade cycles. I think it will happen when a majority of hams decide Windows is too limiting for the special things we do with computers in the shack and when moving to Linux doesn't mean abandoning familiar software. F6FBB has been maintaining versions of his BBS software for DOS, Win, and Linux from a common source tree for a few years now. So, the sooner we can convince K1EA to port CT and N6TR TR, the sooner the contest community will adopt Linux, same goes for Interflex and KaGold, or any other popular DOS/Win program you care to mention. Another area I see that Linux support will be needed is the new crop of computer controlled radio hardware. These products, such as those from Kachina, ICOM, and Ten-Tec are now only operable from within Win9x and not Linux. These manufacturers should be gently encouraged to port their control programs to Linux or provide interface specifications so that a Free Software version can be written to support their hardware. As I understand it, Ten-Tec and Kachina have made their specifications publicly available and should be congratulated for doing so. In fact, Ten-Tec has released its Windows code under the GPL and released an extensive Programmers Guide. Unfortunately, software for Linux has yet to appear.

Guessing at a time line of when Linux will be the standard in the ham-shack is a bit difficult, but, if I may, I'll go out on a limb. Looking back, ham radio "power users" were early adopters of computer hardware. Many hams bought computers (often built by Radio Shack or Commodore) and put them to work in various tasks around the ham-shack. The cheap IBM PC clones began to appear in the mid '80s after Jeff WA7MBL wrote his MBL BBS software and YAPP a terminal packet program for MS-DOS systems. About the same time K1EA released CT, a DOS based contest logging program, and the ham radio contest world jumped into the computer world for good. Next W0RLI ported his popular RLI BBS software, originally written for the Xerox 820, to DOS and by the late '80s virtually every packet BBS was running on an MS-DOS based PC clone. So by my calculations it took the ham power users about 6 to 8 years to adopt the DOS platform en masse after its introduction in 1981. However, even in 1991, ten years after the PC debuted and the year Linux was born, a good number of end user hams were using Radio Shack CoCos and Commodore 64 for packet terminals and other minor tasks. This changed in the early '90s as PCs became almost a commodity product and powerful software offerings from MFJ, AEA, Interflex, and others began to attract the interests of hams. Windows 3.1 was introduced in 1992 and now a reasonably stable GUI was available for PCs which enticed even more hams and software authors out of the older hardware and in the DOS/Win world.

Now, I see Linux being adopted by more of the ham power users, those wanting the most stable TCP/IP switch or BBS platform available. Hopefully, the next year will produce contest logging software comparable to CT and the next two to three years will produce the "killer" end user ham application that will cause the migration of a majority of hams to Linux. Here is why I see this happening (these are my opinions only (like the rest of these pages!)):

  • Developer costs
  • Each new version of Windows requires an expensive Software Developer's Kit from Microsoft and most small commercial or shareware authors will find it costly to support Win 95, 98, and NT all at once. Linux distributions offer (IMHO the best) professional quality development tools and a stable environment based on published UNIX standards (POSIX) so the APIs won't change with each kernel release. NO undocumented APIs exist! They can't be undocumented as all the system source code is available for inspection by the developer. The X Window System provides a stable and published API for GUI apps.

  • Low hardware costs

    Hams tend to hang on to hardware longer than the computing population at large. Thus, there is a large number of mid to high end 486 and low to mid range Pentium systems in ham-shacks that are said to be too limited for Win98, NT and Win 2k. Linux, however, supports these systems well and probably will for some time in the future. This adds value to currently owned equipment or equipment that can obtained second hand. Linux wins here as it can effectively multi-task applications and support multiple users on this "obsolete" hardware with ease.

  • Excellent experimenters platform

    A Linux distribution includes an astonishing array of development tools that support practically every programming language in use. A number of libraries exist to make interfacing with the OS and hardware much easier than having to write everything as under DOS. A standard device driver interface exists in the kernel and it is quite well documented. If there is doubt on how the kernel handles a certain function, the source is always available to provide the answer. Free Software means never having to settle for an OS whose API is documented one way and works another again (unless you run the latest development kernels :-D ).

  • Very robust and stable

    Linux has garnered a reputation of high stability and reliability. While this isn't a high priority for a normal ham-shack user, it is nice to know that even if some program suffers a horrendous crash and "dumps core" (meaning the kernel creates a file of memory data to aid in debugging the program) the OS will very likely keep on going and not miss a beat. Compare this to messages on your screen saying your system has become unstable and should be restarted...

    There are Linux systems with up-times measured not in days, or weeks, but months and probably a couple somewhere a few years or more. Some system administrators have stated that the only time their Linux system has been restarted is to upgrade the kernel or replace hardware. I for one have gotten so used to my system's stability that even using Win NT at work can drive me nuts!

  • Full networking support including AX.25

    A commercial quality OS that has native AX.25 support? Yup! Nearly all custom ham hardware is supported by the kernel through the AX.25 utilities. In fact a driver is available to use a SoundBlaster 16 sound board as a 9600 bps packet modem! To the rest of the system packet links appear to be just another network interface and all the standard network tools can be used to create the ultimate AX.25 TCP/IP switch, email, ftp, telnet, and http server over packet radio.

  • Secure

    When creating that ultimate server, you want to be sure that programs and users can only access the areas on the system they are supposed to. With Linux's native multiuser support, these issues are handled well. Even so, other packages such as iptables (ipchains in kernel version 2.2.x) in kernel 2.4.x onward allow you to erect a "firewall" to keep ham, local networks, and the Internet separated. Security is an important part of Linux's design and many tools are available to help the system administrator with this task.

  • Continuously evolving

    Linux is an ongoing project on the part of many developers worldwide. Interestingly, the current maintainer of the 2.2.x kernel series and oft considered the Second Lieutenant of kernel development, Alan Cox, is GW4PTS. You can be sure that ham support will probably always be there and up to date.

  • Not owned by one entity

    While all the source code for Linux is copyright of the respective authors, the GNU General Public License ensures that the source code will be made available for all to inspect and change or improve as long as such changes are well documented in the source. While this might not seem all that important, it is important to realize that Linux will not become a victim of its owner's marketing hype. It also means that the operating system is owned as much by the user community as by those who develop it. Obscure bugs affecting a minority of users will not be passed over in favor of feature creep (aka creature feep). If the bug is vexing enough, someone will fix it and forward the fix to the developers where it will be added to the main source tree. This is the biggest advantage Free Software has over its proprietary competition. Hams benefit since this platform will probably remain more stable than the current commercial offerings in the next 5 to 10 years and perhaps beyond.

  • Year 2000 compliant

    Yeah, well, this isn't really a ham radio issue and was more hype than threat, but it should be said that Linux keeps its clock independent of the hardware clock. Linux, as a result of being POSIX compliant, keeps its time in a 32 bit number and figures the date by counting seconds from Jan 01, 1970. It is said this is enough range so that date roll over won't occur until sometime in 2038. By then, if we're still using Linux or UNIX, surely a 64 bit clock will be employed, which will probably put off the roll over problem for a couple of thousand years. ;-)

These ramblings are barely a drop in the ocean of knowledge concerning Linux and could probably be much better. Yet, I hope I've piqued your curiosity and that you'll at least give Linux a try. You really have nothing to lose and a whole lot of fun, adventure, and learning to gain.


 

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!


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.


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.


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.


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...


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!

For any help and info about Linux and Amateur Radio contact Stanley 9H1LO