Re: Swap Files

Gerd Knorr (kraxel@cs.tu-berlin.de)
Sun, 19 Jan 1997 11:40:39 +0100


In linux.dev.kernel you write:

>On Sat, 18 Jan 1997, Ion Badulescu wrote:

>Perhaps rather than modifying the kernel proper it would be easier to
>mount swapfiles using the loop device, then a swapoff -a would (if, of
>course, it were configured as such in fstab) indeed permit the fs to be
>umounted at shutdown. If this were to become standard, then the swap
>utils could be reduced to handling nothing but swap partitions, making
>them all the more simple. It would, however, introduce some
>incompatabilities between the versions of the swap utils and
>configurations. Sorry, but I haven't tried this, as I don't use
>swapfiles.

It is'nt that simple. Turn on swap *partitions* is one of the first things
you do at boot time. Usally before checking and mounting filesystems.
For swap *files* you have to wait until your filesystems are mounted.

Same for shutdown: Turn off swap files has to be done before umounting
filesystems, swap partitions can later.

I use this "two-step" swapon: Have a 40 MB swap partition, and after
mounting all the filesystems I run a script which searches the
DOS-Partitions for 386spart.par files :-) BTW: swap priorities are
handy for this: Of cource it is a good idea to run the swap file at
lower priority...

For the new swapon/off: Would be handy to have a "-t [ file | part ]"
switch.

Gerd