LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat
User Name
Password
Red Hat This forum is for the discussion of Red Hat Linux.

Notices


Reply
  Search this Thread
Old 06-12-2006, 05:37 PM   #1
froggo
LQ Newbie
 
Registered: May 2005
Posts: 28

Rep: Reputation: 15
Need Help Increasing Swap by creating a swap file


Hi i have a server with 2gb of memory and i would now like to set the swap twice the size how can i do this with? I was thinking about creating a swapfile but can't remember how... can someone please guide me in creating this?

the is no more free space to create a partition...
 
Old 06-12-2006, 05:44 PM   #2
nadroj
Senior Member
 
Registered: Jan 2005
Location: Canada
Distribution: ubuntu
Posts: 2,539

Rep: Reputation: 60
i believe the commands are 'swapon' and 'mkswap'
i dont think you should bother wasting harddrive space with swapping on a system with this much memory. swap files are used after physical memory is full and is much slower. with 2GB of memory, is your system really using all of this at any one time? if you really want to have a swap file i would definetly not make it 4GB. maybe 0.5GB.

just my opinion.
 
Old 06-13-2006, 04:43 AM   #3
MarioT
Member
 
Registered: May 2004
Posts: 52

Rep: Reputation: 15
The best would be to create another swap partition.
If you realy want swap file...

dd if=/dev/zero of=swapfile bs=1024 count=X

where X is number of blocks

chmod 600 swapfile

mkswap swapfile

swapon swapfile


edit your fstab

/your_dir/swapfile swap swap defaults 0 0
 
Old 06-13-2006, 08:04 AM   #4
froggo
LQ Newbie
 
Registered: May 2005
Posts: 28

Original Poster
Rep: Reputation: 15
Hey thanks alot works great
 
  


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
mem and swap usage increasing daily epoo Linux - General 5 05-01-2005 11:49 PM
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 the swap space after installing linux LinToWinWin Linux - Newbie 4 08-03-2004 09:51 PM
Increasing swap partition suneet123 Linux - Software 3 12-16-2002 03:11 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat

All times are GMT -5. The time now is 01: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