Kernel Building and config

Chris Siebenmann cks at white.toronto.edu
Wed Apr 26 05:55:47 AEST 1989


At least on Ultrix 2.2, I found out you had to do TWO things to get the
kernel to swap on more than one partition:

You had to build a kernel configured to swap on your chosen partitions.
This has to be done because the kernel sizes up your total possible swap
space (and allocates data structures based on this size) only at boot
time. To do this, it has to look at how big each swap partition is, so it
has to know what they are.

 For example, the config file for our fileserver (a Vaxserver 3600)
has the config line
	# Our normal VMUNIX; two swap areas (drive 0 and drive 1) with the
	# root on drive 0.
	config	vmunix	root on ra0a  swap on ra0b and ra1b    dumps on ra0b
to enable the kernel to swap on partition b of both our RA82 disks.

However, when the system comes up, it only starts swapping on the first
partition specified -- presumably this is so a single-user boot only
relies on having one disk up and running, instead of all of the disks the
kernel swaps on.

So, you have to enable swapping on the additional partitions via the
swapon(2) system call. This is done by using /etc/swapon in /etc/rc;
usually "/etc/swapon -a" to take all the partitions of type swap from
/etc/fstab and have the kernel start swapping on them.

If you omit the config step, /etc/swapon gives an error (the kernel checks
to see if the partition you're trying to start swapping on has been
configured in and aborts if it hasn't). If you omit the /etc/swapon step,
you get a kernel which is all ready to swap on additional partitions, but
hasn't had them enabled yet.

I hope this has been useful in clearing up some of the confusion.

[Note: I have checked manpages on SunOS 3.5 and 4.0 systems, and
swapon(2) and swapon(8) are documented there. I haven't actually had
to configure a Sun for multi-partion swapping, but the 3.5 kernel
source for that bit looks the same as the Ultrix and 4.3BSD source.]
-- 
	"I shall clasp my hands together and bow to the corners of the world."
			Number Ten Ox, "Bridge of Birds"
Chris Siebenmann		...!utgpu!{ncrcan,ontmoh!moore}!ziebmef!cks
cks at white.toronto.edu	     or ...!utgpu!{,csri!}cks

[[ I don't know about anybody else, but when we configured a kernel for a
4.0.1 system, we had to use the following string in the config line:
"swap on xy0b swap on xy1b".  Using "and" was not sufficient.  But we may
have just been suffering from brain damage at the time.  --wnl ]]



More information about the Comp.sys.sun mailing list