From owner-freebsd-questions Thu May 25 10:46:12 2000 Delivered-To: freebsd-questions@freebsd.org Received: from funnel.cisco.com (funnel.cisco.com [161.44.131.24]) by hub.freebsd.org (Postfix) with ESMTP id 0994737B54D for ; Thu, 25 May 2000 10:46:10 -0700 (PDT) (envelope-from bmcgover@bmcgover-pc.cisco.com) Received: from bmcgover-pc.cisco.com (bmcgover-pc.cisco.com [161.44.133.25]) by funnel.cisco.com (8.8.5-Cisco.1/8.6.5) with ESMTP id NAA16792; Thu, 25 May 2000 13:46:08 -0400 (EDT) Received: from bmcgover-pc.cisco.com (localhost [127.0.0.1]) by bmcgover-pc.cisco.com (8.9.3/8.9.3) with ESMTP id NAA52096; Thu, 25 May 2000 13:46:06 -0400 (EDT) (envelope-from bmcgover@bmcgover-pc.cisco.com) Message-Id: <200005251746.NAA52096@bmcgover-pc.cisco.com> To: brendan@bmk.com.au Cc: questions@freebsd.org Subject: Re: How do I set up a swap file ? Date: Thu, 25 May 2000 13:46:06 -0400 From: Brian McGovern Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > > 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=//swapfile bs=1024 count=262144 vnconfig /dev/vn0 //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