Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 573760 - sys-apps/openrc - remounting /usr read only failed because we are using it
Summary: sys-apps/openrc - remounting /usr read only failed because we are using it
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Hosted Projects
Classification: Unclassified
Component: OpenRC (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: OpenRC Team
URL:
Whiteboard:
Keywords:
: 577530 (view as bug list)
Depends on:
Blocks:
 
Reported: 2016-02-03 11:31 UTC by Fab
Modified: 2016-11-03 17:55 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
mount-ro.patch (mount-ro.patch,467 bytes, patch)
2016-02-05 18:35 UTC, William Hubbs
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Fab 2016-02-03 11:31:59 UTC
On a stable system I'm using openrc-0.19.1 and I have a /usr partition.
I have an initrd which mount /usr before init start.

Since many months (and many openrc versions), I can see the following
messages at the very end of each reboot or shutdown sequences :

 * Remounting remaining filesystems read-only ...
 *   Remounting /usr read only ...      [!!]
 *   failed because we are using /usr   [!!]
 *   Remounting / read only
 * ERROR: mount-ro failed to start

Do you know a way to determine what's going on please ?
Thanks.
Comment 1 William Hubbs gentoo-dev 2016-02-05 18:35:03 UTC
Created attachment 424690 [details, diff]
mount-ro.patch

This patch makes mount-ro ignore /usr if it was not mounted by OpenRC.

Please test and let me know if it fixes your issue.

Thanks,

William
Comment 2 Fab 2016-02-05 20:37:11 UTC
Yes, the error is gone. Patch applied and got this :

* Remounting remaining filesystems read-only ...
*   Remounting / read only      [ok]

But I know that some people are using some more complex setups with other pre-mounted mount points, for example, like /var. So /usr may not be the only mount point affected by this.

Thanks !
Comment 3 William Hubbs gentoo-dev 2016-02-06 16:59:03 UTC
(In reply to Fab from comment #2)
> Yes, the error is gone. Patch applied and got this :
> 
> * Remounting remaining filesystems read-only ...
> *   Remounting / read only      [ok]
> 
> But I know that some people are using some more complex setups with other
> pre-mounted mount points, for example, like /var. So /usr may not be the
> only mount point affected by this.


This is a good point, so I'm now wondering if mount-ro should even try to do this, or if just running sync on the way down to flush everything to disk is sufficient?
Comment 4 Fab 2016-02-09 10:22:06 UTC
If you ask it to me, my response would be « I don't know ».

By coincidence, bug #573922 (and respective debate on -dev ML ) was opened.

When I installed this system, udev was the default (eudev does not even exist), and anyway my politic was always to follow the default choice in
virtual packages. I will wait for results, but in this particular case perhaps I will switch to eudev.

This means that an initrd which pre-mounts /usr would no longer be mandatory, so I could simply get rid of my initrd and this bug should automagically vanish.
Comment 5 William Hubbs gentoo-dev 2016-02-10 03:46:51 UTC
(In reply to Fab from comment #4)

*snip*

> When I installed this system, udev was the default (eudev does not even
> exist), and anyway my politic was always to follow the default choice in
> virtual packages. I will wait for results, but in this particular case
> perhaps I will switch to eudev.
> 
> This means that an initrd which pre-mounts /usr would no longer be
> mandatory, so I could simply get rid of my initrd and this bug should
> automagically vanish.

That's a misconception, because the system guys happened to mention it first.

Udev has nothing to do with the initramfs pre-mounting /usr. Systemd was the first major package to tell you about it, but splitting / from /usr is definitely not a good idea for many reasons without an initramfs, so please do not think that switching to eudev will make that a non-issue.
Comment 6 Richard Freeman gentoo-dev 2016-02-10 17:24:01 UTC
In case this is useful, systemd has addressed this issue in part by letting the initramfs unmount /usr and / if possible.  I know this is the behavior when using dracut.

I don't know the details of how this is coordianted between the initramfs and systemd, but we obviously control genkernel and I suspect that dracut would accept patches if necessary to enable this kind of support for openrc.

This allows both root and /usr to be unmounted cleanly, whether read-only or otherwise.
Comment 7 William Hubbs gentoo-dev 2016-02-10 20:43:49 UTC
@rich0:
I think you are talking about bug #524404, which is a fix for sysvinit.
I haven't looked into it heavily, but the idea is that, as the last step
of going down, sysvinit should exec another process in its place that
shuts everything down and remounts all mounted file systems read only.
Comment 8 Bryan O'Shea 2016-03-07 04:26:23 UTC
I have the same issue. Seperate /usr that is mounted in initramfs and on reboot or shutdown the error message is displayed unable to mount /usr read only. I tried the patch and the Error message went away. It appears that this is only suppressing the error message and that /usr is not remounted read-only for a clean shutdown? Is this something that openrc needs to handle or the initramfs should mount unmount so openrc can mount it at boot runlevel?
Comment 9 William Hubbs gentoo-dev 2016-11-02 20:36:19 UTC
*** Bug 577530 has been marked as a duplicate of this bug. ***
Comment 10 William Hubbs gentoo-dev 2016-11-03 17:55:04 UTC
https://github.com/openrc/openrc/commit/bf539f2

This will skip the remounting of /usr ro if /usr was premounted.
I will include it in 0.23 and backport to 0.22.3.