Re: mkswap & swapon

Ion Badulescu (ionut@moisil.cs.columbia.edu)
Fri, 20 Feb 1998 00:45:53 -0500 (EST)


On Thu, 19 Feb 1998, G.J.W. Hagenaars wrote:

> According to the manpage I have on swapon, there is an option:
>
> -s Display swap usage summary by device
>
> Unfortunately, when I try it, it doesn't work... (something about
> /proc/swaps not being there... I haven't looked at the cause of that).

/proc/swaps is not available in 2.0.x (not in the official kernel,
anyway).

> However, I figure that there is a way to find the (current) files that
> are used for swap in some other way (how else would swapoff know what to
> swap off?), so the thing that can be used then is looking at the inode
> numbers of all the files that are currently used for swapping and
> comparing those with the inode number of the new file that is given
> to swapon.

swapoff doesn't know what to swap off, it tries to be smart and look at
fstab, but that obviously fails if you make changes by hand. It is
precisely the reason why /proc/swaps was created.

That's not the point, anyway. The kernel should not depend on user-space
utilities for its sane state. Mind you, counting a file/device twice for
swap is what I would a rather insane setup. :-)

Ion

-- 
  It is better to keep your mouth shut and be thought a fool,
            than to open it and remove all doubt.

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu