Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 25 Oct 2013 17:31:45 +0200
From:      Rostislav Krasny <rosti.bsd@gmail.com>
To:        freebsd-current@freebsd.org
Subject:   Re: Using a swap file
Message-ID:  <CANt7McEHeY0ByUtRN1Mbm7xpxzta9xKfMyHP1mwptQbCKBK_Rw@mail.gmail.com>
In-Reply-To: <CANt7McF3otwZvy3hUh%2BY1bm_A3vLhJcKThdZy4=u6EPNXfEByA@mail.gmail.com>
References:  <CANt7McF3otwZvy3hUh%2BY1bm_A3vLhJcKThdZy4=u6EPNXfEByA@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Oct 25, 2013 at 3:50 PM, Rostislav Krasny <rosti.bsd@gmail.com> 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="<path to 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.



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