Are you the kind of person who can't toss out old gear? I know I am--though I must admit that embracing the art of junk-collecting has come in handy from time to time. For instance, this article will show you how to resurrect a tired old PC by installing a modern operating system, and then revitalize the computer as an internet-enabled CD player, DVD burner, and MP3 jukebox.

I have the perfect test subject sitting in my scrap heap: an HP Pavilion. It was a decent PC in its day: 350MHz Pentium II processor, 128MB RAM, 3GB hard disk, and a DVD drive. I'll assume you're in the same boat.

The secret sauce we'll use to revitalize our elderly PC is Linux, the free operating system based on UNIX. Linux is available in more than 300 varieties ("distributions"), enjoys plenty of online support from around the world, and comes with a truckload of applications, including free CD/DVD players and recorders. (Did I mention "free?")

Several Linux distributions will run fine on a resource-constrained PC. Slackware is a popular option. The flavor I recommend for this project is Knoppix. (See the system requirements sidebar.)

Knoppix has several features that make it ideal for an introduction to Linux. From its website:

Knoppix is a bootable CD with a collection of GNU/Linux software, automatic hardware detection, and support for many graphics cards, sound cards, SCSI and USB devices, and other peripherals. Knoppix can be used as a Linux demo, educational CD, rescue system, or adapted and used as a platform for commercial software product demos. It is not necessary to install anything on a hard disk. Due to on-the-fly decompression, the CD can have up to 2GB of executable software installed on it.

Knoppix System Requirements

In other words, you can try the operating system risk-free. If you decide you like it, you can then install it to your hard drive. I'll explain how later in the article.

Knoppix is a Debian-based distribution of Linux. Some of the relevant software on the Knoppix CD includes:

To be fair, the vast majority of Linux distributions come packaged with many applications like these--or exactly these. However, Knoppix will get you going fast on your old computer. And as mentioned, you can boot Knoppix and run the entire application suite from the CD.

Getting and Trying Knoppix

With a fast internet connection, Knoppix is only a few clicks away. From the Knoppix main site, click on the Download button and choose a download site close to home. (Alternatively, you can order the CD via mail; click the Order button.) You must accept the Knoppix download agreement, so read carefully.

If you accept the terms, you'll be presented with a list of files. Download just one: the ISO file in your language. For instance, if your primary language is English, download:

KNOPPIX_V3.7-2004-12-08-EN.iso

(I made the screenshots in this article with the previous version, 3.6, but the instructions that follow are the same.)

The ISO file is a disc image, which means it's a complete copy of a CD. (Unlike some other Linux distributions, Knoppix fits on a single CD.) This site has a list of programs, many of them free, that can burn a bootable data CD from an ISO image. Make sure you finalize (close) the CD.

After creating your Knoppix CD, insert it into your old PC and power it on. Make sure that you have set the boot order in your BIOS to boot from the CD/DVD drive before the hard disk. (To access the BIOS, you generally have to shut down the computer and then restart while pressing the Delete key, but some PCs use other key combinations.) If your PC cannot boot from a CD, create a boot floppy for the initial boot. See the "My First Linux" sidebar for background.

My First Linux

by David Battino

When Brad's article came in, I figured it was a great excuse to try Linux. (I normally divide my computing time between Mac OS X and Windows XP.) The first download link I tried ran so slowly that I calculated it would take 40 hours to download the ISO disc-image file, so I punted. The second link, from the University of Florida, delivered the 699MB file over my DSL connection in about 90 minutes.

Since I was on a Mac at the time, I double-clicked the downloaded ISO file, which opened to display a bunch of Linux and HTML files. I then dragged those to Roxio Toast and burned an ISO9660-format CD on an 80-minute blank. So far, so good.

The next challenge was that the ancient computer I had planned to Linuxify, a Toshiba Satellite Pro 430CDT, can boot only from a hard drive or a floppy, not from a CD. (This phonebook-size laptop has a 120MHz Pentium processor, 48MB of RAM, and an 800-by-600-pixel screen.) After examining the options in the Knoppix.net Downloading FAQ, I downloaded Smart Boot Manager, a program that interrupts the normal boot process and lets you specify a different boot device. There are several versions; I downloaded sbminst.exe, a DOS program that installs Smart Boot Manager to a floppy disk.

With the floppy and the CD in their respective drives, I restarted the computer. Smart Boot Manager displayed a screen with a number of boot-device choices. I selected "CD-ROM," but Smart Boot Manager said the disc was corrupt. So I went back to the Mac, burned the ISO file to another CD without decompressing it first, copied that file to my XP machine, downloaded a freeware program that burns ISO images to CDs, and tried again.

This time the Toshiba laptop booted Knoppix. The program asked me if I wanted to create a swap file to compensate for the PC's meager RAM, and I agreed, picking a size of 90MB. The only other tweak I had to make was to adjust the screen resolution, which Knoppix misdetected as 1024 by 768. Nineteen minutes later (!), I was viewing the KDE desktop interface, which looked far better than Windows 95. In fact, I was struck by how much it resembled OS X, although that makes sense, given OS X's UNIX underpinnings.

Several of the programs on the Knoppix CD ran too slowly to be of use, and the system was constantly accessing the CD, which made for a choppy computing experience. When I get a chance, I'll install Linux on the hard drive and see what effect that has on the performance. I may try running without KDE, as well. Ironically, given this article's focus, Knoppix didn't detect the laptop's audio circuitry, so there was no sound. I imagine I'll find that switch eventually, but so far, my family has used this resurrected PC mostly to play simple games, so the absence of repetitive audio soundtracks is a bonus. And when I tried the Knoppix CD on a 600MHz Pentium III computer, it ran snappily.

During bootup, you'll be presented with text from the Knoppix boot procedure. It'll look something like Figure 1. Knoppix will boot into the KDE desktop manager (Figure 2). KDE will be a familiar landscape to Windows and Mac users. Knoppix conveniently offers a taskbar on the bottom of the screen; you can access a menu of applications by clicking the big "K" icon on the far left of the bar.

Figure 1 Figure 1. Knoppix boots from CD
Figure 2: The KDE Desktop Figure 2. The KDE Desktop (click to enlarge.)

Take it for a test drive. There are many applications to audition: office productivity, graphics, audio, and video apps; games; and more. Be patient; Knoppix will be retrieving and decompressing the applications from CD, so some can be sluggish to initiate. If Knoppix is not to your liking, or simply doesn't work on your hardware, no harm done. Just remove the CD and you're back to your old PC.

Installing Knoppix on Your Hard Drive

If you've read this far, perhaps you've decided that running Knoppix on that old PC is a good thing. To make it useful, you should install it to your hard drive. Luckily, the complete installation takes just 3GB. Sound like a lot of space? Well, that's the Linux operating system plus more than 900 applications!

There are a couple of ways to install Knoppix on a hard drive. We'll go through a popular one. See the Appendix for links to others.

You'll need enough room to create two partitions: one to house your complete Knoppix distribution and one to house your swap file, or virtual RAM. It's generally recommended that you create a swap partition the same size as your RAM, but I've seen recommendations for a minimum of 256MB. You'll have to make your own decision here, as your mileage may vary. Fortunately, you can partition your hard drive during the installation process, so let's wait for that stage.

After you have booted Knoppix from CD, run a "Root Shell" from the Knoppix menu--the Penguin icon on the bottom panel (see Figure 3).

Figure 3 Figure 3. Access the Root Shell from the Penguin menu

From the root shell, you can run the installer script provided with Knoppix. Type the following in the Root Shell and then press Enter (see Figure 4):

knoppix-installer  
Figure 4 Figure 4. Launching the installer

The Knoppix-installer program will initiate and present a dialog box (Figure 5) saying that you are about to install Knoppix to your hard drive.

Figure 5. Next stop: hard-disk installation

After clicking the OK button, you will see the Knoppix Installation main menu (Figure 6).

Figure 6. Before starting installation, it's a good idea to partition the hard disk, so scroll down to item 3

If Knoppix cannot detect your hard drive, it may present a dialog box saying that the installation requirements have not been fulfilled. Click OK and you'll be taken to the Knoppix Installation menu. (This menu may contain only two selections, but that's okay; we're going to partition the hard drive first. After partitioning, you should have the full menu.)

Hey, Bud, Let's Partition

Select the Partition menu item. Knoppix will load the partitioning application, qtparted (Figure 7). Now select the drive you want to format; most likely this will be /dev/hda (hard drive A). Once it's selected, qtparted will determine the format of the hard drive and present its findings in the right window. (If you have a problem, you may need to run fdisk to remove the current partitions, and then reboot. See the Appendix.)

Figure 7 Figure 7. Setting up a small partition for the swap file

You may have existing partitions, but I suggest that you start from scratch and delete them all. Note that this will destroy all data. But, hey, it's an old PC! To delete an existing partition, right-click on its name and select Delete from the pop-up menu. If qtparted complains that your hard drive is mounted or that it cannot delete the partition, you can use fdisk to remove the partitions. See the Appendix.

After deleting all partitions, you should have one partition the size of your drive, labeled "01." (It's not actually a partition yet; you've just deleted them all.) Right-click this item and select Create from the pop-up menu. Create a partition that is the size of your entire hard drive minus the size you want to reserve for your swap partition. (Remember that the swap size should be at least as large as your RAM size.) Select "ext3" for the Partition Type and make sure that it is a Primary Partition. You can label this partition "\" (without the quotes). Click OK. That should create a partition the size you specified--and a cute Tux penguin will now appear in the number column.

Now right-click the last partition (number "02") and select Create from the pop-up menu. This is your swap partition, so select "linux-swap" for the Partition Type. Leave the "Percent of unallocated space" at 100. You can label this partition "swap." Click OK.

To commit this setting, select Commit from the Device menu. The qtparted program will now create the partitions you configured and format the hard drive. Click OK and quit the program.

Install--Dark and Handsome

After partitioning is complete, return to the Knoppix Installation dialog and select menu item 2, "Start installation."

You will be presented with three options: "beginner," "knoppix," and "debian." Choose "beginner" and click Next. Now choose the partition you would like to install to--most likely this will be /dev/hda1. (Do not install to your swap partition.)

The subsequent dialog boxes should be self-explanatory, except for the following:

You will be presented with a list of your selections before committing. If you would like to change anything, click the Previous button and change the item. Otherwise, click Next.

Installation of Knoppix to the hard disk will now commence. When it's complete, select Logout from the KDE menu, and then select Restart Computer. Knoppix will restart the computer and notify you when to remove the CD. During the boot process, you might take a glance at the text and watch Linux boot from the hard disk. Note the line "Running from HD, checking filesystems..." on your monitor. It should look similar to Figure 8.

Figure 8. Booting After Installation Figure 8. The post-installation reboot (click to enlarge.)

After rebooting from the hard disk, you will be asked for your username and password. Then you will see the familiar KDE desktop; it won't look too much different than it did when you were booting from the CD. It's important to note that once Knoppix is installed on your hard disk, it's no longer a compressed Knoppix installation. You now have an uncompressed Debian GNU/Linux system.

Configuring Linux

There are a few more items to configure to bring your Linux installation to a usable system.

Network: Knoppix may have enabled your network card automatically. Try starting the Mozilla web browser found in the Internet menu or click the Mozilla icon in the bottom panel (it looks like a red dinosaur; newer versions of Knoppix substitute Firefox for this browser). If you can reach the Web, you can skip ahead to the next section. Otherwise, read on.

Knoppix has a nice little script to configure your network card quickly. The following assumes that you have an Ethernet card installed in your PC and are either connected directly to the internet through a modem or connected to a home network. If, for instance, you have a wireless card or you connect directly to your modem via PPP, there are other utility applications to configure your hardware. See the menu items under KNOPPIX -> Network/Internet. For network cards without Linux drivers, you can use the ndiswrapper. This utility takes the Windows drivers (found on the Wi-Fi card's CD or downloaded) and wraps Linux code around them to make them work in Linux.

To configure your network card automatically, go to the KNOPPIX menu and select the Network/Internet -> "Network card configuration" item. That will initiate the network configuration script and ask for your root password (which you gave when you installed Knoppix onto the hard disk).

If you have a DHCP server running on your network or your ISP is DHCP-based, select Yes from the dialog box (Figure 9) and wait to see if the script will configure your network card automatically. If it does, skip to the next section.

 Figure 9. Getting networked

If you do not have DHCP or your network card was not automatically configured, start the "Network card configuration" script (if it's not already started) and select No when asked to use DHCP. Now enter your PC's IP address, the Network Mask (which will probably be 255.255.255.0), your Broadcast address, your Gateway address, and your nameserver(s). Except for your Broadcast address, you should know these if you have built your own network--or they will be supplied by your ISP. The Broadcast address is an address with the host portion set to all 1s. So, for a 192.168.0 network (say your PC's IP address is 192.168.0.10), your broadcast address would be 192.168.0.255.

Now try the Mozilla web browser again. If you can reach the Web, you can move on to the next section. If not, try the script again to see if you missed anything.

Updating Your System

Before we move on, you may want to update your system. Debian systems provide an easy-to-use application called apt-get that will update your installation from the internet. (Those without an internet connection can move on to "Using Linux.") Your first update may take quite a while to finish, so you may want to come back to this step later. If you keep your system up to date, future updates will take less time.

To update your distribution from the internet, start a Root Shell (refer back to Figure 3) and enter the following command at the prompt:

apt-get update 

That will update your database of applications. Now you can update the applications themselves by entering the following command:

apt-get dist-upgrade 

Always make sure that you run apt-get update first so the database can be refreshed accordingly.

Using Linux

Now it's time to explore! With Knoppix installed on your hard drive, you now have the ability to burn and copy CDs and DVDs, connect to the internet, send and receive email, edit documents, create spreadsheets, and run over 900 other applications. The following paragraphs give an overview of the multimedia applications found in your distribution. You can find them all in KDE's Multimedia menu. If you get stuck, look in the associated manuals or see the Appendix for helpful links.

KsCD: KsCD is a small but a useful CDDB-enabled CD player and a great way to see if audio is working on your PC. See this introductory article.

Figure 10 Figure 10. Adjusting the sound

KMix: Don't hear any audio? Make sure the faders are set correctly in KMix. Look for the speaker in the bottom right panel (Figure 10). If it's there, KMix is already started. Click on it to change your volume settings. If it's not there, open the app in the Multimedia section.

K3b: K3b is a CD- and DVD-burning application that is bundled with many Linux distributions. It's a graphic interface to command-line utilities that come with Linux, namely cdrecord, cdrdao, and growisofs. The authors have made K3b very easy to use for beginners while also including advanced features for power users. If you don't know what a setting does, just leave it alone--K3b will take care of it for you.

K3b should be ready to go out of the box, but there's a configuration application you can use if you find that you cannot run K3b. It's in the KDE menu at System -> K3bSetup. For further information, see the K3b website.

I highly recommend reading the K3b handbook. If nothing else, follow the Quickguide four-step process for burning a CD and the one for burning a DVD. You can access the handbook from the Help menu.

XMMS: If you've used Winamp, you'll be right at home with XMMS, which can play MP3s, MOD files, and many other formats via plugins. It's a very popular app with plenty of skins. For more information, see the XMMS website.

Handy Links

Knoppix

Applications

Linux

Knop, Knop, Knoppix on Heaven's Door

There you have it--a completely revitalized, fully functioning PC running a bulletproof operating system. And you thought your PC had seen its better days! This PC also makes a wonderful gift for those who are computer-averse or fighting viruses on more popular operating systems. It's easy to use with the user-friendly KDE environment and packed with practical, straightforward applications for the whole family. If you'd like to do more with Linux audio, stay tuned for further installments in this series.

Appendix

Partitioning Your Hard Drive: Knoppix comes with a text-mode application called fdisk to partition hard drive. You must run fdisk as the root user. (Use the Root Shell; e.g., fdisk /dev/hda.) Generally, you'll want to have fdisk partition your drive in at least one partition for Linux and applications and one swap partition. The hard disk must be unmounted first. This is easy to do in Knoppix, because if partitions are found at boot time, Knoppix will present them on the desktop. Right-click each partition on the desktop and choose "unmount" from the pop-up menu. Now you can start fdisk in a Root Shell and delete partitions and create new ones. Type "m" for a list of fdisk commands. To learn more about fdisk, see this site.

Setting up Knoppix in a Windows Network: Knoppix has yet another nice application to allow you to put your Knoppix PC on your Windows network. Called LinNeighborhood, it lives in the KDE Internet -> More Programs submenu. Cedric Shock and Susan Sullivan have written a wonderful tutorial on using it.

Potential Errors: Don't you hate it when you follow a how-to article and the article mentions nothing of the problems you've encountered? To be fair, no one can anticipate all of the problems--there are just too many combinations of hardware and software. Fortunately, the Linux community is very helpful. Here are a few popular support sites:


Return to digitalmedia.oreilly.com