From owner-freebsd-current@FreeBSD.ORG Fri Oct 25 15:31:47 2013 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 7711FB29; Fri, 25 Oct 2013 15:31:47 +0000 (UTC) (envelope-from rosti.bsd@gmail.com) Received: from mail-wg0-x235.google.com (mail-wg0-x235.google.com [IPv6:2a00:1450:400c:c00::235]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E49AA2E00; Fri, 25 Oct 2013 15:31:46 +0000 (UTC) Received: by mail-wg0-f53.google.com with SMTP id y10so4015933wgg.20 for ; Fri, 25 Oct 2013 08:31:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=V+Qoif1RklMpCqDzZ+h0qttrF44ZuNVO9tVLddqglDE=; b=pkGzZLtzD8xRfa8zcG7p3S/F6xpwTQibQ9efxmrrrunbHj8riBvUxz6YPhTE+aulCf 9jZ9/3FfOFUsXFacAshJ8bBVHO/HvHj7Ogt3Pee5BL08ZUylka2IJoXG/e+z9dU5he1Z 58S0uYotGlqqwuVPhztkBhKD+S8XFmuPWG62ef//0ifJ/f5BMvy7Fa7BKDi7fi+2JL4+ TI63qYR+/nJkhjTq5CqozwioDUKFK1vBNWwMvXwtrsJM5tAGJAyp95zJiG794Tx0kRnw OI9Lf4+Tgkci+WoACoYIQpbmO7Ryr7kP/TGZEMlManyViPDqrZGPFiAt0YJ7qSbrZRVv 2VsA== MIME-Version: 1.0 X-Received: by 10.194.94.137 with SMTP id dc9mr8166009wjb.38.1382715105361; Fri, 25 Oct 2013 08:31:45 -0700 (PDT) Received: by 10.194.216.2 with HTTP; Fri, 25 Oct 2013 08:31:45 -0700 (PDT) In-Reply-To: References: Date: Fri, 25 Oct 2013 17:31:45 +0200 Message-ID: Subject: Re: Using a swap file From: Rostislav Krasny To: freebsd-current@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Oct 2013 15:31:47 -0000 On Fri, Oct 25, 2013 at 3:50 PM, Rostislav Krasny wrote: > Hi there, > > I've 10.0-BETA1 i386 installed and I want to use a swap file instead > of a swap partition. I created /swapfile and I'm able to enable it > manually by following commands: > > mdconfig -a -t vnode -f /swapfile -u 0 > swapon /dev/md0 > > This is according to the following section of the Handbook: > > http://www.freebsd.org/doc/handbook/adding-swap-space.html > > It still states that adding swapfile="" into > /etc/rc.conf enables that swap file during a boot automatically. > However this is already not true for CURRENT and for the upcoming 10.0 > release. According to following commit number 252310 this rc.conf > parameter is obsolete > > http://svnweb.freebsd.org/base?view=revision&revision=252310 > > It introduces different configuration and offers to add a line like > following into /etc/fstab > > md none swap sw,file=/swapfile 0 0 > > This is what I did but 'swapon -a' still doesn't work. I didn't try to > reboot because I build world in other console. But I believe the > result will be the same, because /etc/rc.d/swap runs the same command: > '/sbin/swapon -aq'. So what is the right way to enable a swap file > during a boot and for commands like 'swapon -a' ? > > Thanks > > P.S. The Handbook needs to be updated After rebooting (into an updated system) the swap file somehow turned on and was running through /dev/md0. Unfortunately after running 'swapoff -a' it is impossibly to turn it back on and /dev/md0 is disappeared. So the swapon(8) program is still broken.