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.
Notices
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.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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:
Code:
/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.
Thans for the info. Actually Gilead, it's funny you mention oracle 10g because that's the reason I wanted to up the SWAP. The oracle doc. says to have 1.5 X RAM for the amount of RAM that I have.
I guess I'll leave as is then.....no harm in upping later if need be correct?
guess I'll leave as is then.....no harm in upping later if need be correct?
Yes, it's fine to leave it as is for now unless you need more. Acid_kewpie is correct. swap=2x RAM is pretty much outdated for today's standards is because back then RAM was expensive.
That's right - if you just want it to do development work on, it'll run happily on much less than that. I've had Oracle 10g running on a PIII 1.6GHz with 512MB RAM and 512MB swap without complaining.
I've never tried loading it seriously to see how quickly it would collapse though, it was just for the developers here to tinker with.
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
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.