SUMMARY: second swap partition possible?

From: Mike McFaul (mikey@ccs.carleton.ca)
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:

        /usr/sys/`arch`/`hostname`|GENERIC/confvmunix.c

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

or:

        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)
kuno@caen.engin.umich.edu (Harumi Anne Kuno )
"Manavendra K. Thakur" <thakur@zerkalo.harvard.edu>
David.Miner@East.Sun.COM (Dave Miner)
daryl@oceanus.mitre.org (Daryl Crandall)
kensmith@cs.Buffalo.EDU (Ken Smith)
kuno@caen.engin.umich.edu (Harumi Anne Kuno )
jmcarli@srv.PacBell.COM (Jerry M. Carlin)
keves@meaddata.com (Brian Keves - Consultant)
pomeranz@isis.dccs.upenn.edu (Hal Pomeranz)
"Ric Anderson" <ric@cs.arizona.edu>
jaisimha@george.ee.washington.edu
rodney@snowhite.cis.uoguelph.ca (barking at airplanes)
thor@thor.atd.ucar.edu
ddull@Rational.COM (David Dull)
richard@st.unocal.com (Richard Seegmiller)
mikulska@ece.UCSD.EDU (Margaret Mikulska)
Jim Mattson <mattson@cs.UCSD.EDU>
matt@mozart.asd.contel.com (Matthew S.Granger)
Steve Hanson <hanson@calvin.fnal.gov>
ssi!ssiwest!spott@uunet.UU.NET (Dave Spott)
matt@wbst845e.xerox.com (Matt Goheen)
Stephen.Lopez@West.Sun.COM (Steve Lopez SSE InsaneDiego)
Chip Christian <chip@allegra.att.com>
sgp@phyast.nhn.uoknor.edu (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!gorpong@oddjob.uchicago.edu>
B.Rea@csc.canterbury.ac.nz
"S. Frick, Ericsson Telecom" <ETXFRICK@eds.ericsson.se>
Michael S. Maiten <msm@Energetic.COM>
sl_mnl@sl.dth.dk (Morten Norby Larsen)
claude@genethon.genethon.fr (Claude Scarpelli)
gt1111a@prism.gatech.edu (Vincent Fox)
Chris Dodd <dodd@csl.sri.com>
ekrell@ulysses.att.com
ghazi@cs.rutgers.edu
ravi@progress.COM (Ravi-Chandar Ramalingam)
poffen@sj.ate.slb.com (Russ Poffenberger)
jackal@keps.kodak.com (Phil Hammar)
blc@sol.med.ge.com (Brett Chapman x7-4391)
karl@grebyn.com (Karl A. Nyberg)
fpolizo@netcom.com (Fred Polizo)
jth@ll.mit.edu (Joe Healey)
guy@auspex.com (Guy Harris)



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