Re: Swap Files

Stephen C. Tweedie (sct@dcs.ed.ac.uk)
Sat, 18 Jan 1997 23:40:20 GMT


Hi,

On Sat, 18 Jan 1997 13:24:24 -0500 (EST), "Andrew E. Mileski"
<aem@ott.hookup.net> said:

>> > I find this annoying: at shutdown, swapfiles are never turned off.
>> > This keeps the partiton busy, and hence it needs to be fsck'ed at
>> > next boot.
>>
>> This is a local configuration problem. ...

> I bet you don't use swap files! If so, then please explain what is wrong.
> Try this yourself:
> dd if=/dev/zero of=swap bs=1024 count=1028
> mkswap swap
> free ; swapon -v swap
> free ; swapoff -a ; free
> You'll then see what I mean - the swap file stays active.

Read the man page. "swapoff -a" deactivates every swap file which is
listed in /etc/fstab, so it cannot deactivate other swap files which
have been added manually. Do a "swapoff swap" and you will see the
file deactivated.

In other words, to make sure things work correctly your swap files
must be listed in /etc/fstab, and you need a "swapoff -a" run during
system shutdown. Given all that, things should work as expected.

Cheers,
Stephen.