LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 07-25-2007, 01:52 PM   #1
Mow
Member
 
Registered: Jul 2003
Posts: 64

Rep: Reputation: 15
Is there an easy way to increase SWAP size?


this is a 2 part questions really ...


1. I'm going to be upgrading my RAM from 1 GB to 2 GB here shortly on a Slack 12 box and instead of running an install all over again I wanted to use some free space from one of my other partitions (currently I have 1 for / 1 for swap and one for /home) to adjust my swap partition to make up for the new RAM size.

2. Also .. just what is the correct "formula" for figuring swap size? Is it 1.5 times your ram typically?


Thanks in advance.
 
Old 07-25-2007, 02:15 PM   #2
XavierP
Moderator
 
Registered: Nov 2002
Location: Kent, England
Distribution: Debian Testing
Posts: 19,192
Blog Entries: 4

Rep: Reputation: 475Reputation: 475Reputation: 475Reputation: 475Reputation: 475
A long time ago when RAM was hideously expensive the formula was twice your RAM = swap size. Nowadays, a gig of RAM is normal and, unless you are carrying out very memory intensive compiling/programming/whatever, you don't need to follow that. Basically, whatever you have now is fine. You don't want your PC to use the swap space, the hard drive is slower than the RAM.
 
Old 07-25-2007, 02:22 PM   #3
Quakeboy02
Senior Member
 
Registered: Nov 2006
Distribution: Debian Linux 11 (Bullseye)
Posts: 3,407

Rep: Reputation: 141Reputation: 141
To add to what XavierP said: there's no reason to think that additional memory, in and of itself, causes a need for more swap space, unless you're using suspend to disk.

Think of it like this: RAM plus Swap is your total memory footprint. The swap portion can be considered a very slow version of RAM, if you like. So, adding a larger RAM area only increases the high-speed part of your total memory footprint. Unless you are increasing your RAM due to a dramatically increased need for your memory footprint (or using suspend to disk) then there is no need or advantage to increasing the swap space.
 
Old 07-25-2007, 04:07 PM   #4
Mow
Member
 
Registered: Jul 2003
Posts: 64

Original Poster
Rep: Reputation: 15
Thanks to both of you for your replies .. I'm increasing my RAM as a game I play uses a lot of RAM .. so I'll increase my RAM and just not worry about my swap area then and leave it as is ...


Thanks again.
 
Old 07-25-2007, 04:10 PM   #5
randomsel
Member
 
Registered: Oct 2006
Location: Wilmington, DE
Distribution: Slackware 11
Posts: 201

Rep: Reputation: 30
As to your question, just add another swap partition in your fstab after formating with mkswap.
 
Old 07-25-2007, 06:32 PM   #6
onebuck
Moderator
 
Registered: Jan 2005
Location: Central Florida 20 minutes from Disney World
Distribution: SlackwareŽ
Posts: 13,925
Blog Entries: 44

Rep: Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159
Quote:
Originally Posted by randomsel
As to your question, just add another swap partition in your fstab after formating with mkswap.
Hi,

Not as simple as that for the OP. He seems to have his space allocated. He would first have to determine which partition would be the easiest to resize. If /home is at the end of the drive space then it would be the best candidate. The OP could then use Qparted to resize the space to allocate some free space. Of course the space would be located at a position on the drive that would not be the optimum area but would meet the needs of a system.

Then using fdisk to make the partition. Write the partition table then I would reboot to update the partition table. After that do 'mkswap -c /dev/device_assignment'. Then do an edit to include the additional swap in the '/etc/fstab'. The 'swapon /dev/device_assignment' would then turn the swap on. The '/etc/fstab' would take care of the mount during boot for the device. Of course the OP could use a 'mount -a' from the cli to mount all the file systems.

Edit: To use an increased swap because of the increase of your RAM is not really all that necessary. As stated by others in the thread. Now if your system is suspending as others have pointed out then you may need to increase your swap. But I really don't think you will see the problem with 1 GB or greater on a desktop with typical loads.

Last edited by onebuck; 07-25-2007 at 07:49 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to increase swap size in LVM? Akhran Debian 1 04-04-2006 09:47 AM
ubuntu - increase swap size dna9 Linux - Distributions 11 01-24-2005 11:45 AM
Looking to increase swap partition Patgod Linux - Newbie 8 03-29-2004 05:46 PM
increase point size size when printing PDF files newlin Red Hat 0 09-27-2003 07:13 AM
Increase Swap Space? star geezer Linux - Software 9 03-10-2003 12:04 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 09:41 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration