Get Started With Red Hat Linux

1. Installing Linux on your Windows-based PC
2. Boost Your Penguin Power

3. Second Steps With Red Hat Linux

Installing Linux on your Windows-based PC
by Dan Berkes, PC World November 23, 1999

Note: We first ran this feature last March, when Linux was still a bear to set up and our readers asked for a simple walkthrough to help get the job done. Much has changed since then. Many Linux distributors--Caldera, in particular--have made Linux easier to install. And the latest incarnation of the distribution we highlight here, Red Hat Linux, has made significant strides in ease of use as well. If you're ready to dive into the Linux world, here's how to put Red Hat Linux 6.1 on your PC. --Editors

Why install Linux? Because if you're looking for a fast, reliable, inexpensive operating system that can accommodate multiple users, act as an Internet server, and still support a slick, easy to use graphical interface, it fits the bill better than the alternative.

Reliability is Linux's ace in the hole. While the rumor that Linux never crashes is an exaggeration, it's close to the truth: It is very hard to crash a Linux system. Some installations have been known to run for years without a reboot.

Linux also runs on older machines that can't handle Windows; it will work beautifully, for example, on that old 486 gathering dust in the closet. And, of course, some folks are interested in Linux simply because it's not from Microsoft.

There's much to like about Linux, but getting started with it can be intimidating. For one thing, there isn't only one Linux. Several companies market their own distributions. Each has pros and cons, with their differences lying mainly in installation procedures and in the accompanying software packages. Major Linux distributions include those offered by Red Hat Software, Caldera, Slackware, SuSE, and Debian. In this article, we'll show you how to install the most popular distribution, Red Hat Linux 6.1.

Keep in mind that there are nearly as many ways to install Linux "properly" as there are Linux users. What follows is one way of doing it, so you can get up and running and see what all the fuss is about. We'll assume you're already running Windows 95 or 98, but these instructions will also be useful for installing Linux on a box with no OS. Your Own Red Hat

There are several ways to get a copy of Red Hat Linux. You can order it directly from Red Hat Software or purchase a copy at your local computer store. You can also download Red Hat Linux for free, but doing so is a time-consuming process that can add a few wrinkles to the installation procedure, so we don't recommend it for first-timers.

Another alternative is to purchase a third-party copy online. You can get third-party copies of Red Hat Linux online for much less than you'd pay to buy it directly from Red Hat (which will cost you $80). We chose Red Hat 6.1 GPL from Linux System Labs. As of this writing, LSL will send you its copy of the complete Red Hat 6.1 distribution for only the cost of shipping and handling. But be warned: If you buy Red Hat Linux from another vendor, you won't receive technical support from Red Hat.

The first step after acquiring the software is to set up a partition for it on your hard drive. You'll need a third-party program to shrink existing partitions and make room for the new ones. Our favorite hard disk partitioning tool is Partition Magic from PowerQuest. Its wizards guide you through the process of shrinking your Windows partition to make more room. Ranish Partition Manager is a shareware alternative, but its bare-bones interface makes it appropriate only for experienced PC users. Before you make any changes to your existing partitions, back up all of your essential files to removable media. You'll need at least 500MB of available drive space to install Linux. Create this space by using your partitioning tool to shrink existing partitions, leaving a contiguous stretch of empty space on the drive. (This free space may be within a preexisting Extended Partition or on a completely unpartitioned portion of the drive.) Don't bother creating partitions for Linux in the empty space you create; we'll let Red Hat take care of that. After you've made some room, you're ready to move on.

Be Prepared
If you purchased your copy of Red Hat Linux directly from Red Hat (or if you ordered the GPL version from Linux System Labs), the installation CD-ROM is bootable. If your PC supports bootable CDs, then you're set. If your installation CD-ROM came from another vendor, or your PC can't boot from a CD, it's time to make a boot disk.

1.Grab a freshly formatted floppy disk and pop it into that small slot on the front of your computer that's been gathering dust. Within Windows, right-click the desktop and select New, Folder from the pop-up menu. Name the new folder Bootdisk and double-click the folder to open it. (After you've installed Linux, you can delete this folder.)

2.Insert the Red Hat CD into your drive. Open My Computer, double-click the icon that represents your CD-ROM drive, and double-click the folder named Dosutils. Click and right-drag the Rawrite file in that folder to the Bootdisk folder window. Select Copy Here from the menu that appears.

3.Close the Dosutils window and open the Images folder on the CD-ROM. Copy Boot.img to the Bootdisk folder, just as you did with Rawrite.

4.Select Start, Run, type command in the box that appears, and click OK. A window appears with a DOS command prompt that reads C:\Windows\Desktop. Type cd bootdisk and press Enter.

5.Here's where you finally create a Red Hat boot disk: Type rawrite and press Enter. Type boot.img for the name of the file you wish to copy and press Enter. Finally, when prompted for a target drive, type a: (or whichever letter represents your floppy drive) and press Enter.

Take Inventory
While installing Linux isn't the enormous chore it once was, it's still not the streamlined process you might wish it to be--especially because Linux cannot automatically detect all the hardware on your system. You may need to answer a lot of questions during the installation process, so you should be armed with the correct answers before you start. Get them by going to Device Manager: Right-click My Computer, select Properties, and click the Device Manager tab. You'll see a tree view of all your system's hardware. Click the Print button, select "All devices and system summary," and click OK to print a report of what's hiding inside your PC. You may not need all this information during the installation process (Red Hat Linux can detect a lot of hardware), but the printout will come in handy if you run into a snag.

The Journey Begins
If you made a boot floppy, insert it now. If not, insert your installation CD-ROM and restart your computer. When you get a text-based welcome screen, press Enter. Now sit back and wait for the installation program to load. You may see heaps of scary-looking text fly by, but that's just Linux starting up.

In a few minutes, the Red Hat logo should appear on your screen. Red Hat 6.1 features a graphical installation program that you control with your mouse, similar to the Windows installation procedure. It begins by asking you which language you speak. Using the mouse, highlight your native tongue and click Next. The installer now wants to know which type of keyboard you're using. With rare exception, you should be able to get by with the default selection (Generic 101-key PC, U.S. English), so click Next. Red Hat will now probe your system to find out which kind of mouse you're using. The next screen will display its findings. Make any needed changes and move on.

Now that you've provided the installer with basic information about your system, it's time to start the installation of your new operating system. Skip past the second welcome screen. When asked what type of installation you want to perform, choose Custom.

Enter the Druid
Red Hat now needs to set up its file system on your hard drive. Enter the Disk Druid--a tool that should be on your screen at this point. You'll need to create two partitions within the empty space you created earlier. The first is your root partition, where all of your files will go. The second is a swap partition that, like Windows' swap file, complements your physical RAM.

To begin creating your root partition, click Add. Enter a single forward slash (/) for Mount Point, and check the "Grow to fill disk?" box. Select Linux Native as the partition type, and then select OK. Your new partition should expand to fill all empty space, and Disk Druid should confirm that it has.

Click Add again to set up your swap partition. Enter nothing for Mount Point. Enter 128 for the size (less if you're hurting for disk space, but the more the better) and don't check the "Grow to fill disk?" box. Select Linux Swap as the type. Click OK.

Disk Druid should now show the two partitions you added: a large root partition and a smaller swap partition. Select Next.

Your new partitions need formatting. Red Hat formats the swap partition first, giving you the option to "Check for bad blocks" during the format. It's a good idea to select this option. Then Red Hat formats your root partition (listed as "/"), and again it's a good idea to check for bad blocks.

Look LI, Look LO
Now configure the Linux Loader, known as LILO. This tiny program runs when your computer starts up, giving you the choice of loading Windows or booting into Linux.

First, make sure that "Create boot disk" is checked. It's a good idea to create such a disk to handle emergency situations, so have a blank disk ready.

You'll want LILO on your Master Boot Record, so make sure that the check box next to "/dev/hda Master Boot Record (MBR)" is selected. You're probably not ready to make Linux your main operating system, so to make sure Windows boots first, check the box to the left of "Default boot image" and enter dos (if it isn't already there) for the Boot Label. Select Next to continue.

If you need to configure a local area network, the next screen allows you to enter the information Linux will need to activate your network card. If you don't have a card or aren't using the one you have, click Next to skip this section.

Now Red Hat wants to know where you live, in a general sense. Scroll through the menu beneath the colorful world map to select the city nearest you (and in the same time zone), and click Next.

At this point you need to select a root password. This is an important step. Linux is a multiuser operating system and every Linux installation needs a user called "root" to function as the system administrator. That's you, so select a secure password and don't forget it.

The root account lets you do just about anything to your system and should be used only for administration and maintenance. For daily use, it's best to create a separate user account for yourself. Below the area where you entered your root password, enter an account name, a password (you need to enter it twice), and a descriptive name for the account--your full name is fine. Click Add to activate the account, and then Next to move on.

The next screen, Authentication Configuration, offers several types of password services that can be used with Red Hat. The defaults are fine, so simply select Next.

Open Your Packages
Red Hat's Linux distribution offers more than an operating system. Its CD-ROM also contains a huge library of powerful software such as The Gimp, an image manipulation tool that rivals Photoshop, and Apache, a popular Web server.

So you can now specify which applications you want installed. The installer preselects a number of software packages, including basic Internet applications such as an e-mail client, Telnet, FTP, and a Web browser. Among the other packages are system drivers and libraries. By default, the DOS/Windows Connectivity and Kernel Development packages are not selected, but you should select them.

The X Windows System gives you a graphical interface that lets you interact with your Linux system similar to the way you do with Windows. Unlike Windows, however, X Windows doesn't dictate how your on-screen environment is going to look--the Window Manager will do that. There are dozens of Window Managers available; some mimic the Windows 95/98 user interface, and one mimics the Mac. Others are like nothing you've ever seen. GNOME and KDE are both "desktop environments"--they go beyond the Window Manager to provide a host of tools and applications that make Linux just a tad friendlier for the novice.

I'm telling you about these things now because you need to make sure that you install all the necessary X Windows packages, including GNOME and KDE. GNOME is probably selected in the menu you're staring at; you'll have to select KDE manually to get it installed. If you want to get into the real nitty-gritty, choose "Select individual packages"--but only if you have plenty of time to read dozens of esoteric descriptions.

After you've selected the packages you want, click Next.

Finishing Up and Booting
Now it's time to set up your computer to use X Windows. The setup program will probe your system for information about your video card and monitor, displaying the results of its search for your approval, along with what it thinks should be the correct driver software. If all this information seems correct, then click "Test this Configuration" to make sure these settings work.

If all goes well, a dialog box will appear politely inquiring if you can see it. Assuming you can, click Yes. You'll be sent back to the X Configuration screen. If you'd like X Windows to start when you boot, offering an NT-like user name and password dialog box (instead of a text-mode login prompt), check the box next to "Use Graphical Login." Select Next to continue.

If Red Hat isn't able to determine your video settings, or if the information returned isn't correct, you'll need to select the check box next to Customize X Configuration to manually enter the settings for your graphics hardware. The report you printed with the Windows Device Manager should be helpful.

Red Hat will now advise you that it's finally ready to install and that an installation log will be created. Select Next and watch with glee as the software is copied to your hard disk. If your screen goes blank during this process, don't panic. That's the installer's screen saver kicking in. Press Shift and everything will return.

After Red Hat has placed all items where they need to be, you'll create your boot disk. Insert a blank floppy and click Next.

When the installer finishes its work, Red Hat presents a screen congratulating you on a successful installation. You're asked to remove all media from your drives and press Enter to reboot. If you booted from a CD-ROM, you'll notice a pretty obvious bug in the setup program here: Your CD-ROM drive will refuse to open until you press Enter. At any rate, eject the floppy disk (if you used one) and the CD-ROM (when you can) and let Red Hat reboot. After your computer restarts, you'll see a prompt on your screen that says LILO:. Your computer is waiting for you to tell it which operating system you'd like to use. If you do nothing or press Enter, Windows begins booting. To boot Linux, type linux and press Enter. If all is well, you'll see a lot of geeky text flow across your screen. You're not in Kansas (or Redmond!) anymore, but don't worry: This is how Linux starts up.

The screen eventually clears and presents you with a login prompt. Type root or the user name for the regular-use account you created, press Enter, type the password you chose during installation (no characters--not even asterisks--will display on the screen), and press Enter. You're now logged in to your new Linux operating system.

Going Online
Congratulations, you're a Linux user! But you still need to take care of one last configuration chore: Telling Linux how you connect to the Internet. The easiest way to do so is with a little KDE application called Kppp. (This is why we told you earlier to install KDE as well as GNOME.)

If you're not in an X session already, type startx to launch X Windows and GNOME. If this is your first time in an X session, the startup may take a few minutes as GNOME sets itself up for you.

Click the foot icon on the taskbar at the bottom of the screen, and then select KDE Menus, Internet, Kppp. When Kppp has launched, choose Setup, and when the next window appears, click the Accounts tab and select New. This pops up another window that enables you to configure your connection. Click the tab marked Dial, and enter a name for the connection (whatever you feel like calling it) and your ISP's dial-up number.

Now click the IP Setup tab. If your ISP has given you a static IP address (meaning you use the same IP address every time you connect), choose Static. If your ISP assigns you a different address for each login, select Dynamic. Now click the DNS tab and enter your ISP's domain name and domain name server addresses. You probably don't need to muck around with the Gateway, Login Script, or Accounting Information options. Click OK and go back to Kppp's main setup screen.

Your next step is to tell Kppp where your modem is located. Select the Device tab, and choose the location of your modem from the pull-down menu. Try the default setting first: /dev/modem. When you try to connect to your ISP, Kppp will let you know if it can't find the thing. If that happens, try the four /dev/ttyS settings (/dev/ttyS0 through /dev/ttyS3) in turn until you find the one that works.

You're almost done. Click OK and you'll find yourself back at the main Kppp dialog box. Enter your user name and password, and then click Connect. If all goes well, you'll establish a PPP connection with your ISP. Linux Resources

To further your adventures in Linux, we recommend you purchase a beginner's guide. There are dozens of such titles, but these two are particularly good: Linux for Dummies (IDG Books Worldwide, 1999), a straightforward introduction to Linux coauthored by John "Maddog" Hall, the executive director of Linux International; and Red Hat Linux Unleashed (Macmillan Publishing Company, 1999), a much larger and more comprehensive resource that is probably best suited to experienced computer users.

You can also get lots of help on the Web. Following are some links that should get you started.

The granddaddy of online Linux documentation is the Linux Documentation Project. Especially helpful (though not exactly written for beginners) are the well-known HOWTO documents. Josh's Linux Guide has some well-written and informative tutorials on getting started with Linux. The unofficial Red Hat Linux Users FAQ contains information specific to Red Hat that you might not find elsewhere. If you're interested in learning more about GNOME and KDE, visit the GNOME Project or the K Desktop Environment home page.

If you're thinking of using Linux at work, check out LinuxWorld magazine. Aimed at professionals, the publication includes Linux news, interviews, how-to articles, and detailed technical features.

You can also turn to Usenet for guidance. But if you want to post a question to a Linux group, go in prepared. Linux veterans are more than willing to help, but they won't respond kindly to vague questions or those that demonstrate an unwillingness to experiment and, well, hack around. Don't post a message saying, "I can't access my CD-ROM drive! Help!" Instead, explain which distribution of Linux you're running, exactly what the problem is, when it occurs, and what you've tried. Then sit back and be amazed at the amount of help you receive. The entire comp.os.linux hierarchy is good, but for starters check out comp.os.linux.setup and

If you want to find out what's going on in the Linux community, here are two great options: Slashdot and Linux Today. Slashdot bills itself as "news for nerds" and isn't restricted to Linux topics, but it often scoops most other Web sites when it comes to Linux happenings. Linux Today focuses entirely on Linux and is a good resource for links to Linux stories all over the Web.

PC World Online's Here's How department will be revisiting Linux from time to time. Let us know what you need help with by sending e-mail to with your suggestions. We also welcome your comments on this article. We regret that we cannot respond to specific troubleshooting questions.

Boost Your Penguin Power

They call it recompiling your kernel. Just think of it as a way to get the most out of Linux.
by Dan Berkes, PC World November 11, 1999

Do you want to make your Linux PC run even better than it already does? You're probably not experiencing any performance or stability problems--Linux has earned its reputation as a rock-solid OS, after all--but there's at least one Linux power-user trick you should be aware of. Recompiling your Linux kernel may sound about as fun as a root canal, but it's a relatively simple process that leaves you with a leaner, faster Linux system. How? A smaller kernel--the very nucleus of the OS--takes less time to boot, takes up less space in memory, and rids you of system components you simply don't need.

Let's get more specific: At the heart of Linux is the kernel--the core code that controls every aspect of your system, divvying up resources to programs and coordinating the flow of data to and from your computer's hardware and peripherals. Unlike the Windows kernel, Linux's kernel is completely configurable. You can add and remove support for various types of hardware, optimize the kernel for your particular processor, and more.

Linux was designed to run as easily as possible "out of the box," so most versions ship already configured for every type of hardware and every networking protocol imaginable. By tailoring your Linux kernel to your particular machine and eliminating support for devices you don't own and protocols you'll never use, you can boost Linux's performance to new levels. This process is called recompiling the kernel, because after we tell Linux exactly what we want (and what we don't), we then let it compile a new, customized kernel, converting the source code into machine language your computerFigure can understand.

For the sake of simplicity, we'll assume for this article that you're using Red Hat Linux (for instructions on installing it, see "Get Started With Linux"). But most of the kernel recompilation process is the same for all distributions (including Caldera, Debian, and Mandrake), so users running non-Red Hat flavors can benefit, too.

One warning: While recompiling the kernel isn't difficult, one wrong move can render the Linux side of your machine unbootable. Read through this entire article first, to be sure you're comfortable with the task ahead of time. If you're not, leave well enough alone; your Linux system will function fine with its default kernel. If you think you can handle it, before you do anything else, back up crucial data to removable media, and be sure you have a Linux boot disk ready in case disaster strikes (you should have created one when you installed the OS).

But if you carefully follow our instructions and pay attention to the information Linux provides--built-in help is available during the most difficult part of the process--you should pull through safely, and with a better setup to boot (pun intended). Got Boot Disk?

To start, you'll need to log on as the root user on your computer. (You assigned yourself a root user password when you installed the operating system.) And you'll need to be in a command shell to follow the steps in this article. If your copy of Linux boots up to a text console, you're ready to roll. If you boot to an X Windows session, you'll need to open a terminal window (on the default Red Hat GNOME desktop, click the button on the taskbar that looks like a computer).

If you followed the instructions in "Get Started With Linux," you created an emergency boot disk. Good for you! Should something go wrong, you'll need this floppy to resurrect your computer.

If you didn't create that disk, then make one now. To do so in Red Hat 5.x or 6.x, first type more /etc/lilo.conf on the command line and press Enter. The contents of the LInux LOader, or LILO, configuration file will scroll by, a page at a time. You're looking for a line that looks like this: image=/boot/vmlinuz-2.2.12-20

This is the path for your current Linux kernel, the one that loads whenever you start this operating system. Note the version number of the kernel (everything after "vmlinuz-")--you'll need this in a second. If you don't have a command line prompt back, hit q to stop viewing the lilo.conf file. Now type the following:

mkbootdisk --verbose --device /dev/fd0 2.212-20

Replace the version number in this command with the one you discovered in lilo.conf. Linux will ask you to insert the floppy disk and press Enter to continue. You'll have a new boot disk in a few seconds. (If any errors crop up during the creation of the disk, toss out the floppy you inserted and try again with another.) Now set this boot disk aside--you may need it later.

Getting the Packages Together
It's time to make sure you have all the required bits and bytes of code to recompile your kernel. The steps for taking inventory are different from distribution to distribution; again, our directions are specific to Red Hat. Once we get past this step, the instructions should work for most distributions.

Keeping in mind that the Linux command line is case-sensitive, start the discovery process by typing: rpm -q kernel kernel-headers kernel-ibcs kernel-pcmcia-cs kernel-source make cpp egcs dev86 glibc-devel

Whew! This command tells Linux to search for all the packages you'll need to get the job done. If they're around, Linux will report back names and version numbers:


The version numbers you see here correspond to version 6.1 of the Red Hat distribution; if you have another version, then different numbers will appear. That's no problem.

What if you don't see anything like this list after entering that awful rpm command? It could mean that, when you installed Red Hat, you didn't install any of its kernel and development packages. If that's the case, you'll see output along the lines of "package kernel-source is not installed."

Still no problem--but you have a few extra commands to issue in order to prepare. Write down the names of the files that were reported missing and insert the Red Hat installation CD-ROM (not the "contributed binaries" disc). Now issue the commands below (steps 1, 5, and 6 are unnecessary in Red Hat 6.1).

1.Mount the CD-ROM by typing: mount /mnt/cdrom
2.Change directories to /mnt/cdrom/RedHat/RPMS: cd /mnt/cdrom/RedHat/RPMS
3.To find the files you need to install, take the names reported missing by the rpm command, place ls in front of them, and trail them with an asterisk, like so: ls kernel-source* or ls make*
4.The ls command will report the full file names of the packages you need. Now install the missing packages: rpm -ivh [package name]
5.Return to root's home directory: cd
6.Lastly, unmount the CD-ROM: umount /mnt/cdrom

For detailed instructions on installing packages, check out "Installing New Apps" in our "Second Steps With Red Hat Linux" article.

After you've installed all the packages, try that long rpm command once more and make sure it reports all necessary packages present.

Only for the Very Brave: Kernel Upgrades
If you've been playing with Linux for some time, you might want to get more adventurous. In this case, try downloading the latest stable release of the kernel from the Linux Kernel Archives. Why? Newer kernels have new features, support new types of hardware, fix bugs, and so on.

After downloading a new kernel source, move your current kernel source out of harm's way: Change directories to /usr/src (cd /usr/src ), and shuffle the current kernel to the side by typing mv linux linux_backup. This renames the Linux directory as linux_backup. Place the kernel file you download in the /usr/src directory before continuing. To unpack that file, type tar zxvf filename.tar.gz, substituting the correct file name for your download. A massive amount of text will scroll across your screen--this means the files are placing themselves where they ought to go.

Configuration Time
Once all the necessary files are in place, you get to the fun part: Configuring your kernel. (All right, it's not exactly fun as in Friday-night, ha-ha-ha, but if you're geeky enough to install Linux in the first place, you probably enjoy tinkering.) You'll have a choice between two interfaces at this juncture. Before you try either, make sure that your working directory is /usr/src/linux; entering cd /usr/src/linux will do the trick.

Make menuconfig works from any command line, letting you make changes using the arrow and Tab keys. Make xconfig works within X Windows, offering a more user-friendly, clickable menu. We'll walk you through the latter, but our advice works for the first option as well--you'll just be dealing with a different interface.

Start by typing make xconfig and pressing Enter. Some gobbledygook will flow across the terminal window, and then a new window will pop up, full of buttons. Each button leads to a new dialog box that lets you configure a particular part of the kernel. The second button, for instance, labeled "Processor type and features," lets you specify which type of processor your machine has.

In each new dialog box, you can turn kernel features on (select the "y" option for "yes") or off ("n" for "no"), or you can elect to compile that particular feature as a module (the "m" option). Modules are components that can be grafted onto the kernel on the fly but aren't an integral part of it. You'll notice as you wander through the dialog boxes that many features are compiled as modules by default.

To begin, tell Linux what sort of processor you have. Click "Processor type and features"; to the left of "Processor family," click the drop-down menu and select the appropriate chip. Is your computer a Pentium or better? If yes, select "n" next to "Math emulation"--your chip has a built-in math coprocessor, so there's no need for Linux to emulate one. Peruse the other options in this dialog box before choosing "Main Menu" to close it.

From the main menu, you can explore other feature groups by clicking their buttons and perusing their listings. Unsure what a particular feature is all about? Hit the Help button for a full account of each feature's goal in life, often with a recommendation as to whether you need it. Explore these help dialog boxes. If you don't understand a particular feature even after reading about it, leave it be, no matter what its setting. And if at any point you feel you've screwed things up beyond repair, make your way back to the main menu and quit without saving your changes. Then start from scratch with another make xconfig.

Need a push in the right direction? You can probably live without some feature sets. To eliminate them from your system, click the appropriate category (you'll choose from those listed below) and select "n" for the first option listed in the resulting dialog box:

SCSI support: Provides support for computer accessories connected via the Small Computer System Interface. IrDA subsystem support: Enables you to exchange data with other machines via infrared beam.

ISDN subsystem: Lets Linux talk to Integrated Services Digital Network adapters. Old CD-ROM drivers (not SCSI, not IDE): Support for CD-ROM devices that are particularly ancient.

Video for Linux: Supports motion picture creation and editing devices.

Ftape, the floppy tape device driver: Enhances tape drives connected to floppy controllers.

When you think you've got your new kernel ready to go, click "Save and Exit" from the main menu. The configuring's done: Now it's time to build the new kernel.

Hurry Up and Wait
Now that you've specified how you want to customize the kernel, you need to make sure it will compile properly. First, issue the make dep command to be sure all the source code files you need are in place. Once this command has run (a few minutes at the most), enter make clean to remove any extraneous files that you won't need to compile your new kernel.

You're finally ready to start compiling. Shut down all programs and, back at your command line, take a deep breath and enter make bzImage. Now go fix yourself a snack: This process will take anywhere from 10 to 30 minutes (more in extreme cases), depending on the speed of your machine.

When the command line returns, make sure the terminal isn't reporting an error of some sort: If it is, you don't have a new kernel waiting for you. Either a necessary package is not installed, or you made a mistake during configuration (like enabling a feature without enabling another feature it depends on--such relationships are always detailed in Help). Sorry to say it, but you have to start over at this point.

If there are no error messages, it's now time to compile and install the modules you requested during kernel configuration. Begin with make modules. This is another lengthy process, so go have yourself another snack. When the command line returns, enter make modules_install. This last command should finish in a matter of seconds.

The Moment of Truth
Pat yourself on the back: You're almost ready to boot with your new kernel for the very first time. First you need to copy your new kernel to the Linux boot directory. Enter the following command:

cp arch/i386/boot/bzImage /boot/vmlinuz-mykernel

Now, with your new kernel in place, you need to let LILO know it's there. To do so, you have to alter a configuration file with a text editor. The commands given here are for the pico text editor; if you're familiar with another editor, go ahead and use it.

Enter pico /etc/lilo.conf to launch pico with the correct file. You're once again looking for the "image=" line that we first mentioned in the boot disk creation section. It looks something like:


Jot down this line's current form before you make any changes. Now replace that file name with /boot/vmlinuz-mykernel. Press Ctrl-X, followed by Y and Enter to save your work. When you're back at the command line, type lilo and press Enter. Now enter reboot to restart the computer.

When the LILO: prompt appears, enter the text you normally do to boot Linux (usually linux or just plain Enter). Here's where your work pays off--or you return to the drawing board.

Scenario 1: Trouble
If the stars are aligned against you, your new kernel will fail, often with a "Kernel Panic" error message. Don't worry--your computer is fine, and you have a boot disk to get you out of this. Boot with that disk, get yourself back to a command shell, enter pico /etc/lilo.conf and change the "image=" line back to its original form. Save your changes, and then just as before, issue the lilo command, followed by reboot. Your old kernel will boot when you choose Linux at the LILO: prompt.

What went wrong? It's hard to say. Perhaps you failed to enable support for an essential piece of hardware, or you misconfigured a certain option. To fix the problem, you need to reconfigure and recompile the kernel again by following the steps we've gone through--not exactly a quick fix, but after you get used to the process, you probably won't make those sorts of mistakes. Try making your changes one at a time to isolate the problem. It may take a little longer, but it could save you frustration in the long run.

Scenario 2: Success!
If the stars are with you, this arduous troubleshooting won't be necessary, and your new kernel will boot. With some versions of Red Hat, you'll need to run the sound configuration program again to get sound up and running (see the "Let There Be Sound" section of "Second Steps With Red Hat Linux"). If you find after booting that a certain piece of hardware isn't working, check to see if you accidentally disabled it in the kernel by issuing a make xconfig command and checking the configuration. If that's the problem, reenable the hardware and recompile the kernel.

Dan Berkes is a freelance writer based in Galena, Illinois, where he runs a small Web hosting business.

Second Steps With Red Hat Linux

Sound, security, software installations, and more
by Dan Berkes, PC World September 1, 1999

You installed Linux on your PC and emerged with your sanity--and system--intact. Now you're probably wondering just what the heck you've gotten yourself into. The various breeds of Linux become friendlier with every release, but they still snarl occasionally. In this article, we'll help you solve some of the problems that typically show up after a Red Hat Linux installation.

This article assumes that you followed our previous feature on Getting Started With Linux, in which we helped you get Red Hat Linux 6.0 installed on your Windows machine, though users with other distributions may benefit from some of our advice, too.

Since you'll be making changes to your system configuration, you need to log on as the root user on your computer. (You assigned the root user a password when you installed the operating system.) All commands referenced in this article need to be entered in a command shell. If you're looking at a text console, you're ready to roll. If you're in an X Windows session, you'll need to open a terminal window first (on the default Red Hat GNOME desktop, click the button on the taskbar that looks like a computer).

Let There Be Sound
If your computer's been giving you the silent treatment since you installed Linux, fear not: The Red Hat installation process simply lacks sound card setup. Red Hat does, however, support most brand-name sound cards, as well as the majority of cards used by major computer manufacturers. Unfortunately, this doesn't mean that sound will necessarily work for your computer, even if your card happens to be included on the Red Hat Linux Hardware Compatibility List.

If you can't locate your sound card on the Red Hat list, the chances of getting audio running on your computer run somewhere between slim and none--unless you happen to be a Linux guru (or know one that you can ply with beer and taquitos). My suggestion: Upgrade your sound card to something Red Hat can live with, which can be done for less than $50, or learn to accept Linux as a silent yet powerful operating system.

Before you begin the configuration process, boot up Windows. Then right-click My Computer and choose Properties from the pop-up menu. Select the Device Manager tab from the dialog box that appears. Click the Properties button at the bottom of this window. You'll be looking at the Computer Properties dialog box, which contains information you may need to get sound working in Linux. Scroll until you find your sound card listed and jot down the value that appears in the Settings column--that's the IRQ setting your sound card uses. Now, click the Input/Output radio button to see the I/O setting for your card, and write it down. Lastly, click the Direct Memory Access button, find your card one last time, and note the card's DMA setting.

Exit Windows and boot up Linux. Log on as the root user. From a terminal window or text console, type sndconfig at the prompt and then press Enter. Press Enter again to move past the splash screen.

Sndconfig will probe your system for a sound card. If it's on Red Hat's list of supported cards, this utility should find it and display the results of its search. Write down the name of your card as it appears here--you may need this information later if sndconfig can't handle automatic hardware configuration.

Next, Red Hat will attempt to test your sound card using the most common settings. The first test evaluates general sound support (you should hear a message from Linux's creator, Linus Torvalds); the second confirms MIDI support (you'll hear a short, synthesized tune). Select Yes after each test to acknowledge that you heard the samples.

If you heard nothing at all, select No and relax: You haven't hit a dead-end yet. After you select No, sndconfig offers a manual configuration interface. Select your sound card from the list to continue. Here comes the frustrating part: Find the settings you jotted down from Windows, and enter them in the setup screen. Use the Tab key to move between selections, enter the information from your notes in the appropriate spaces, and select OK when you're finished. Sndconfig will repeat the tests.

It may take a few tries to fine-tune your settings. Don't be surprised if your computer crashes during the configuration process: Sometimes resources will conflict and bring everything to a screeching halt (thankfully, a very rare event under Linux). Remembering that this might be the last lock-up you ever experience, clench your teeth, reboot, and run Sndconfig once more.

If you still can't get your sound card to work with Linux, fire up your Web browser and search for help. Your first stop should be Red Hat's comprehensive support site. If you purchased your copy of Linux directly from Red Hat, you can sign up for Installation Technical Support here; if not, you can still peruse all sorts of helpful information. If you stump the Red Hat gurus, check out the Sound HowTo at the Linux Documentation Project. As a last resort, try searching the Usenet archives at for further assistance.

Keep Your Box Secure
Now that your sound card (hopefully) works, let's address security needs. Unlike a certain operating system out of Redmond, Washington, Linux offers a remarkably stable and secure platform. Unfortunately, any computer connected to the Internet will--at some point--attract trespassers. And a standard Red Hat installation provides online thugs with plenty of ways to hack into your system.

Red Hat Linux opens several "services" on startup--programs that run in the background and can interact with other computers on a local area network or over an Internet connection. Some of these may be accessible to strangers on the Internet. In other words, you've got a security hole to fix. Denying access to all computers on the Internet makes it easy for the Linux novice to maintain a reasonable level of security.

From a terminal window or text console, type cd /etc to change directories.

You'll need to open the file hosts.allow with one of the many text editors preinstalled with Linux. Which editor reigns supreme has been the subject of many a holy war in geek circles, though most beginners prefer Pico for its ease of use. To open your hosts.allow file in Pico, type pico hosts.allow and press Enter. Pico will launch and load the contents of hosts.allow.

On a blank line (following the four or five lines that begin with #), type:

ALL: 127.

(Note: Capitalization and the trailing period are essential.)

Press Ctrl-X, then Y, and then Enter to save your changes and exit the program.

Next, edit the hosts.deny file to keep the interlopers at bay. Type pico hosts.deny and press Enter. On a new line, beneath the lines that begin with #, type the following:


Save your changes and exit (as described above).

These changes should thwart your run-of-the-mill hacker, but keep in mind that any device connected to the Internet can be accessed by a sufficiently resourceful person at the other end of the connection. But don't yank the phone line out of the wall and cancel your Internet account: Learn about additional security measures by checking out the Linux Security HowTo available at the Linux Documentation Project.

A Whole New Desktop
Unless you've made drastic changes to your system, you're probably still using GNOME, Red Hat's default desktop environment. GNOME offers some nice features, but the beauty of X Windows (and Linux) lies in the fact that you can give your desktop just about any look you want. Quite a number of upstart desktop environments exist for Linux. The K Desktop Environment, or KDE, is generating a lot of buzz at the moment. In the not-so-distant past, changing desktop environments and window managers involved mucking about with configuration files. In its typical user-friendly way, Red Hat automates this process. Open a terminal window under X (click the computer icon on the GNOME taskbar) and type switchdesk.

A menu listing all installed managers and environments will appear. Select the one you'd like to use and click OK. For the changes to take effect, you'll need to log out and log back on. Experiment and enjoy. Note: Because Switchdesk changes the environment for the current user only, you should log on and repeat this process for each user account you wish to change on your system.

Installing New Apps
Your Red Hat 6.0 distribution probably came bundled with a second CD-ROM of "contributed binaries"--free applications that enhance your Linux system. These programs, archived in Red Hat Package Manager format, prove much easier for Linux newbies to install than programs distributed as source code (which must be compiled into machine language first).

To see how RPM works, let's use it to install ircII, a powerful Internet Relay Chat client that's popular with Linux and UNIX users. First, hie thee to a terminal window or text console, and be sure you're logged on as the root user.

Insert the contributed binaries CD-ROM into the drive, and type mount /mnt/cdrom followed by cd /mnt/cdrom to navigate to the disc.

You need to find out the file name of the archive you want to install. RPM archives frequently have very long names that include both the title and version number of the program they contain. Use the ls command along with the target program's name to find the package you want to install. In this case, we enter ls *ircii*--this returns a list of all files that contain the fragment ircii in their title. Now we turn around and feed that file name to RPM by typing:

rpm -ivh ircii-4.4H-1.i386.rpm

You'll get your prompt back after RPM has installed the package. Now you can simply type irc at any prompt (as any user) to launch this program.

Stabilize Netscape
Netscape Communicator may be the lone modern browser for Linux, but its postinstallation behavior leaves a lot to be desired--especially under Red Hat 6.0. Because Communicator references a font setting that Red Hat 6.0 doesn't supply, the browser crashes when it hits Java and other types of applications that contain the missing fonts.

One quick and painless fix will ease your online woes. Log in as the root user, and from a terminal window or text console, enter the following:

chkfontpath --add /usr/X11R6/lib/X11/fonts/75dpi

You should be able to surf with fewer crashes after making this change.

Feeling like a fledgling Linux guru? Good! Explore, ask questions (see our list of Linux Resources for some pointers on asking for help on Usenet), and, above all, resist the temptation to kick your computer when it seems to take on a mind of its own. You've landed in an OS world unlike any you've seen before, so it's only natural to feel befuddled from time to time. But you'll be a pro soon--sooner than you think.

If you have ideas for Linux topics we can cover in the future on PC World Online, drop us a line at Tell us where you're stuck and how we can help you.

Miscellany Page
Buying a Printer

Cleaning Printer Printheads
The Essential Bits and the Less Essential Bits
How It works
Windows 3.11 for Workgroups, Windows 95, Windows 98, Windows 2000 and Linux
Installing Red Hat 6.1 Linux
Nickel Cadmium Batteries


-- Thank you for visiting Wilf's Linux Page. --

Please send your comments to: Wilf James