SUMMARY: second swap partition possible?

From: Mike McFaul (
Date: Sun Jun 30 1991 - 01:45:08 CDT

Original article:

>I've got an IPC running 4.1.1 rev b and I have an external disk (I had
>a 386i with an internal 90Meg drive and a shoebox expansion unit). Well
>I put my 90Meg into the shoebox and then decided to have 2 swap partitions,
>one on my 207Meg drive (sd0) and one on my 90Meg (sd2). I know about swap
>files but the 90 is so small (its all relative eh!) that I loose too much
>to 'inode-overhead' when I build a file system for a swap file. I checked
>out the man pages for '/usr/etc/config' and it mentions that I could have
>2 swap partitions by using the line:
> config vmunix swap on sd0 swap on sd2
>in my kernal configuration. Well I tried this and it always uses the second
>swap specification. I've been checking out some files and it looks like
>I'm only allowed to have 1 specification. Is this a bug in 'config' or a
>bogus man page?

Well there is no problem with having more than one swap partition. My
original message did not quite have enough information in it. I am
quite familliar with swap files, but as was pointed out a swap file
is not as good as a swap partition. You save disk space with a swap
parition and it should be faster because there is no file system the
system has to work though. Both the swap file and second swap partition
are done with the same kind of entry in the /etc/fstab file and the
'swapon -a' command.

Swap file fstab entry:

        /files/swapfile swap swap rw 0 0

Swap partition fstab entry:

        /dev/sd2b swap swap rw 0 0 (my second drive is sd2)

The generic swap code in the kernal must see the device reference and
handle the swap partition differently than the swap file. The fstab
definitions look the same except for the 'swap target'. Looking back on
the man pages this is all apparent, but if you don't know you can do this,
you may never figure it out. There appears to be no limit to the number
of swap partitions/files you can add dynamically (the swapon command).

The man pages for the /etc/config command are incorrect. They explicitly
state the possibilty of more than one swap partition. This is incorrect,
the code that the /etc/config program only has one data structure for
'root', 'swap', and 'dump' -- see the file:


for or the structure declarations. As well a suggestion of the config
line of:

        config vmunix swap on sd0b and sd2b

generates a syntax error from /etc/config (SunOS 4.1.1 rev b). As well the
addition of the 'type spec' verb in the config line appeared to make no
difference in the testing that I did (it worked too!), example:

        config vmunix swap on sd0b


        config vmunix swap on type spec sd0b

By far the best way to set the configure line is to leave it as the in the
GENERIC kernal:

        config vmunix swap generic

Many thanks to those that have responded:

kensmith@cs.Buffalo.EDU (Ken Smith) (Harumi Anne Kuno )
"Manavendra K. Thakur" <>
David.Miner@East.Sun.COM (Dave Miner) (Daryl Crandall)
kensmith@cs.Buffalo.EDU (Ken Smith) (Harumi Anne Kuno )
jmcarli@srv.PacBell.COM (Jerry M. Carlin) (Brian Keves - Consultant) (Hal Pomeranz)
"Ric Anderson" <> (barking at airplanes)
ddull@Rational.COM (David Dull) (Richard Seegmiller)
mikulska@ece.UCSD.EDU (Margaret Mikulska)
Jim Mattson <mattson@cs.UCSD.EDU> (Matthew S.Granger)
Steve Hanson <>
ssi!ssiwest!spott@uunet.UU.NET (Dave Spott) (Matt Goheen)
Stephen.Lopez@West.Sun.COM (Steve Lopez SSE InsaneDiego)
Chip Christian <> (Steven G. Parker)
Jay Plett <jay@Princeton.EDU>
librainc!ho@uunet.UU.NET (Alan K. Ho)
eplrx7!mcneill@uunet.UU.NET (Keith McNeill)
Gordon -v Galligher <ronnoco!>
"S. Frick, Ericsson Telecom" <>
Michael S. Maiten <msm@Energetic.COM> (Morten Norby Larsen) (Claude Scarpelli) (Vincent Fox)
Chris Dodd <>
ravi@progress.COM (Ravi-Chandar Ramalingam) (Russ Poffenberger) (Phil Hammar) (Brett Chapman x7-4391) (Karl A. Nyberg) (Fred Polizo) (Joe Healey) (Guy Harris)

This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:06:21 CDT