Subject: Re: fstab swap
To: Tim Rightnour <root@garbled.futureone.com>
From: Patrick Welche <prlw1@cam.ac.uk>
List: netbsd-help
Date: 12/03/1997 11:15:53
Tim Rightnour wrote:
> 
> On 02-Dec-97 Patrick Welche spoke unto us all:
> # > What is the correct line in fstab to enable swap?
> # 
> # /dev/xxxx none swap sw 0 0
> # 
> # where eg., xxxx=sd0b for scsi disk etc.
> # 
> 
> Ok.. i'll bite: What would be the correct fstab line to use a *file* for swap..
>  (ie like in diskless, but for this example, lets assume its on a local
> machine.)
> 
> #ifdef RAMBLE
> Would it be wiser to make it into some sort of vnode and mount it as swap
> thusly?  (might that fix the nfs swap problem?)  I'll try thursday when I'm off
> work..
> #endif

I just tried:

quartz# dd if=/dev/zero of=/tmp/swap.fs count=2880
2880+0 records in
2880+0 records out
1474560 bytes transferred in 1 secs (1474560 bytes/sec)
quartz# vnconfig -c -t swapfloppy vnd0 /tmp/swap.fs
quartz# disklabel -w -r vnd0 swapfloppy
quartz# swapctl -l
Device      512-blocks     Used    Avail Capacity  Priority
/dev/sd0b       204800        8   204792     0%    0
quartz# swapctl -a /dev/vnd0a
quartz# swapctl -l
Device      512-blocks     Used    Avail Capacity  Priority
/dev/sd0b       204800        8   204792     0%    0
/dev/vnd0a        2880        8     2872     0%    0
Total           207680       16   207664     0%

and the entry in /etc/disktab is just

swapfloppy|3in|3.5in High Density Floppy:\
        :ty=floppy:se#512:nt#2:rm#300:ns#18:nc#80:\
        :pa#2880:oa#0:ba#4096:fa#512:ta=swap:\
        :pb#2880:ob#0:\
        :pc#2880:oc#0:

the same as an ordinary 3.5in floppy with 4.2BSD changed to swap. I
don't know what the "nfs swap problem" is, but the file->vnode->swap
works :) Trouble is swapctl -d doesn't work, so I'm stuck with an
extra 1.4Mb swap...

Cheers,

 Patrick