Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Click here to return to the 'Confused? swap partitions huh!?' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Confused? swap partitions huh!?
Authored by: lerici on May 13, '01 06:32:48PM

Okay swappees what's cookin?

I've read a number of these "swap partition" articles and i guess I am confused.
The strategy seems to involve setting it up using the /etc/rc resource configuration
script. But I would think that the right way would actually be to set aside a separate
ufs partition with the formatter and then setting the swap area in /etc/fstab...

Here is my problem:

The manpage indicates that there should be only one /etc/fstab Mac OS X must be
far advanced beyond berkeley.. it has three.. LOL

/dev/hd0a / ufs rw 1 1
/dev/hd0e /var ufs rw 1 2
/dev/hd0f /usr ufs rw 1 2
/dev/hd0d /tmp mfs rw,-s=12000,-b=8192,-f=1024,-T=sd660 0 0

/dev/rd0a / ufs rw 1 1
/dev/rd0e /usr ufs rw 1 2
/dev/rd0f /var ufs rw 1 2
/dev/rd0d /tmp mfs rw,-s=12000,-b=8192,-f=1024,-T=rd335 0 0
/dev/sd0a / ufs rw 1 1
/dev/sd0e /var ufs rw 1 2
/dev/sd0f /usr ufs rw 1 2
/dev/sd0d /tmp mfs rw,-s=12000,-b=8192,-f=1024,-T=sd660 0 0

Oh in case you are wondering about /tmp.. I guess an mfs is a memory file system. I suppose that this means it may, i repeat *may*, indicate that it is really a tmpfs which is typically created within the swap partition and files.. yep.. that may mean you need extra space within your swap partition to allow for heavy use of the /tmp directory. In UNIX typically every application drops its temporary files in that directory.. but OS X is a distant relative and may have lots of locations for temporary files.. who knows?

Okay, how would you typically set up the swap partition if you were to use /etc/fstab. Okay, let's look at the manpage. (oh btw Apple has informed that they do not, repeat do not support the UNIX OS only the GUI. So, until Apple developers have some free time to interact with the faithful..)

oh, the manpage: fstab sez that yes indeed there is a "swap" type partition which means that /etc/fstab may be used! There is even a "union" or translucent type partition.. this one
is scary don't ask.. it is something SUN contrived and later dropped. LOL

so how would you configure your swap partition?

okay.. well we have 3 fstab files? btw, this seems extremely silly. there is no documentation on why this would be but it adds a level of complexity to managing file systems which may indicate a poor design.

well alright let's look and see what those files say.. hmm how can you put things in fstab which df does not see.. that means they aren't mountable.. what are they doing in fstab? This seems like a bug to me.. but it could be that I just don't understand??????

Would some kind soul enlighten me? I am tempted to "hack" my way through this sans documentation but I am liking what I have so far under MAC OS X and I am afraid I might break something.. LOL.. BUT it would be nice if it really behaved like UNIX?

Thanks in advance,

[ Reply to This | # ]
Confused? swap partitions huh!?
Authored by: patpro on May 25, '01 07:29:05AM

for further info you should take a look at

As OSX swap mechanism is inherited from NeXT's one, it's of great interest to read these docs.

[ Reply to This | # ]
Confused? swap partitions huh!?
Authored by: Earl on Feb 08, '02 07:31:25AM


Also, go to and search the developers and users forums there for fstab and swapfile.

One of the developers plainly states that fstab does not do what you might think it does in Darwin, and explains why the methods involving changes to /etc/rc - while not what they originally had in mind - are AOK.

The idea of just specifying it in fstab would basically work for any of the other Unices I've seen - wait - they all do that but Darwin! :)

[ Reply to This | # ]
Confused? swap partitions huh!?
Authored by: Earl on Feb 08, '02 07:37:45AM

It's also important to stress that Darwin does not support swap partitions, only swapfiles. Also, Darwin's swapfiles are managed dynamically, so they can grow or shrink as needed - in about 80MB chunks.

The man pages might work for application level stuff, but for system's stuff, go to the Apple developer pages and the darwinfo site. As is often the case, the man pages aren't keeping up. (And I don't knock Apple for this. The heralded Linux - which I also use and like - is rife with "note this manpage is no longer being maintained...")

[ Reply to This | # ]