Greetings and Salutations fellow Tech Support groupies! The following questions include a few stumper questions and a few that I have seen in various media since my last article. I would like to focus this month's tech support column on systems management and protection and the use of disk and filesystem tools.
I would like to ensure that my disk drives are defragmented and protected from nasty virii. What do I need to do?
Coming from a DOS/Windows world, it's easy to imagine that you must defragment a hard disk with some regularity to prevent your system's performance from degrading over time. Thankfully, in the Linux world, we do not have to bother with such things. The operating system itself will do "spring cleaning" when it reaches its maximum mount count. You will see a message when your root and other filesystems are mounted, claiming that the maximum mount count has been reached and a check is being forced. This is Linux's kind way of telling you it wants to take a look at things under the hood.
Although there are disk defragmentation utilities available for Linux filesystems, they generally are not used because the operating system does such a great job of maintaining itself over the long haul.
There have been lots of scares lately regarding unwanted gremlins that hide inside your system and attack it. The SuSE mailing list has carried warnings of several e-mail attachment viruses, and some of them were exposed as hoaxes. There is an anti-virus program which ships with SuSE 6.0 as part of the commercial packages, but I have never used it. I have never had a Linux system get corrupted or attacked by a virus, but I don't doubt that someone has written a virus which will attack ext2 filesystems or the boot sector. Overall, I do not feel so concerned regarding unwanted virii on a Linux system.
It is also important to remember that as long as you are not running as root, the amount of damage you can do to your system is limited. Even if you were to somehow download a virus onto your computer, in theory the only things it could attack would be programs and files in a single user's directory.
What are the most common filesystem manipulation tools and how do I use them?
This question comes up a lot and so I decided to expound a bit on it. There are several very powerful tools one can use to affect the filesystem. I think one of the coolest is a little file called /etc/fstab, which basically tells Linux what mountable filesystems you have available on your system. I added an entry for my internal Jaz drive and it is now available with a command like mount /jaz to users. I also formatted a Jaz cartridge as an ext2 filesystem and am able to store compressed archives on it as well as rpm files. All in all, /etc/fstab is quite cool.
The second file is /etc/lilo. conf. This little file is actually the mastermind of LILO, or the Linux Loader. It manages filesystems for booting the computer and kernels that can be accessed.
If you take a look at your /etc/ lilo.conf, you will probably see several entries which correspond to a root and boot entry, an image, and a label. If you have already compiled a kernel, you may have a second stanza to boot the old kernel. This file can be edited by a text editor, but if you make boot changes, you must run the command /sbin/lilo again to activate those changes. You should exercise great caution with this file since it does provide for booting the system. Many of the modern distributions offer ways to edit the entries in /etc/lilo.conf in a graphical environment. SuSE 6 offers LILO configuration as part of its YaST program while Red Hat offers this in its linuxconf grand slam program.
The third file I want to discuss is what I call the "mastermind of networking" or, as the system refers to it; /etc/inetd.conf. This file contains the nuts and bolts configuration information for the inetd daemon, the super daemon for networking services. Inside this file you will find switches to turn various network services on or off. You can also add switches for services you build yourself. For example, we have added a program called "leafnode". leafnode offers you a fully featured news server which taps a regular news server for articles. This means you can read articles without an active network connection and you can set up the service to run automatically with a crontab. If you do not know how to use crontab, keep reading -- it's discussed in the next paragraph.
The last cool tool I'll discuss is the previously mentioned crontab. Everyone remembers the at commands that DOS used in its batch files to create time-sensitive programs. Well, under Linux, there is a little file called a crontab to control such programs. Each user can have his own crontab. I use crontabs to manage fetching and expiring news for leafnode.
But this is not the only use for crontabs. Crontabs can do a multitude of things. To see examples, simply do a man 5 crontab for a great description of various crontab approaches. You can use crontabs to start a service like fetchmail to grab e-mail from various servers out there, or to have it do something automatically at a preset time. It's a particularly useful tool which does not require much in the way of user intervention to execute.
I want to see how my system is doing with hard disk space and memory and a few other management tools. What are the most common tools and how do they work?
There are tools and then again, there are tools :) I have seen quite gorgeous tools which come with WindowMaker and KDE and GNOME, which provide systems management functionality. Another quite useful tool is called xosview.
If you run this at startup you will get measurements of memory, network access, IRQ use, and such. Note that with later kernels you may need to compile a later version of xosview. I tend to start xosview from my .fvwm2rc file under the SuSE distribution. This makes xosview available for easy reference. It is a nice looking application and is quite a lot of fun to use as a monitoring tool.
There are also a variety of text tools that run in xterms or console mode. The first one I want to discuss will show a rather concentrated view of available memory and swapfile use. It's called free. If you run free, it reports on a whole bunch of memory issues.
The second tool I want to discuss is called df. Simply type df at an xterm or in the console and the utility will show you your free disk space. Take a look at the man page for df to get more information about its switches and output formats.
Another great tool is the simple mount command. When issued in an xterm, this command will show all the mounted filesystems. You can also use it to mount floppy disk drives, Zip or Jaz drives, or other filesystems like Windows or DOS.
The next one is called ps and you will have to do some experimenting with this one to catch on. Ps will list all processes running on a system. You can usually kill an offending process when you see one by using the kill-9numberofpid where numberofpid corresponds with the process number reported by ps. This command includes lots of switches and abilities, so you should definitely read the man pages for its use.
A last command called top will show memory consumption, uptime (in days), users, and load average. Top will also brew coffee and walk the dog with the correct switches set :). All of these programs will let you see what's running on a system.
The great thing about all these text programs is that they take all kinds of switches. Check out the man pages for each one!!
What system utilities can help me get the most out of things like man pages and other available resources?
Many Linux users wish to read the man pages in some format other than the rather boring default man display. There are a number of other tools for displaying man pages. In my opinion, one of the nicest tools is called tkman. This tool formats man pages to allow for easy searching and loading of cross-referenced man pages. I normally use tkman to move around and between man pages. The utility is usually installed by default on most distributions.
Another nice utility to have is one that will manage compressed archives for you. I have found a few that are intuitive to use. These include one called tkzip which can be found at http//www.xnet.com/~blatura/linapps.shtml. A second one is called guiTAR which is written for the gtk/GNOME environment and may be more difficult to install. This is available for free from http//www.gnome.org in several formats including rpm files.
There also are file managers which offer some compressed archive support. These include filerunner, tkdesk's rather excellent file manager; midnite commander (midnite commander); and GNOME's front end to mc called GMC (for "GNOME midnite commander.").
The final nice-to-have utility is an easy to use rpm package management tool. I don't think that glint is particularly nice to use or friendly so I would like to strongly recommend a rather basic tool called xrpm from http//www.gmsys.com/xrpm.html. It is available as an rpm for immediate installation.
Another is called gnorpm and offers a different twist on filesystem support. Gnorpm can be found at http//www.gnome.org. Several file managers also offer this support too. You can always use the tool that Red Hat provides but I think there are better choices that make rpm file management an easier chore.
Michael Perry documents tech support issues and spends hours staring at and posting to Linux newsgroups. He can be reached at .