Subject: Re: Using /dev/vnd0* for swap?
To: Robert Kennedy <robert@cs.stanford.edu>
From: Ken Hornstein <kenh@cmf.nrl.navy.mil>
List: netbsd-help
Date: 04/04/1996 18:14:28
>The first issue I run up against is that I don't know how to build a
>regular file of the appropriate size. There appears to be no 'mkfile'
>under NetBSD (or any BSD?), so I just 'cat'ted  together enough copies
>of a big file to account for the amount of space I wanted.

Something like:

dd if=/dev/zero of=/usr/swapspace bs=1k count=1024

Is what I generally use.

>The
>vnconfig -c -v /dev/vnd0a /usr/tmp/swapspace
>command seems to go fine, and it tells me it's found the number of
>bytes of space in the file.
>
>The next step, I imagine, would be to disklabel the vnode 'disk', but
>disklabel complains that some ioctl is inappropriate for the device
>(sorry -- I don't have the exact message with me). If I try to run
>'swapon' on the device, that command complains that the device is not
>configured. The express purpose of vnconfig, according to the man
>page, is to *configure* the device, and I didn't get any error
>messages from vnconfig, so the device damn well ought to be
>configured. It would therefore seem to be a bug that I get 'device not
>configured' messages from swapon after I have configured the device
>with vnconfig.

I believe that with the right usage of -w and -r, you can write a disklabel
on that disk.  At one time, the install kits used a vnd to build a floppy
image - perhaps looking in there would help some?

But the _real_ problem is that the "Device not configured" message means
that vnd0 isn't compiled into the kernel as a swap device.  (Is this
a misleading error message?  You bet).  You need to put something like
this in your kernel config file:

config netbsd root on sd0 swap on sd0 and vnd0

(Not sure if this is the exact syntax, but you get the idea).

--Ken