LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 02-13-2007, 10:07 AM   #1
FSoftware Lover
LQ Newbie
 
Registered: Aug 2006
Posts: 12

Rep: Reputation: 0
Is swap a file system?


Is swap itself a file system at all?
 
Old 02-13-2007, 10:51 AM   #2
wpn146
Member
 
Registered: Jan 2005
Distribution: Solaris, Linux Fedora Core 6
Posts: 170

Rep: Reputation: 30
Normally, no.

The exception would be if you were using a regular file for swap. (Uncommon.)
 
Old 02-13-2007, 02:41 PM   #3
trickykid
Guru
 
Registered: Jan 2001
Posts: 24,133

Rep: Reputation: 199Reputation: 199
Treat swap as a raw partition or format.
 
Old 02-13-2007, 04:08 PM   #4
apolinsky
Member
 
Registered: Oct 2004
Location: Brooklyn
Distribution: Slackware 13.1,12.1,12.2; Debian Sqeeze; Centos 5,6
Posts: 254

Rep: Reputation: 34
Though your answer is correct as far as Linux and freebsd goes, it is INCORRECT when examining Solaris. Under Solaris 8, and I assume later revisions also, /tmp is also used as swap space. There is no separate /swap partition. We've been burned more than once at work with people putting large files in /tmp for 'temporary' storage, and having our large E15K slow down significantly.

I've never quite understood the reasoning behind Sun's choice.
 
Old 02-13-2007, 04:18 PM   #5
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728
I would assume that the kernel is doing low-level writes to swap--using the equivalent of dd. Thus it only needs to know what zone on the disk it is allowed to use.
 
Old 02-13-2007, 05:43 PM   #6
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 12,446

Rep: Reputation: 1068Reputation: 1068Reputation: 1068Reputation: 1068Reputation: 1068Reputation: 1068Reputation: 1068Reputation: 1068
Quote:
Originally Posted by apolinsky
Though your answer is correct as far as Linux and freebsd goes, it is INCORRECT when examining Solaris. Under Solaris 8, and I assume later revisions also, /tmp is also used as swap space. There is no separate /swap partition. We've been burned more than once at work with people putting large files in /tmp for 'temporary' storage, and having our large E15K slow down significantly.
Well, given that this is "Linux - General" who cares about Solaris ... ???
All jokes aside, that does sound *interesting*. I did install Solaris 10 when it first went public, but it didn't appeal, so I haven't bothered looking at it since.
Quote:
I've never quite understood the reasoning behind Sun's choice.
Where's jilliagre when needed ???.
 
Old 02-14-2007, 03:19 AM   #7
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris10, Solaris 11, Mint, OL
Posts: 9,522

Rep: Reputation: 365Reputation: 365Reputation: 365Reputation: 365
Quote:
Originally Posted by syg00
Where's jlliagre when needed ???.
I'm here
Quote:
Originally Posted by apolinsky
Though your answer is correct as far as Linux and freebsd goes, it is INCORRECT when examining Solaris.
Nope, swap partitions are very similars whatever the Unix variant.
With Linux, while not a real filesystem the swap partition must have a structure which is created with the "mkswap" command. Solaris and probably *BSD have no such requirement.
Quote:
Under Solaris 8, and I assume later revisions also, /tmp is also used as swap space. There is no separate /swap partition.
That's the way around. It isn't /tmp that is used as swap space, but swap space that may be used to store temporary files. This is happening only if no more RAM is available.
Quote:
We've been burned more than once at work with people putting large files in /tmp for 'temporary' storage, and having our large E15K slow down significantly.
It's curious to hear of such a poor configuration on that class of server. /tmp VM usage can simply be capped to avoid RAM exhaustion with the size=xxx mount option.
Quote:
I've never quite understood the reasoning behind Sun's choice.
The reasoning is to have very fast read/write performance for temporary files, by storing them in virtual memory, which is RAM in nominal case, and not on disk.
By the way, this Solaris feature has been implemented later by linux http://wiki.linuxquestions.org/wiki/Tmpfs , so it mustn't be that bad

Last edited by jlliagre; 02-14-2007 at 12:39 PM.
 
Old 02-14-2007, 04:10 AM   #8
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 12,446

Rep: Reputation: 1068Reputation: 1068Reputation: 1068Reputation: 1068Reputation: 1068Reputation: 1068Reputation: 1068Reputation: 1068
Allow me to disagree - recent thread here.
It may be proposed regularly, but I don't like the concept.
 
Old 02-14-2007, 04:56 AM   #9
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris10, Solaris 11, Mint, OL
Posts: 9,522

Rep: Reputation: 365Reputation: 365Reputation: 365Reputation: 365
Quote:
Originally Posted by syg00
Allow me to disagree
About what ?
Quote:
- recent thread here.
Sure, a machine with so little RAM available will not take advantage of tmpfs. Just the opposite actually.
tmpfs is a feature you can use on linux or Solaris, but it is not mandatory in either. It can easily be disabled on Solaris if RAM is sparse.
Quote:
It may be proposed regularly, but I don't like the concept.
The concept is to enhance performance, and it saves energy.
Why don't you like it ?
 
Old 02-14-2007, 05:23 AM   #10
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 12,446

Rep: Reputation: 1068Reputation: 1068Reputation: 1068Reputation: 1068Reputation: 1068Reputation: 1068Reputation: 1068Reputation: 1068
Polluting the page cache cannot be a good thing.
Linux has aweful (non-existant) performance/tuning metrics. The effects can't be measured. Hence I don't like the concept of using (real) storage for temporary file systems.

Every so often I get the feeling that things like Dtrace might just convince me to go back and look at Solaris again.
 
Old 02-14-2007, 05:39 AM   #11
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris10, Solaris 11, Mint, OL
Posts: 9,522

Rep: Reputation: 365Reputation: 365Reputation: 365Reputation: 365
Quote:
Originally Posted by syg00
Polluting the page cache cannot be a good thing.
I'm missing how application temporary data relates to pollution.
Quote:
Linux has aweful (non-existant) performance/tuning metrics. The effects can't be measured. Hence I don't like the concept of using (real) storage for temporary file systems.
Then you support tmpfs, which does its best to avoid using real storage for temporary files, or am I missing something ?
Quote:
Every so often I get the feeling that things like Dtrace might just convince me to go back and look at Solaris again.
Add ZFS and zones to the list
 
Old 02-14-2007, 11:19 AM   #12
FSoftware Lover
LQ Newbie
 
Registered: Aug 2006
Posts: 12

Original Poster
Rep: Reputation: 0
PLease answer my question exactly!
I expected that you focus only on it
Is swap a File System eventually or not?
 
Old 02-14-2007, 12:22 PM   #13
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728
Quote:
Originally Posted by FSoftware Lover
PLease answer my question exactly!
I expected that you focus only on it
Is swap a File System eventually or not?
You will not get much help here with this kind of belligerent behavior.
Suggestions:
  1. Read what has already been posted and ask questions
  2. Say "please" and "thank you"
 
Old 02-14-2007, 12:34 PM   #14
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris10, Solaris 11, Mint, OL
Posts: 9,522

Rep: Reputation: 365Reputation: 365Reputation: 365Reputation: 365
Quote:
Originally Posted by FSoftware Lover
PLease answer my question exactly!
Hasn't it been answered ?
Quote:
I expected that you focus only on it
You expected wrong. Your question was less interesting (at least to me) than the debate it triggered.
Quote:
Is swap a File System eventually or not?
No, it has never been, and likely never will.
Swap is meant to store pages of memory that can't stay in RAM for some reason. Pages aren't files. Using a filesystem to store them would be overkill.

Last edited by jlliagre; 02-14-2007 at 03:13 PM.
 
Old 02-14-2007, 12:35 PM   #15
Gethyn
Member
 
Registered: Aug 2003
Location: UK
Distribution: (X)Ubuntu 10.04/10.10, Debian 5, CentOS 5
Posts: 900

Rep: Reputation: 32
I thought FSoftware Lover was making a bit of a joke with that last post, and to be fair to him/her this thread does seem to have wandered a little off topic. FSoftware Lover, why do you ask? As someone already mentioned, as far as I am aware a Linux swap partition has some kind of structure, and in that sense is a filesystem. By contrast, an OpenBSD (and presumably some other BSDs) swap partition is just raw data.
 
  


Reply

Tags
file, swap, system


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 On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Need Help Increasing Swap by creating a swap file froggo Red Hat 3 06-13-2006 09:04 AM
when does linux switch from realmode file system to protectedmode file system sitthar Linux - General 3 04-08-2006 09:05 AM
figuring out 'file system' and 'swap file system' types TrulyTessa Linux - Newbie 3 09-26-2005 07:46 PM
swap file system gaganvyas Linux - General 2 07-18-2005 08:15 AM


All times are GMT -5. The time now is 01:39 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration