mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Greg Depoire--Ferrer <greg.depoire@gmail.com>
To: linux-kernel@vger.kernel.org
Subject: No way to set FS independent mount flags for rootfs
Date: Wed, 30 Jun 2021 13:51:27 +0200	[thread overview]
Message-ID: <20210630115128.3878-1-greg.depoire@gmail.com> (raw)

This old thread[1] describes the issue:
* The kernel already supports setting filesystem dependent mount data using
  rootflags=... but it doesn't support setting the filesystem independent mount
  flags (the fourth parameter in mount(2)).
* Fortunately, most initrds have custom parsing for rootflags= and understand
  additional flags: for instance they convert noatime into MS_NOATIME.
* But even then there is the issue of flags that can't be reset later by initrd
  like MS_NODEV or MS_NOSUID (not sure if this changed since then).

It seems like it would make sense for the kernel to add a command line parameter
for this because for those that don't use an initrd, it seems arbitrary that the
kernel already supports setting one type of flags (the fifth parameter in
mount(2)) for rootfs but not the other.

In reply to this message, there is a patch that implements what was suggested
in that thread: adding a 'rootopts=' parameter that takes a bitmap value for
the mount flags. The name is not ideal: it would make more sense for it to be
named rootflags= and the actual rootflags= to be named rootdata= according to
mount(2). It works for me but I don't know if this is the right solution.

[1]: https://lkml.org/lkml/2003/8/12/203


             reply	other threads:[~2021-06-30 11:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-30 11:51 Greg Depoire--Ferrer [this message]
2021-06-30 11:51 ` [PATCH] init: add rootopts=%d for rootfs mount flags Greg Depoire--Ferrer

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=20210630115128.3878-1-greg.depoire@gmail.com \
    --to=greg.depoire@gmail.com \
    --cc=linux-kernel@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

all inboxes | Powered by JetHome®