Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then 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.
I've just added 1G of RAM to my system for a total of 1.5G (MANDRAKE 2006 distro)
I currently have 1 GIG for SWAP. I'd like to expand this swap to 2.5 GIGs.
Is there a way to expand my existing SWAP partition or do I need to create a new one? If I need to create a new one, should I delete the existing one and create one single SWAP partition or simply add a second one?
You can add swap partitions to an existing system. Just create the partition and change its partition type to 82 (Linux swap) with fdisk. Then you run mkswap on it (have a look at the man page for its options). You can activate the partition for your current session with swapon. Again, have a look at the man page, particularly the -p option so that you control which swap gets used first.
To make the swap available on booting, add it to /etc/fstab with something like:
/dev/hda10 none swap defaults 0 0
The only question I have is, are you sure you need more swap? I have a Slackware 10.2 box in my test lab with 1.5GB RAM running Oracle 10g and swap usage hasn't been over 200MB (so far).
why bother? you just bought more RAM! if you're just looking to improve current system performance then you're going to need less swap not more. BUT if you do want to go by that outdated nonsense of swap = 2 x ram then you can just create a new partition as type 83 ( i think that's swap type) and then use mkswap on the new partition and add an entry to /etc/fstab for it. there's no need to delete the old one at all. if you don't want to make a new partition completey you can simply make a swap file instead, use dd to create a file of whatever size you want (1gb = dd if=/dev/null of=/var/swapfile bs=1024 count=1024) and mkswap on that and use it in the same way.
The only time you really need swap is if the current load pushes RAM past its capacity, and the system is forced to write memory pages out to disk. The more RAM you have, the less likely that is. Given that reads/writes from a physical device are measured in milliseconds, and reads/writes within RAM are measured in nanoseconds, you really don't want to be using swap much at all. Personally, I define a 256Mg swap space, regardless. Disclaimer: high-traffic, heavily loaded servers may (or will) need more, but for a desktop and/or light duty server, you don't need very much swap at all.
The old "swap = 2xRAM" rule of thumb dates from the 90's, where having 32Mg of RAM was considered leading edge, and it was relatively easy to consume 100% of your memory. These days, where 512Mg or 1G RAM systems are pretty much standard, the need for swap has more or less evaporated