LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   About increasing Swap Size (https://www.linuxquestions.org/questions/linux-newbie-8/about-increasing-swap-size-557446/)

shipon_97 05-29-2007 10:04 AM

About increasing Swap Size
 
dear friends ,

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

1) swap =512 MB
and
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 ?

b0uncer 05-29-2007 11:03 AM

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.

twantrd 05-29-2007 12:45 PM

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.

-twantrd


All times are GMT -5. The time now is 09:07 AM.