Re: Mounting / as writable without in `/etc/fstab`

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

 



On Mon, Nov 23, 2020 at 5:23 PM Paul Menzel <pmenzel+systemd-devel@xxxxxxxxxxxxx> 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
_______________________________________________
systemd-devel mailing list
systemd-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/systemd-devel

[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux