Swapfile mount (/etc/fstab): "swap swap" or "none swap"

Gaia asked:

There seems to be conflicting information on how to mount a swapfile.

swap swap:

enter image description here

none swap:

enter image description here

both:

enter image description here

Both ways work. What is the official recommendation and how does each way affect swapping?

My answer:


In regard to the second field, for swap partitions, the Linux man page for fstab states:

For swap partitions, this field should be specified as `none’.

It has stated the same thing since at least 27 November 1993, the earliest man page I could find.

In practice it doesn’t matter; if the filesystem type is swap, the system ignores the mountpoint field. I have one system where it is literally set to whatever and works fine.

UUID=b81f37e8-eddf-4969-9cea-8fdea73bd125 whatever        swap    defaults        0 0

But using the word “none” is intended to make it clear that the field is not relevant to the entry.


View the full question and any other answers on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.