Date: Tue, 27 Feb 2018 17:32:18 +0000 From: Steve O'Hara-Smith <steve@sohara.org> To: RW <rwmaillists@googlemail.com> Cc: RW via freebsd-questions <freebsd-questions@freebsd.org> Subject: Re: Compiling Swap space Message-ID: <20180227173218.bc809e410082d0a669a0d867@sohara.org> In-Reply-To: <20180227131601.10253820@gumby.homeunix.com> References: <20180227040015.7d2fb579.freebsd@edvax.de> <20180227052346.B49171D9E572@ary.qy> <20180227080919.7a5578283960bb325b9b3d86@sohara.org> <20180227131601.10253820@gumby.homeunix.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 27 Feb 2018 13:16:01 +0000 RW via freebsd-questions <freebsd-questions@freebsd.org> wrote: > On Tue, 27 Feb 2018 08:09:19 +0000 > Steve O'Hara-Smith wrote: > > > On 27 Feb 2018 00:23:46 -0500 > > "John Levine" <johnl@iecc.com> wrote: > > > > You can also use mdconfig to make an md device backed by a file and > > > swap on that. That's slower than a swap partition since it has to > > > > You don't need mdconfig, just make a large file and use > > swapon like this: > > > > # dd if=/dev/zero of=swapfile bs=1m count=1024 > > # swapon swapfile > > > I tried that and got: > > # swapon swapfile > swapon: swapfile: Block device required Hmm, I used to use swap files a lot and it worked when I tried it earlier ... repeating hmmm interesting: [root@steve /home/steve]# dd if=/dev/zero of=swapfile bs=1m count=128 128+0 records in 128+0 records out 134217728 bytes transferred in 7.005077 secs (19160066 bytes/sec) [root@steve /home/steve]# swapon swapfile [root@steve /home/steve]# swapinfo Device 1K-blocks Used Avail Capacity <NFSfile> 131072 0 131072 0% [root@steve /home/steve]# swapoff swapfile I'd forgotten I was in an NFS mounted directory when I tried it earlier and got the expected result. So you can swap onto a file in an NFS mounted directory but not a local file - bizarre! -- Steve O'Hara-Smith <steve@sohara.org>
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20180227173218.bc809e410082d0a669a0d867>