fstab format, 4th field mandatory and the "sw" value

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hey.

The following is in principle just cosmetic.


I recently wondered[0] what fstab entries for swap areas should look
like.

Some resources recommend e.g.:
  <swap-device/file> none swap sw 0 0
others somehting like:
  <swap-device/file> swap swap defaults 0 0


fstab(5) describes the appropriate values for swap for fields 1 to 3
(inclusive).
But it gives nothing about the 4th.
Neither do e.g. the manpages mount(8) or swapon(8).
Especially there seems to be no longer any mention of "sw"

getfsent(3) still contains a reference to "sw",... seems it comes
originally from BSD.


"default", which is documented as:
> use default options: rw, suid, dev, exec, auto, nouser, and async.

doesn't seem to be the best choice either.

Personally I'd have said that - from the documented values alone -
"auto,nouser" perhaps in addition with "rw" might the most fitting
choice.

fstab(5) even seems to make either "rw" or "ro" mandatory, by saying:
> It contains at least the type of mount (ro or rw)

which I don't thin is however really enforced (neither would it mention
any such thing for auto vs. noauto).


In the thread at [0], a participant suggested that the most appropriate
entry would be simply:
  <swap-device/file> none swap
i.e. omitting the 4-6th fields.


However, at least by fstab(5), the 4th field (unlike #5 and #6) does
seem to be required.


*If* fstab(5) is considered to be like a formal description of the
fstab format it would be nice if the following could be clarified:
- Whether or not "rw" respectively "ro" are really required (or whether
  absence of both of them (and absence of "defaults") causes an
  implicit default to be used.
  The same for auto/noauto.
- Whether he 4th field is mandatory and if not, what that means.
  Is it the meaning of "defaults" or is it nothing except for the
  "implicit defaults" of ro/rw noauto/auto?
- Whether or not the other special values from getfsent(3), i.e. "rq",
  "sw", "xx" still have any meaning for linux (and if it's just that
  they're ignored)... and similar as it's done for fields 1-3, what
  should be used for swap areas.

Along with that, it might perhaps make sense to replace "swap
partition(s)" with "swap device(s)", as a swap device doesn't need to
be a partition.


Thanks,
Chris.


[0] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1033630



[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux