Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
First, try "free -m", which will, on the last line, tell you how much swap there is in the first column, and how much is used/free.
If there is 0 total, then you *do* have a problem. If there is some, but Linux isn't using it, then you have no problem. (Feel free to force it to swap by writing a small C program which allocates and locks memory.)
Your fstab seems to be right, so try the following until "free -m" seems to be telling you that you have some swap available.
# This should "mount" the swap partitions. Check it with free -m again.
# Or whatever your swap partition is. Again, check afterwards. This
# command may give you useful errors.
swapoff -a ; mkswap /dev/sdd1 ; swapon /dev/sdd1
# Replace /dev/sdd1 with your swap partition, as above. If this works, try
# the following:
swapoff -a ; swapon -a
# If you have available swap by the time you get here, your problems
# ought to be sorted. Otherwise, you've got an "interesting" problem.
And d00d, it would appear that it is in fact installed correctly.
free will tell you a bit about your RAM and swap. If you want to learn more about swap you can read the man pages associated with it.
I would hope that you are not getting upset about this. We are just trying to help you, and show you that Linux can work with your system well, and does not eat at RAM to the point of needing a SWAP very often. Please understand, we are trying to sort of "look out for your best interests" and this may seem like it's not helping you, but in fact it is.
But it looks like now you should read up on the man pages associated with swap. It does appear that you do have swap setup if it ever does need to be used.
I've never used free, but as I recall there is also the 'mem' command which will give you a pretty complete picture of your memory.
Linux really does not make much use of swap, at least in my experience on a single-user machine. About 5 years ago, I tried this out. On a 24M machine, I looged in on each console, ran Motif (K and GNOME were just a twinkle in my eye then), ran several types of processes, including graphics intensive ones, and found that Linux was barely using any swap at all.
I think much of this is due to things like shared libs and reentrancy. Linux does make much more intelligent use of swap.
I have heard that the general rule of setting swap to twice your RAM can be a fallacy, but I don't really know enuf to say one way or another. However, you should at least use SOME swap, in my opinion.
"mem" is DOS, if I recall. Doesn't exist on my box, anyway. Although it does exist on Windows 2000, still giving out the DOS output.
For comparison, my "router" (which also does mail and web serving, and sometimes runs squid) uses about 100M out of 256M physical, and no swap at all - although, of course, it has some available.
My workstation, which has 768M, and runs RawHide (Gnome 2, etc), uses about 150M of swap nearly all the time, and about 381M physical. It's got "only" 1G of swap, thus breaking the "twice the memory" rule.
Remaining physical memory on both is all used by caches and buffers, except for the 7M spare space.
My first Linux box, a monstrous 40M beast running 1.1.59 - about 7 years ago, used a bit of the 128M of swap it had available. But then, it was running a 150 user BBS, amongst other things. And I should have made that a *lot* more memory conservative.
Incidentally, the "twice the memory" rule used to be "four times the memory", back in the day, and applied equally to Linux and Windows, even though Windows (at the time, certainly, an possibly still) had all sorts of operating system services designed to aid minimum use of "virtual memory".