LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 05-29-2007, 11:04 AM   #1
shipon_97
Member
 
Registered: Oct 2005
Location: Bangladesh
Posts: 490

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
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 ?
 
Old 05-29-2007, 12:03 PM   #2
b0uncer
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, 01:45 PM   #3
twantrd
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.

-twantrd
 
  


Reply


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

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration