Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This 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!


  Search this Thread
Old 05-29-2007, 10:04 AM   #1
Registered: Oct 2005
Location: Bangladesh
Posts: 497

Rep: Reputation: 30
Cool About increasing Swap Size

dear friends ,

I have completed my Linux (RHEL 4) int my pc wihe the following partition:

1) swap =512 MB
2) / (root) = rest of the size of HDD

Now my question is ,

If I want to increase my swap size (Like 512 to 1024 MB) , then is it possible to do after installation of Linux ?
Old 05-29-2007, 11:03 AM   #2
LQ Guru
Registered: Aug 2003
Distribution: CentOS, OS X
Posts: 5,131

Rep: Reputation: Disabled
I guess it depends on the filesystem of your root partition. Swap doesn't include anything "important" so you could just as well delete and recreate it, run the swap tools etc., but to increase it's size means you need to shrink the root partition. I'm not a master here, I prefer to think and create a working partitioning before rushing in..and you have backups, don't you, so you can try.

Half a gig should be enough swap. I have 512MB swap too, from an older installation, and it's definitely too much for my use even though I do run some "heavy" programs occationally. I've never seen it full, and most of the time I see it empty -- just a lot of wasted space most of the time. Especially after installing this most recent Slackware system my memory usage dropped a lot so there's even less need for swap.
Old 05-29-2007, 12:45 PM   #3
Senior Member
Registered: Nov 2002
Location: CA
Distribution: redhat 7.3
Posts: 1,440

Rep: Reputation: 52
If you're too scared in shrinking a partition, you can create a swap file and use that as well.

1. Pick a partition that has adequate space
2. dd if=/dev/zero of=/path/to/swap/file bs=1024k count=512
3. chmod 600 /path/to/swap/file
4. mkswap /path/to/swap/file
5. swapon /path/to/swap/file

Also, remember to add the swap file to /etc/fstab.



Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
increasing ram, need to increase swap phreakshew Ubuntu 8 12-26-2016 11:49 PM
Need Help Increasing Swap by creating a swap file froggo Red Hat 3 06-13-2006 08:04 AM
increasing swap on a slow pc ejbest Linux - Newbie 1 10-24-2004 10:30 AM
Increasing swap space rupesh_pulikool Linux - Networking 1 09-12-2004 10:40 PM
Increasing swap partition suneet123 Linux - Software 3 12-16-2002 03:11 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:16 AM.

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