Welcome to the most active Linux Forum on the web.
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 03-18-2004, 07:29 AM   #1
Registered: Jan 2004
Posts: 409

Rep: Reputation: 30
swap & /tmp

What is the difference between swap and /tmp ?

Should i always create a separate partition for /tmp and how big this must be?
Old 03-18-2004, 07:41 AM   #2
Senior Member
Registered: Mar 2004
Location: england
Distribution: NetBSD, Void, Debian, Mint, Ubuntu, Puppy, Raspbian
Posts: 3,487

Rep: Reputation: 224Reputation: 224Reputation: 224
swap is used by the OS kernel. when it runs out of memory
it uses it as temporary storage. You can't touch it.
/tmp is just a general users/programs temp area
anyone can use it.

you don't need a /tmp partition.
a seperate /home partition is a good idea at least though.

Old 03-18-2004, 07:41 AM   #3
Registered: Aug 2003
Location: Dunedin NZ
Distribution: Mint 13 Cinnamon
Posts: 653

Rep: Reputation: 31
The swap partition is like virtual memory and /tmp is a place where Linux stores temporary files (like Windows Paging file and Temp directory). /tmp does not have to be on a separate partition and the Swap partition should be 2x the physical ram up to 500MB.

Old 03-18-2004, 07:57 AM   #4
Registered: Jan 2002
Location: Missoula. Montana, USA
Distribution: Slackware (various)
Posts: 458

Rep: Reputation: 42
Swap does not have to be 2x the physical memory, though that should be safe with most situations. Personally, I have 320 MB of ram, and 176 MB of swap, and given that this is my home machine where I do not use many memory intensive applications (besides mozilla), the following (with fedora 1) is about as full as I have ever seen swap:

$ free
total used free shared buffers cached
Mem: 322132 305280 16852 0 36908 123200
-/+ buffers/cache: 145172 176960
Swap: 177876 85660 92216
$ swapon -s
Filename Type Size Used Priority
/dev/sdf8 partition 49436 28576 2
/dev/sdc1 partition 64220 28480 2
/dev/sda5 partition 64220 28604 2

Since I am now getting up to about 50% swap usage, I am thinking of adding a bit more swap, maybe to about the equivalent of memory. If I added more memory, I would need less swap. I had a work machine once however, where I needed 3X swap (back when memory was expensive). The point is, just keep an eye occasionally on the usage to fit your own needs.
Old 03-18-2004, 10:28 AM   #5
Registered: Jan 2004
Posts: 409

Original Poster
Rep: Reputation: 30
thank you for your help guys!!


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
kde, /tmp, /var/tmp and all that garba Linux - Software 4 06-17-2005 12:31 PM
reinstall --> /tmp & noexec issue Fuel Slackware 1 11-30-2004 10:43 PM
"/tmp/sv001.tmp/setup.bin" error while installing OO1.1.0 Choey Linux - Software 0 09-16-2003 04:52 PM
Numerous scb_*.tmp files in /tmp dburk Programming 3 08-18-2003 04:28 PM
Newbie question - /tmp /var/tmp Mr happy Linux - Security 3 01-27-2003 01:03 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:48 PM.

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