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

next in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CANt7McF3otwZvy3hUh%2BY1bm_A3vLhJcKThdZy4=u6EPNXfEByA>