For Linux, at least, based on a look at the net, this appears to be an example of "cargo culting", which means including code or words in this case for ritualistic or superstitions reasons, even though they may "serve no real purpose." The evidence I've seen suggests that this option isn't actually necessary or meaningful, but you need to put something there, because the fstab
file syntax expects it. You can easily find examples of people using defaults
and even just pri=1
or whatever, leaving out both defaults
and sw
.
And, it doesn't make sense that swapon
would need to look at the mount options to check that it is swap, because swapon
can already see it's swap by looking at the filesystem type. There are certainly mount options for swap that modify behavior, as documented in man swapon
, but sw
isn't one of them. So the evidence is that it is a placeholder, and foobar
would do just as well as any other placeholder.
I can't be completely sure of this without looking at the source code of course.
Related: a Debian bug report complaining about this exact issue:
mount: swapon(8) lacks explanation for sw and defaults options.