From owner-freebsd-questions@freebsd.org Tue Feb 27 17:32:30 2018 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 519B3F39813 for ; Tue, 27 Feb 2018 17:32:30 +0000 (UTC) (envelope-from 4250.10.freebsd-questions=freebsd.org@email-od.com) Received: from bca5.email-od.com (bca5.email-od.com [207.246.239.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D235C84C8C for ; Tue, 27 Feb 2018 17:32:29 +0000 (UTC) (envelope-from 4250.10.freebsd-questions=freebsd.org@email-od.com) DKIM-Signature: v=1; a=rsa-sha256; d=email-od.com;i=@email-od.com;s=dkim; c=relaxed/relaxed; q=dns/txt; t=1519752750; x=1522344750; h=content-transfer-encoding:content-type:mime-version:references:in-reply-to:message-id:subject:cc:to:from:date:x-thread-info; bh=sH+g+TEkDhWcT+GneyKtQ9NpdVdUCAN0BKNUHPe+eFk=; b=M0MhbCFDAgE6LUSD6fkLW6HpQBuc0WbGp+jhzswyH2bn9x8bSv9ANXzg6NUq4pgOtunDive/iRyJI24whKbJKAvtRHrMnof1GJO1kcVQ3+OJI/EFIjuZXZG5uN6DBOfTJhw7iiMKoMowgIbTGdVQE/YrSdPZBrjqP5AOCqubtPY= X-Thread-Info: NDI1MC4xMi45MjAwMDAwMDNlNzkyYy5mcmVlYnNkLXF1ZXN0aW9ucz1mcmVlYnNkLm9yZw== Received: from r1.sg.in.socketlabs.com (r1.sg.in.socketlabs.com [142.0.179.11]) by bca2.email-od.com with ESMTP(version=Tls12 cipher=Aes256 bits=256); Tue, 27 Feb 2018 12:32:24 -0500 Received: from smtp.lan.sohara.org (EMTPY [89.127.62.20]) by r1.sg.in.socketlabs.com with ESMTP(version=Tls12 cipher=Aes256 bits=256); Tue, 27 Feb 2018 12:32:21 -0500 Received: from [192.168.63.1] (helo=steve.lan.sohara.org) by smtp.lan.sohara.org with smtp (Exim 4.90 (FreeBSD)) (envelope-from ) id 1eqj6w-000FAP-Tx; Tue, 27 Feb 2018 17:32:18 +0000 Date: Tue, 27 Feb 2018 17:32:18 +0000 From: Steve O'Hara-Smith To: RW Cc: RW via freebsd-questions 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> X-Mailer: Sylpheed 3.6.0 (GTK+ 2.24.31; amd64-portbld-freebsd11.0) X-Clacks-Overhead: "GNU Terry Pratchett" Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Feb 2018 17:32:30 -0000 On Tue, 27 Feb 2018 13:16:01 +0000 RW via freebsd-questions 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" 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 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