"Linux Gazette...making Linux just a little more fun!"


Linux on a Shoestring

By


This article first appeared in the September 1998 issue of PC Quest, India's leading infotech magazine.


Table of Contents


INTRODUCTION

With every operating system out there screaming "Give me more!" - more disk space, more RAM, more Mhz - it's comforting to know that there is one savior out there for those of us not endowed with the sizzlingly latest hardware. Yes, I am talking about Linux.

Though Linux shines as a network operating system, and is often projected as one, the fact is that it makes a great single user OS as well - something that one could use on a non-networked home PC.

And in that case, there are a number of ways in which you could tweak your system to get more punch out of it - even on machines as antiquated as 486s, and with as little RAM as 8MB.

Now please remember that you need to be logged in as root to do all the following things. Our attack will be two pronged - to minimize usage of RAM, and to save disk space.

SAVE RAM!

RECOMPILE THE KERNEL

The kernel that is installed out of the box does the job, but its a catch-all kernel, with almost everything compiled into it. Which means that its bigger than it has to be for you. If you compile your own kernel from the kernel sources, it could be upto 100kb smaller than the default vmlinuz kernel. Besides, its very helpful to know how to compile the kernel. It's quite simple actually. You first configure it, that is, you say what all you want in your kernel. And then you compile it.

Linux has reached that advanced stage in its evolution where even the kernel configuration can be done graphically. The kernel sources usually reside in /usr/src/linux. To get the graphical configuration running, do "make menuconfig"(for text based menus), or "make xconfig"(for graphical setup in X). You'll be presented with a long list of configurable options, and before deciding, it is advisable to see the sagely help note which goes along with each. The notes always give sound advice, and you should follow it. By doing so, you'll land up with exactly the things that you need compiled into your kernel, and nothing else. I would also suggest reading the README file in the source directory. Once you've configured everything, quit X if you're running it. This is so that you can do the compilation in text mode, without a heavy X running, and with more available RAM.

Do "make dep; make zImage", go have coffee, and come back after some time. Once that is done, the README explains in no uncertain terms what to do with your new kernel, and I would only be reproducing it if I told you.

STOP SOME SERVICES!

When a normal Linux system is running, there are a number of background jobs constantly running on it, each for a specific purpose - these are called daemons. For example, sendmail, the mail daemon, is the process which takes care of all the sending and routing of mail. A number of such daemons are started at bootup. And to group together sets of daemons that you might want to start for specific purposes, you have runlevels, which are simply groupings of services to start and stop. For example, on a normal Linux system runlevel 1, which is single user mode, will obviously need a lot fewer services to be running than runlevel 3, the full fledged multi user mode.

Linux, by default, boots into runlevel 3. Now it turns out that of the myriad services started in that runlevel, some of them a simple non networked home PC could do without. For example, you obviously wouldn't want to waste precious RAM by running sendmail on such a machine. Yeah, it can be fun to send mail back and forth between root@localhost, and someuser@localhost, but that wears off pretty fast.

HOW TO REMOVE SERVICES FROM A RUNLEVEL

With RedHat, it's all very simple. Administration is definitely one of the areas in which RedHat scores over other distributions. After logging in as root, start X, and from an xterm, start "tksysv". This is the graphical runlevel editor.

You'll see six columns, one for each runlevel. Now we'll only be fiddling with runlevel 3, the one which Linux normally boots into. Each column will have two halves, the top one for services to start at bootup, and the botton one for services to stop at shutdown. All you have to do to remove a particular service is to select it, and press Del. Thats it. Just remember to save your changes before quitting.

WHICH SERVICES TO KEEP, AND WHICH TO REMOVE

Actually, it's much simpler to tell you which ones to keep. Remember, all this tweaking is only in runlevel 3. Now the bare essentials are :

You simply need to have the above four services. Without them, as some say, "not everything will work."

SERVICES YOU MIGHT WANT TO KEEP

Then there are the fence sitters - non critical services which you might want to keep, if you need them, or if you fancy them.

SAVE DISK SPACE

Actually, there's nothing much you can do here, except removing unwanted packages. Redhat linux has a superb, easy to use, and comprehensive package management system which can keep track of almost every non user file on your disk. Everything installed on your system is part of some package, and packeges can be uninstalled.

HOW TO REMOVE A PACKAGE

Just run "glint", the graphical interface to the redhat package management system, from a command line while in x, and you will get a graphical interface to all the packages installed on your system. The packages are classified, and show up in a directory browser like window. To remove a package, just select it and click on the "uninstall" button on the right side.

WHICH PACKAGES DO I REMOVE?

Beware though, there are some critical packages which shouldn't be uninstalled. In glint, it's generally advisable to not touch the "base" and "library" packages unless you know exactly what you are doing.

For others, see their description(click the "query" button). If you haven't used that package in a long time, or don't foresee using it, it's generally safe to remove it. In case removing a package affects any other package, glint will tell you. It's all quite safe. If you do end up needing the package, you can always reinstall it from the CD.

WINDING UP

These were only a few suggestions that you could try out. The more comfortable you get with Linux, and the more you explore, the more ideas you'll get to tweak your system to get the most out of it.

Linux is an OS which is more forgiving to experimentation than most others. So think, and try it out!


Copyright © 1999, Vivek Haldar
Published in Issue 36 of Linux Gazette, January 1999


[ TABLE OF CONTENTS ] [ FRONT PAGE ]  Back  Next