Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 25 May 2000 13:46:06 -0400
From:      Brian McGovern <bmcgover@cisco.com>
To:        brendan@bmk.com.au
Cc:        questions@freebsd.org
Subject:   Re: How do I set up a swap file ?
Message-ID:  <200005251746.NAA52096@bmcgover-pc.cisco.com>

next in thread | raw e-mail | index | archive | help
>
> I want to set up a swap file ( ie. a file on an existing ufs ) to be
> used as additional swap space.
> 

The easiest (and only) way I can think of doing it is to use the vn device,
so you'd do something like:

dd if=/dev/zero of=/<blah>/swapfile bs=1024 count=262144
vnconfig /dev/vn0 /<blah>/swapfile
swapon /dev/vn0c

In short, the first line creates a swap file. In this case, it should be
~256MB, unless I did my path wrong (possible).

The second like uses the vn driver to map your file to the /dev/vn* devices.

The third line tells swapon to add this "device" as swap space.

Overall, it'll work, as I've used this method before. However, there will be
quite a performance hit over a native swap partition.

	-Brian


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200005251746.NAA52096>