LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
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 09-17-2004, 12:50 AM   #1
vmniza
LQ Newbie
 
Registered: Feb 2004
Posts: 19

Rep: Reputation: 1
Why should you give the size of the swap disk as twice the size of RAM


When you install Red Hat Linux, you are asked to give the size of your swap partition as twice the size of RAM. why is it so?

I read some where that you can use a fixed length file in a file system as a swap area. How do you specify it when you install Linux?
 
Old 09-17-2004, 01:04 AM   #2
Bruce Hill
HCL Maintainer
 
Registered: Jun 2003
Location: McCalla, AL, USA
Distribution: Arch, Gentoo
Posts: 6,940

Rep: Reputation: 129Reputation: 129
Welcome to LQ!

Quote:
Originally posted by vmniza
When you install Red Hat Linux, you are asked to give the size of your swap partition as twice the size of RAM. why is it so?
That was an old rule. What the kernel does is switch to virtual memory
(swap partition) when you run out of physical memory. How much swap
you need depends upon your amount of ram and applications. My comp
has 1GB of ram, and I use apps like The GIMP and Scribus which do require
a lot of memory, as well as having Mozilla Firefox, KMail, several xterms,
xmms, and other apps running at the same time. To my knowledge, even
with GIMP working on a 75MB file, I've never gone over my 1GB of memory
and into swap. Still, I make a 1GB swap partition. This really depends upon
what you use your comp for, and how much physical memory you have.
Quote:
I read some where that you can use a fixed length file in a file system as a swap area. How do you specify it when you install Linux?
Don't know that I've ever read that. Can you post a link?
 
Old 09-17-2004, 01:35 AM   #3
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,290

Rep: Reputation: 378Reputation: 378Reputation: 378Reputation: 378
I don't know how to make a swap file on install, but it's easy to set it up on the first boot. Something like,

dd if=/dev/zero of=/swap/file bs=512 count=<# of 512 byte blocks in the swapfile>
chown root:root /swap/file
chmod 600 /swap/file # it's bad if non-root folks can read swap space
mkswap /swap/file
swapon /swap/file

And then add it to your fstab to enable it on subsequent reboots.
 
Old 09-17-2004, 02:13 AM   #4
amosf
Senior Member
 
Registered: Jun 2004
Location: Australia
Distribution: Mandriva/Slack - KDE
Posts: 1,672

Rep: Reputation: 46
You want a swap file/partition as big as you need

Depends on what you do. I currently have a gig swap on my 256meg box as I was running low at times and had heaps of drive space...

Not upgrading ram as I'm going to upgrade the MD/CPU shortly anyway...
 
  


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
Swap double size of the RAM zillah Fedora 3 12-24-2005 07:13 AM
Swap double size of the RAM zillah Solaris / OpenSolaris 3 11-22-2005 11:30 AM
/proc/kcore size doesn't match with physical ram size cash_05 Linux - Newbie 2 06-01-2005 01:23 PM
Default RAM disk size jrdioko Linux - Software 3 06-30-2004 05:05 PM
swap disk size Triple-B Slackware 2 02-10-2003 03:04 PM

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

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