Skip to main content
Topic solved
This topic has been marked as solved and requires no further attention.
Topic: s6: problem with remount-root depending on mount-filesystems (Read 579 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

s6: problem with remount-root depending on mount-filesystems

At the moment, `remount-root` depends on `mount-filesystems`, not vice versa. Which looks weird and causes problems:

In my `/etc/fstab`, I have multiple bind-mounts which are thus mounted r/o and stay that way even after rootfs is remounted r/w. So I have to remount them too afterwards.

Is this good idea at all to such postpone remount-root? What is the reasoning behind? The only other setup I can check is Gentoo's OpenRC where `localmount` depends on `root`, which looks natural.

Re: s6: problem with remount-root depending on mount-filesystems

Reply #1
Huh, why would remount-root come before the initial mounting of filesystems? Whatever is in fstab is supposed to be your initial root partition and then for some reason if it mounts a read-only, remount-root runs and attempts to mount it again with write permissions.

Re: s6: problem with remount-root depending on mount-filesystems

Reply #2
Huh, why would remount-root come before the initial mounting of filesystems?

I already answered your question in OP by providing specific example when postponed remount-root causes problems. What problems early remount-root can cause?

> Whatever is in fstab is supposed to be your initial root partition

fstab is supposed to contain arbitrary stuff, but I've never seen it containing initial root partition. If it was supposed to be in fstab, then why separate remount-root service at all?

> remount-root runs and attempts to mount it again with write permissions.

Again: you ignore the problem I described in OP.

Re: s6: problem with remount-root depending on mount-filesystems

Reply #3
I apologize. I don't really conceptually understand what you are doing nor why these bind mounts are r/o or why switching the order between remount-root and mount-filesystems would change the result. I'll just try to explain the current setup.

/etc/fstab always mounts a root partition (at /). I don't know hwy you say it doesn't. It's on the Arch Linux wiki example. Also if you use the fstabgen command, it will generate a root partition as well of course. So the initial mount-filesystems services will mount everything in your /etc/fstab, including the root partition. It's just a mount -a command (well it excludes netmounts but that's not important for now).

Now remount-root is merely a fallback/safety net. Some users will end up with a read-only root mount for whatever reason after mount-filesystems is run. This is obviously pretty bad since many things will be broken if you cannot write to / at all. All remount-root does is simply remount the / partition explicitly as r/w. It not a normal mount command but rather a remount which expects a drive that is already mounted. So clearly, this must come after mount-filesystems. It's nonsensical otherwise.

If I recall correctly, runit has this same scheme/setup.

Re: s6: problem with remount-root depending on mount-filesystems

Reply #4
> Now remount-root is merely a fallback/safety net.

Ok, I get it. So I'll add remount root rw as first line to my /etc/fstab. Problem solved. Thank you. :)

> /etc/fstab always mounts a root partition (at /). I don't know hwy you say it doesn't.

Maybe dementia on my part, who knows. Sorry for bothering you. :)

Re: s6: problem with remount-root depending on mount-filesystems

Reply #5
Well, dementia truly. I apologize again. :) I did have "LABEL=MY_ROOT  /  ext4   rw,noatime   0 0" in my fstab. More, after commenting it out and rebooting I ended up in console (lightdm and some other things didn't start), so it does work, it remounts rootfs as rw. But later bind-mount are still r/o, which is for me to investigate further on my own.