5

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?

Gaia
  • 1,777
  • 4
  • 32
  • 58

1 Answers1

13

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.

Michael Hampton
  • 237,123
  • 42
  • 477
  • 940