Re: Using a swap file
On Thu, Oct 31, 2013 at 5:05 AM, Hiroki Sato wrote: > Rostislav Krasny wrote > in : > > ro> But I have no 'late' option in my /etc/fstab: > ro> > ro> root@saturn:~ # cat /etc/fstab > ro> # DeviceMountpointFStypeOptionsDumpPass# > ro> /dev/ada0s2a/ufsrw11 > ro> mdnoneswapsw,file=/swapfile00 > ro> > ro> Then why 'swapon -a' (without -L) doesn't work? It's either buggy or > confusing. > > After r255265 the option file= implies late. It is because a > file-backed swap space likely to be on a mounted filesystem after the > "swap" line. > > I realized that that assumption was odd and confusing as you pointed > out. The user should specify a swap line with file= after the mount > entry, and there is no problem with it. I will fix it. Hope to see the fix in the upcoming 10.0 release and in the Handbook. Thank you. ___ freebsd-current@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-current To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"
Re: Using a swap file
Rostislav Krasny wrote in : ro> But I have no 'late' option in my /etc/fstab: ro> ro> root@saturn:~ # cat /etc/fstab ro> # DeviceMountpointFStypeOptionsDumpPass# ro> /dev/ada0s2a/ufsrw11 ro> mdnoneswapsw,file=/swapfile00 ro> ro> Then why 'swapon -a' (without -L) doesn't work? It's either buggy or confusing. After r255265 the option file= implies late. It is because a file-backed swap space likely to be on a mounted filesystem after the "swap" line. I realized that that assumption was odd and confusing as you pointed out. The user should specify a swap line with file= after the mount entry, and there is no problem with it. I will fix it. -- Hiroki pgpHXbTi0H4Wb.pgp Description: PGP signature
Re: Using a swap file
On Fri, Oct 25, 2013 at 6:31 PM, Rostislav Krasny wrote: > 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 >> >> mdnoneswapsw,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. Finally I've figured out how to turn swap on in case it's on a swap file: root@saturn:~ # swapon -aL swapon: adding /dev/md0 as swap device This is (with an additional -q parameter) what /etc/rc.d/swaplate does during the boot. But from the swapon(8) manual page this is not obvious: The swapon utility adds the specified swap devices to the system. If the -a option is used, all swap devices in /etc/fstab will be added, unless their ``noauto'' or ``late'' option is also set. If the -L option is specified, swap devices with the ``late'' option will be added as well as ones with no option. If the -q option is used, informational messages will not be written to standard output when a swap device is added. But I have no 'late' option in my /etc/fstab: root@saturn:~ # cat /etc/fstab # DeviceMountpointFStypeOptionsDumpPass# /dev/ada0s2a/ufsrw11 mdnoneswapsw,file=/swapfile00 Then why 'swapon -a' (without -L) doesn't work? It's either buggy or confusing. P.S. Please update the Handbook as well. ___ freebsd-current@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-current To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"
Re: Using a swap file
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 > > mdnoneswapsw,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. ___ freebsd-current@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-current To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"
Using a swap file
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 mdnoneswapsw,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 ___ freebsd-current@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-current To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"