old-www/LDP/LG/issue36/haldar.html

307 lines
12 KiB
HTML

<!--startcut ==========================================================-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<title>Linux on a Shoestring LG #36</title>
<meta name="summary" content="How to run Linux on an antiquated machine">
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#A000A0"
ALINK="#FF0000">
<!--endcut ============================================================-->
<H4>
"Linux Gazette...<I>making Linux just a little more fun!</I>"
</H4>
<P> <HR> <P>
<!--===================================================================-->
<center>
<H1><font color="maroon">Linux on a Shoestring</font></H1>
<H4>By <a href="mailto:csu96177@cse.iitd.ernet.in">Vivek Haldar</a></H4>
</center>
<P> <HR> <P>
This article first appeared in the September 1998 issue of PC Quest, India's
leading infotech magazine.
<P> <HR> <P>
<!-- AS-TOC_BEGIN{ -->
<H1 ALIGN=center>Table of Contents</H1>
<UL>
<LI><A HREF="#as-h2-23100">INTRODUCTION</A>
<LI><A HREF="#as-h2-23101">SAVE RAM!</A>
<UL>
<LI><A HREF="#as-h3-23102">RECOMPILE THE KERNEL</A>
<LI><A HREF="#as-h3-23103">STOP SOME SERVICES!</A>
<LI><A HREF="#as-h3-23104">HOW TO REMOVE SERVICES FROM A RUNLEVEL </A>
<LI><A HREF="#as-h3-23105">WHICH SERVICES TO KEEP, AND WHICH TO REMOVE </A>
<LI><A HREF="#as-h3-23106">SERVICES YOU MIGHT WANT TO KEEP</A>
</UL>
<LI><A HREF="#as-h2-23107">SAVE DISK SPACE</A>
<UL>
<LI><A HREF="#as-h3-23108">HOW TO REMOVE A PACKAGE </A>
<LI><A HREF="#as-h3-23109">WHICH PACKAGES DO I REMOVE?</A>
</UL>
<LI><A HREF="#as-h2-231010">WINDING UP</A>
</UL>
<!-- AS-TOC_END} -->
<HR>
<H2><A NAME="as-h2-23100">INTRODUCTION</A></H2>
<P>
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.
<P>
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.
<P>
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.
<P>
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.
<H2><A NAME="as-h2-23101">SAVE RAM!</A></H2>
<H3><A NAME="as-h3-23102">RECOMPILE THE KERNEL</A></H3>
<P>
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.
<P>
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.
<P>
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.
<H3><A NAME="as-h3-23103">STOP SOME SERVICES!</A></H3>
<P>
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 <EM>daemons</EM>. 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
<EM>runlevels</EM>, 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.
<P>
Linux, by default, boots into <STRONG>runlevel 3</STRONG>. 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.
<H3><A NAME="as-h3-23104">HOW TO REMOVE SERVICES FROM A RUNLEVEL </A></H3>
<P>
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.
<P>
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.
<H3><A NAME="as-h3-23105"> WHICH SERVICES TO KEEP, AND WHICH TO REMOVE </A></H3>
<P>
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 :
<UL>
<LI><STRONG>kerneld</STRONG> - nothing will work without this!
<LI><STRONG>syslog </STRONG>- must have around for kernel to log
messages. The logs are helpful for seeing what was
going on with your system in case something goes
wrong(actually, nothing ever goes wrong with Linux!).
<LI> <STRONG>keytable</STRONG> - you need this if want to be able to use
your keyboard!
<LI><STRONG>rc.local</STRONG> - this is where some trivial nitty gritties
happen, after all the other services have been
started.
</UL>
<P>
You simply need to have the above four
services. Without them, as some say, "not everything
will work."
<H3><A NAME="as-h3-23106">SERVICES YOU MIGHT WANT TO KEEP</A></H3>
<P>
Then there are the fence sitters - non critical services
which you might want to keep, if you need them, or if
you fancy them.
<UL>
<LI> <STRONG>crond </STRONG>- this runs a number of trivial jobs
periodically, the most important of which is to make
sure that your log files don't get too large. you can
run it if you're paranoid.
<LI><STRONG>atd</STRONG> - this deamon is required if you want to run "at"
jobs, i.e., jobs which begin execution at a time
specified by you. people working on large, multi-user
systems which are up 24 hours, everyday, use this to run
heavy computational jobs at night, when loads on the
system are lighter. but on a simple home machine, i
don't see much use for it. after all, you're the only
one using it!
<LI> <STRONG>gpm</STRONG> - this allows you to use the mouse in text
mode. useful sometimes only if you work in text mode,
and a complete waste if you work in x.
</UL>
<H2><A NAME="as-h2-23107"> SAVE DISK SPACE</A></H2>
<P>
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.
<H3><A NAME="as-h3-23108"> HOW TO REMOVE A PACKAGE </A></H3>
<P>
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.
<H3><A NAME="as-h3-23109"> WHICH PACKAGES DO I REMOVE?</A></H3>
<P>
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.
<P>
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.
<H2><A NAME="as-h2-231010"> WINDING UP</A></H2>
<P>
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.
<P>
<EM>Linux is an OS which is more
forgiving to experimentation than most others. So think,
and try it out!</EM>
<!--===================================================================-->
<P> <hr> <P>
<center><H5>Copyright &copy; 1999, Vivek Haldar <BR>
Published in Issue 36 of <i>Linux Gazette</i>, January 1999</H5></center>
<!--===================================================================-->
<P> <hr> <P>
<A HREF="./index.html"><IMG ALIGN=BOTTOM SRC="../gx/indexnew.gif"
ALT="[ TABLE OF CONTENTS ]"></A>
<A HREF="../index.html"><IMG ALIGN=BOTTOM SRC="../gx/homenew.gif"
ALT="[ FRONT PAGE ]"></A>
<A HREF="./jenkins5.html"><IMG SRC="../gx/back2.gif"
ALT=" Back "></A>
<A HREF="./coleman.html"><IMG SRC="../gx/fwd.gif" ALT=" Next "></A>
<P> <hr> <P>
<!--startcut ==========================================================-->
</BODY>
</HTML>
<!--endcut ============================================================-->