Swap devices

Swap devices

Post by Matthew L Creec » Fri, 01 Dec 2000 18:14:31

When installing OpenBSD, I assumed that my swap drive had been set up -
I used fdisk to create a partition of x bytes in swap formatted it
during the install, and it's now shown as /dev/wd0b under disklabel.
When I type swapctl -l it spits this out:
#swapctl -l
Device          512-blocks      Used    Avail   Capacity        Priority
swap_device     316065          8       316057  0%              0

This is the correct size for my wd0b partition.  However, reading the
FAQs at openbsd.org I found a section on swap files
(http://www.openbsd.com/faq/faq14.html#14.4) that talked about setting
up a vnode in order to swap.  Is this required?  When I try to do it it
just creates two devices to swap to, one the original 'swap_device' and
the other my newly created '/dev/vnd0c', both with the same properties.
So it would seem to me that swap_device is already set up to swap
properly, but in this case why the whole thing in the FAQ about setting
up /dev/vnd0?  The document says:

This shows the devices currently being used for swapping and their
current statistics. In the above example there is only one device named
"swap_device". This is the predefined area on disk that is used for
swapping. (Shows up as partition b when viewing disklabels) As you can
also see in the above example, that device isn't getting much use at the
moment. But for the purposes of this document, we will act as if an
extra 32M is needed.

They then go on, however, to set up /dev/wd0b as the device they
associate with a vnode and thereby swap to.  What's the point of this?
I'm just confused as to how the whole swapping scheme works, any help's

Matthew L Creech


1. 2.5.30 swaps with no swap device mounted!!

Due to the natural slab shootdown laziness issues, I turned off swap.
The kernel reported that it had successfully unmounted the swap device,
and for several days ran without it. Tonight, it went 91MB into swap
on the supposedly unmounted swap device!

Yeah, it's 2.5.30, but this wasn't a crashbox that did it, and no one's
touched swap for a while anyway.

I'm about to hit the sack, so hopefully someone else can look into it
while I'm resting. This one will probably be a PITA to reproduce and I
already shot down one bad bug tonight anyway.

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

2. nscd tuning

3. reasons for failed initialization of swap-device

4. cdrom last bytes

5. Hot Swapping Devices in options bay

6. Samba help/question

7. Is UNIX WS swap device a security leak?

8. Quadrate24

9. Setting swap device priority - how?

10. System Dump Memory Image in Swap Device after Panic on SCO 3.2.2

11. /dos/386spart.par as swap device ok?

12. swap device question

13. getting my swap device set to /dev/hdc1 on bootup