From: Christoph Anton Mitterer <mail@christoph.anton.mitterer.name>
To: util-linux@vger.kernel.org
Subject: fstab format, 4th field mandatory and the "sw" value
Date: Wed, 29 Mar 2023 15:03:16 +0200 [thread overview]
Message-ID: <45fc7a385b006d734011a11487fbfdda4333644e.camel@christoph.anton.mitterer.name> (raw)
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
next reply other threads:[~2023-03-29 13:03 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-29 13:03 Christoph Anton Mitterer [this message]
2023-04-04 10:13 ` fstab format, 4th field mandatory and the "sw" value Karel Zak
2023-04-05 23:01 ` Christoph Anton Mitterer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=45fc7a385b006d734011a11487fbfdda4333644e.camel@christoph.anton.mitterer.name \
--to=mail@christoph.anton.mitterer.name \
--cc=util-linux@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).