Messages in this thread |  | | From | (Nick Holloway) | Subject | Re: Swap Files | Date | 21 Jan 1997 00:05:03 -0000 |
| |
alan@lxorguk.ukuu.org.uk (Alan Cox) writes: > Fix the distributions, fix swapoff but don't keep dumping on the kernel to > fix user mode problems.
Agreed. Changing swapoff (with the necessary kernel support) so that it can remove all swap partitions is going to confuse programs such as swapd which manage swap files themselves.
All you need is for swapon to create an entry in "/etc/swtab" (c.f. /etc/mtab) when it enables swap partitions or files. It will contain the swap paritions in /etc/fstab that were enabled using "swapon -a", and also any that were added manually. Then "swapoff -a" will disable all of the partitions that "swapon" enabled[1].
No kernel bloat. Available in a stable kernel near you[2].
[1] However, you need a "-n" flag to enable swap on a read-only root partition, so you also have a "-f" flag to put the entry in /etc/swtab after the root partition is r/w.
[2] If somebody writes it...
-- `O O' | Nick.Holloway@alfie.demon.co.uk http://www.alfie.demon.co.uk/ // ^ \\ | Nick.Holloway@parallax.co.uk http://www.parallax.co.uk/~alfie/
|  |