...making Linux just a little more fun!
By Tom Brown
Before I begin, I want to warn you. I'm a very opinionated person. I expect things to work well. I expect computers to work my way, not the other way 'round. When I get new software, I expect to be able to put the manual in a drawer, then use the software's basic functionality with few hassles. I'm also a control freak, which is why I like C/C++ over something like Visual Basic. Ease of use gets you only so far. As I said, I expect things to work well, which is why I decided to give Linux a try.
I've programmed on a lot of different operating systems in the last 20 years, starting with the venerable Commodore 64 in the early 80's. In that time, I've discovered that, despite the venting of various zealots, each operating system has its appropriate place in the digital universe. Amigas focused on multimedia (TV shows like Babylon 5 and Seaquest used it to generate 3d scenes), Macs focus on the printed page (most ad agencies and print shops depend on it), and Windows focuses on taking over the world (sorry, cheap shot). Diversity is a good thing.
My introduction (!) to the world of Unix came quite a while ago, when my boss gave me a month to benchmark the same database on SCO, HP/UX, and Solaris (sort of a "let's see if he can breathe underwater" exercise). I liked the flexibility and stability of Unix, but wondered what joker came up with the cryptic commands (ls to read a directory? Rename a file by moving it? Huh?). My favorite was the somewhat recursive SCO user manual of the time, where you had to know what a command did before you could look it up to see what it did.
It wasn't until Mandrake 8.2 came along that I seriously considered using Linux. Having experienced Unix through remote terminal connections, I didn't expect too many surprises. Ha! I'd like to share with you my introduction to Linux from my own rather unique perspective.
The target machine for the installation was a 2.53GHZ Pentium 4, with 512MB of memory, two 80GB IDE hard drives set in a Raid 0 configuration (which means that a file is written by sending sectors to alternating drives, giving you faster reads and writes) using a Promise Raid controller built into the Intel motherboard, and a standard 60GB IDE drive. I wanted to put Linux on the Raid drive, but ran into my first problem. The installer didn't recognize the Promise controller. Instead, it saw the two Raid drives as separate volumes. That's where I had my XP installation at the time, so I absolutely wasn't going to risk mucking it up. I decided to use the non-Raid IDE drive for Linux.
The voice of experience: Before you start a Linux installation, have a list ready of the hardware in your machine, including brand names and model numbers. If you already have Windows on the machine, this info is easy to get. Mandrake is pretty good these days auto-detecting hardware, but there's always that one last bit it fails to identify. If the installer doesn't recognize your monitor, you may have to enter its max resolution by hand, so keep the monitor manual handy.
Mandrake, as with the latest Red Hat distro, supplies a wizard to walk you through the installation process. Once you know where you want to put things, it's smooth sailing. You can use the installer to partition your hard drive, but I recommend having a copy of Partition Magic handy to divvy the drive up beforehand. That lets you resize an existing partition without wiping out existing data. It comes in handy if you need to tweak things later.
Another tip: Don't accept the default installation packages. Make sure you have enough disk space, and install everything. It's easier to do it now than later. If you think you'll never need the programming packages and kernel source, for example, you'd be surprised!
Many how-to books give you a simple method to boot a Linux partition from Windows, and this generally works.
Except in my case. Booting Windows with the Raid volume as the first drive meant that the Linux partition was on the second drive. But when Linux was installed, it thought it was on the first drive. It was trying to boot "hdb1" as "hda1". Hmmm. You can't get there from here. Of course, since Linux didn't recognize my Raid controller, it couldn't boot Windows. It seems you can't get here from there, either. I ended up setting Linux to boot Windows using an invalid drive spec. This fails, of course, but when it does, you simply hit a key, and Windows starts up. Say what? This only works if you have only one regular IDE drive. If you have a second, the boot-up fails, because it tries to boot the second IDE drive instead of the Raid volume. The real solution, of course, is to move Windows off the Raid volume. I think I'll leave that to my yearly Windows reinstall (What? You don't reinstall Windows every year? Didn't you get Bill's memo?).
Sometimes, I can be really stupid. I can't leave well enough alone. A few weeks after the successful install, with everything working fine, I decided to upgrade the computer's memory from 512MB to 1GB. I burn some home movies to DVD, and keep my CD audio collection on the computer, so the extra memory would come in handy.
Only, Mandrake won't boot with the extra 512MB! The scroll lock and caps lock LED's on the keyboard started flashing, but nothing appeared on the screen. For those of you in the Windows world, this flashing indicates what is called a "kernel panic". This is just what it sounds like. The Linux kernel (the core logic of the OS) gets to a point where it doesn't know what to do next, and it freaks out. One web site suggested I reduce the amount of memory used by Linux. It worked, for Mandrake 8.2. But not, as it turned out later, when I upgraded to Mandrake 9.0!
You know that part in the Wizard of Oz, where Dorothy starts down the Yellow Brick Road, and it's going in tiny circles? That was me. As much as I really wanted to use Mandrake, I wasn't about to give up on the extra memory. So, I wiped Mandrake from the computer, and started all over with Red Hat 8. Other than a different look to the wizard, it was Deja Vu All Over Again. Same Pew, Different Church. You get the picture. Red Hat installed easily, and it was finally time to get to know Linux. I promised myself I wouldn't change anything else (for a while).
In Windows, each user has an entry in the Documents and Settings directory on the "C" drive. The Linux equivalent is the user's "home" directory, which bears the user's login name, and is located in the path "/home" (reminder: Linux separates directories with a slash, not a backslash as in Windows and DOS). Everything in there defaults to being private to that particular user. A user can structure their "home" directory any way they want, and their changes don't affect anyone else. Once you leave "/home", however, Linux directories can be confusing to a Windows user.
Here's a short list of the important Linux directories, and what goes in them:
/home: This contains all the user directories in the system, except for root.
/root: This is root's home directory. Never login as root (the Linux equivalent of the Administrator in Windows)! Always login as yourself and use the "su" command to give yourself root privileges for specific commands. The reason is that programs and scripts can do a lot of damage when run as root. The damage can be due to a hostile program, or just your own (ahem!) stupidity (been there, done that, got the t-shirt).
/bin: Programs and scripts essential to boot and/or repair the system. Some of these are used by other programs.
/sbin: Programs and scripts used by system itself, and by users to administer the system.
/boot: Programs and scripts used to start Linux.
/etc: Configuration files. You may well find yourself editing some of these, but do be careful, and backup the file before you make a mess of it (voice of experience #2).
/lib: Routines that are shared between programs. Sort of like DLL's (I hear some choking from the Answer Gang at that analogy).
/tmp: A place to store temporary files.
/usr: This directory contains contains all programs (/usr/bin) and libraries (/usr/lib) that aren't essential for the system to boot and undergo emergency repairs. /usr takes up 90% of the disk space on many systems, so many sysadmins keep it on a separate read-only partition. Any information that is host-specific or varies with time is stored elsewhere.
/var: Contains variable data files. For example, you'll find logs here. This directory allows /usr to be read-only, since anything that is written to during system operation is in /var.
/opt: This directory is reserved for the installation of add-on application software. For example, Oracle uses this to contain its binaries, and the files they use. This directory is a standard used on some Unix systems. Its use on Linux systems has been controversial.
There are in addition, directories that only look like directories. They are special, and have a specific purpose:
/dev: Each "file" inside this directory represents a hardware device on the computer.
/mnt: This directory (or one of its its subdirectories) is conventionally used as a location to mount temporary filesystems like floppies. Once mounted, the floppy's contents appear to be physically located in the path "/mnt/floppy". Think of it as assigning a drive letter to a network drive in Windows. However, other Linux distributions mount floppies onto /floppy instead.
/proc: The "files" that appear in this directory aren't really files at all, but represent the programs currently running, information from the Linux kernel. You can write to certain "files" to modify the kernel's behavior, but the changes last only until reboot.
Additional information on these directories can be found by referencing the Filesystem Heirarchy Standard.
One of the biggest concerns I had moving from Windows to Linux is support for the various devices in the machine. You're more likely to find hardware supported on an older machine than one that's state of the art. A good example of that is my Promise Raid controller. I can work around it by using another drive, but it means I'll continue to use Windows to access that 160GB of space.
Another example is my nVidia graphics card. I have a Gforce 4 ti4200, and only relatively recently has nVidia supplied a driver for it. Now, if you're used to the nice way Windows installs device drivers, you're in for a real "treat". The installation of the driver (in Red Hat 9, my current flavor of Linux) was as follows:
1. Reboot Linux in command-line mode (not in GUI mode).
2. Run the nVidia installer. If the kernel isn't one it expects, it builds one for you (remember, I warned you to have programmer tools and kernel source installed).
3. Make config file changes, per the instructions that came with the installer.
4. Reboot Linux into GUI mode.
Now, if you update the kernel, you need to do this all over again, so the nVidia installer can re-build the kernel. Not exactly as simple as running "setup.exe", is it? Personally, I think it should be that easy, but that's an argument for another time.
That having been said, most of my hardware was recognized and used properly. I can burn CD's on my DVD burner. I can watch home movies on DVD. My Creative sound card works well (it didn't work at all in earlier versions of Linux). The latest version of Red Hat (version 9) works even better on my laptop than it does on my desktop, because the laptop is slightly older (a Compaq Presario 1800T).
DVD Note: If you want to play movies (the kind from Hollywood) in Linux, you need a library of routines that can defeat the DVD copy protection. Yes, this is illegal, and a violation of the DMCA. I use Windows to play DVD's for now. Not wanting the MPAA to knock on my door, I can't identify the software needed to play them in Linux, but you can probably google for it. You may have to learn Norwegian, though.
Another concern I had with moving to Linux is losing familiar applications. While Red Hat comes with a version of Open Office, I was tempted by Ximian, which promised better integration, through a customized Open Office, and other additions. I was particularly interested in Ximian's implementation of a "Network Neighborhood", which used an Open Source program called Samba to access shared Windows directories from Linux. While Samba can be installed separately, you have to configure it yourself. Ximian claimed to do it for you.
Ximian installs from the web, rather than downloading a tarball or a zip file. This can be a problem if you're installing to a machine that doesn't have a fast Internet connection. (I wouldn't suggest you do this over a dialup connection). It installed to my laptop easily, and works as advertised. Its implementation of "Network Neighborhood" was nice. It saw all printers and shared directories on my home network, without any tweaks or configuration. Sweet.
Well, now that you're suitably impressed, I'll disillusion you.
The problem came when I next used the Red Hat Network up2date program (sort of like Windows Update) to apply the latest patches. No go. It seems that Ximian replaces parts of the OS with its own customized bits, causing dependency errors during the update process. As a result, I could no longer apply all the patches. I couldn't even add some packages from the install CD because of this (I said this before: install everything).
I hope Ximian solves the conflict problem, because I'd really like to use it.
As with anything else, Linux has its annoyances. At least, from a Windows perspective.
Both Red Hat and Ximian default to using the Gnome desktop, but I prefer using the KDE desktop. KDE is an optional install, another reason to just install everything the first time around.
RPM package dependencies. This is more than annoying if you haven't a clue how to fix it. You just want something installed. If the computer knows what's wrong, it should just fix it, or tell you clearly what's missing. Tip: Run "rpm" from the command line instead of double-clicking on the package icon, using the verbose option to see what went wrong.
Another annoyance involves modems. Most of them these days are what's called "winmodems", which mean they depend on Windows to work. They're useless in Linux, and ones that do work aren't always easy to find.
At the risk of offending everybody, vi. It's the most commonly used text editor in both Unix and Linux, and was originally designed to be used over a slow modem connection on an 80-character-by-25-row screen. How slow? Try 300 baud. Today there are lots of alternatives, such as Emacs (in both command line and X-Windows versions), as well as various programming IDE's that do syntax highlighting, but if all you're doing is editing config files now and then, these may be overkill. If what you really want is something like Notepad, then you have a choice of using Kedit (KDE desktop) or Gedit (Gnome desktop). Voice of experience #3: Keep a printed copy of the vi command keys somewhere handy. You'll need it when you have to edit a config file or shell script and X-Windows isn't running (or won't run because you accidently trashed it). Don't say I didn't warn you.
The installation of programs and device drivers is an unholy pain in the boot sector. Some vendors, such as Borland with their Kylix and J Builder tools, make program installation a whole lot easier, but even they have some room for improvement. And I've already said my two cents worth about installing device drivers.
Disk partitions don't always automount. Mandrake scans your drives, and sets up icons for any FAT partitions it finds, but in Red Hat, you have to crack open the manual and do it yourself. It's not hard, but it's a pain. Reading the manual, after all, is the option of last resort.
You can't just eject the CD-ROM as you do in Windows. You have to unmount it first. I know it's just a mouse click (or a CLI command) away, but, hey, I'm lazy!
Help is a little too scattered for my taste. You have two places to find manual pages, as well as separate GUI help files. I'd like to have everything available and cross-referenced in one place, preferably available from the GUI. Some systems have a command "xman", which is a GUI version of the "man" command, but I haven't seen it in Red Hat. On the plus side of Linux, there is a ton of HOWTO guides out there, covering a wealth of topics, so I guess it balances.
The Open and Save dialog box isn't as elegant as the one in Windows, and is a bit jarring if you go back and forth between operating systems as I do. Rather a small nit to pick, but there you go.
Linux has some outstanding positives going for it. Here are favorites from my rather twisted point of view (your mileage may vary):
In my opinion, Linux in general, and the KDE desktop in particular, has one of the best, most flexible GUI environments around. Sometimes, I wish I could replace the Windows desktop with KDE. Then again, sometimes I wish Windows itself was just a shell on top of Linux (dream on, fool).
Another great feature of Linux is the ability to copy-and-paste almost anywhere using the 3rd mouse button. Just highlight the source text, and click the middle mouse button to paste into the current cursor position. Simple, and oh-so-elegant. This is the sort of job one does repeatedly, and with Linux I don't have to remove my hand from the mouse to do so. This must sound strange to most Linux folk, who hate taking their hand from the keyboard to use the mouse. So, I'm a little strange. Be nice, I've been a prisoner of Windows.
The security available for files is so much better than in Windows. Linux gives you a much finer control over what you can do with a file. For one thing, consider that a Linux file needs execute permission before it can be run. Windows, on the other hand, will let you run just about anything. Once you get used to it, you'll want this level of security in Windows, too (but you can't have it: nah..nah...nah..nah..nah).
Command Line Interfaces can color-code the directory listings (and the "dir" command works without having to create a shell alias or shell script for it), which is a feature I had in my DOS days using a program called 4DOS.
Any command that needs "root" (think of it as the Windows "administrator") privileges to work will prompt for the root password before it proceeds. Good grief, Toto, does this mean that administrative jobs can't be run behind my back from my login id? I had always known that both Unix and Linux had better security options than Windows, but this is great. In Windows, I had to give myself Administrator privileges, or log in as Administrator, to perform certain tasks. In Linux, I can be an ordinary user, and still have the power to get things done.
Linux also has a powerful alternative to the "fast user switch" in XP for logging in as root.. It's called the "su" command. Type it into a command line by itself, and it prompts you for the root password. From that point on, only that command line, and the programs it starts, are run with root privileges. The rest of your screen stays as you.
Yes, their commands are strange, and a bit cryptic, but shell scripts in Linux make DOS batch files look like something out of the early 80's (oh, wait...). A shell script is something like a batch file, but with enough power to replace most "C" programs in daily use. There are two main flavors of shells: cshell and bash. Of the two, bash is more commonly used in Linux. Microsoft is going to add a new command line interface to its Longhorn release, and it sounds a lot like a Linux shell (probably proprietary and incompatible, of course). That should give you a hint how powerful Shells and Shell Scripting are.
Mozilla! Goodbye Internet Explorer! Goodbye Outlook and Outlook Express! I've been using Mozilla Firebird for my browsing, and Mozilla Thunderbird for email for a while now, and have begun using both in Windows as well. Thunderbird does a wonderful job killing spam.
Open Office 1.1! Everything I normally do in Microsoft Office I can do here, including save documents in MS formats. I use this too in both Linux and Windows.
The Gimp! I had no need of an expensive graphics editor, just to clean up pictures from my digital camera, but I needed something better than MS Paint. I tried Gimp simply because it was free (yes, I admit to being a cheapskate), but was shocked to discover how good this program is. It's not quite as easy to use as MS Paint (that's because MS Paint doesn't do a whole lot), but when you need something that's more powerful, you've gotta check it out. Now, I do have a nit or two to pick with the program (like, give me the option to put all those separate windows on a MDI form, so I can find everything), but on the whole, this is the image editor I use in both Linux and Windows. I may even read the manual for once!
I could go on, but you can see the trend here. If a program is so good it gets me to use it in both Linux and Windows, you start wondering why use Windows at all. In fact, I use Windows mostly for gaming these days, and little else.
I may just throw away my ruby slippers, Toto. Linux has a ways to go to satisfy Mr. Picky here, but I think I'm already home.
Tom has been a software developer since the early days of the Commodore 64,
with such commercial classics as Prototerm-64 and Colorez-128, and has seen
lots of operating systems come and go. Every one he's liked is either
discontinued (OS/2) or out of business (Commodore Amiga). He currently likes
Red Hat Linux, which won't be supported after April '04. As a result, we've
been trying to get him to fall in love with Windows, but so far no luck.