[systemd-devel] Mounting / as writable without in `/etc/fstab`
Mantas Mikulėnas
grawity at gmail.com
Thu Nov 26 08:12:38 UTC 2020
On Mon, Nov 23, 2020 at 5:23 PM Paul Menzel <
pmenzel+systemd-devel at molgen.mpg.de> wrote:
> Dear systemd folks,
>
>
> Is an entry for / in `/etc/fstab` still needed, or is there a systemd
> way of doing it?
>
That *is* the systemd way -- the fstab entry will be read by
systemd-remount-fs(8) and the new mount options applied.
>
> Installing Debian bullseye/testing with the Debian Installer, it creates
> a GPT and `/etc/fstab`. [...]
> Commenting out the entries for `/`, the root partition is mounted as
> read-only.
>
> $ findmnt /
> TARGET SOURCE FSTYPE OPTIONS
> / /dev/nvme0n1p2 ext4 ro,relatime
>
> Shouldn’t it be mounted as writable?
>
No, if you had it initially mounted with 'ro' and did not leave any
instructions for remounting, then it won't be remounted...
>
> $ sudo /lib/systemd/systemd-remount-fs
> $ findmnt /
> TARGET SOURCE FSTYPE OPTIONS
> / /dev/nvme0n1p2 ext4 rw,relatime,errors=remount-ro
>
> The log says:
>
> [ 2.320133] systemd[179]:
> /usr/lib/systemd/system-generators/systemd-gpt-auto-generator succeeded.
>
> I can work around it changing `ro` to `rw` on the Linux command line,
> but I thought, it is possible without that.
>
I would say that having the initramfs directly mount the filesystem as rw
is the *preferred method*, not a workaround... Of course it depends on how
your distro's initramfs wants to work, but at least that's what Arch does
-- since fsck is run from the initramfs, there's not much point in later
mounting it ro at all.
--
Mantas Mikulėnas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20201126/0e9c2011/attachment.htm>
More information about the systemd-devel
mailing list