[comp.sys.sun] Help with swapon

micky@cunixc.cc.columbia.edu (Micky Liu) (02/22/89)

I have a Sun 3/140 running SunOS 3.5 with two disk drives.  Previously I
had the kernal configured to use swap partitions on both drives with
something like "swap on sd0 and sd2"...  Lately, (with some other
problems) I thought it would be nice if I could actually boot off of
either drive seperately, but under normal operations I would still like to
have a swap area on both drives.

My plan was to rebuild the kernal with "swap generic" and just add a
"swapon -a" in my rc.local.  When I do this, however, I get something
like: /dev/sd2b no device...

nAny clues?  If I try to invoke "swapon /dev/sd2b" directly I get some
block device error...

If I ever get this part to work, what portions of the root are absolutely
necessary to have my Sun boot?  

Thanx,

Micky Liu

  arpa: micky@cunixc.cc.columbia.edu
  uucp: ...!rutgers!columbia!eastend!m-liu
bitnet: malua@cuvmc

jpt@uf.msc.umn.edu (Joseph Thomas) (03/06/89)

We had a similar desire to use a "swap generic" kernel and add swap areas
based on the system/disk we happend to be running off of. It can be done,
assuming you have source. I suspect that you could patch /vmunix to do
something similar, but that would be much harder. 

What happens is that the kernel builds a table of swap devices at compile
time. When the system is booted, it reads the geometry of these devices
and fills in the block counts. You can't add devies to the generic swap
kernel because it hits the end of the device table.

We "drove around" this problem by rewritting the code to treat the end of
table value differently. The compile phase now leaves all slots available
for swapping ( instead of one "generic" one ) and assumes a very large
maximum number of swapping blocks. [ As I recall, there was also a bug in
swapon which set the user proc error code in the wrong place, which caused
funny errors to come back. ]

An Aside:

What's the general story on posting kernel diffs ?? [ I would assume that
if someone were to send me a copy of their source license, I could then
send back the complete file ??? ]


Joseph Thomas
Minnesota Supercomputer Center
jpt@msc.umn.edu
612/626-1888

guy@uunet.uu.net (Guy Harris) (03/16/89)

 > What happens is that the kernel builds a table of swap devices at compile
 > time. When the system is booted, it reads the geometry of these devices
 > and fills in the block counts. You can't add devies to the generic swap
 > kernel because it hits the end of the device table.

"Fixed in 4.0."  No such table exists in 4.0.