Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RFC] Add ConditionPathIsReadWrite= to service files #56

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

[RFC] Add ConditionPathIsReadWrite= to service files #56

wants to merge 1 commit into from

Conversation

super7ramp
Copy link
Contributor

@sysrich proposed to drop btrfsmaintenance from openSUSE's patterns-base because of an issue with read-only filesystems:

periodic trim, scrub, etc, are also all broken on Kubic and the Transactional System Role on Tumbleweed and Leap (how do you scrub a readonly root filesystem?)

@DimStar77 suggested to use ConditionPathIsReadWrite=… in service file instead in order to just skip the task if the concerned mountpoint is read-only.

Here's a proposal to make btrfsmaintenance-refresh script able to add this condition. Open to any comments.

In order to prevent any error in case fs is read-only (e.g. openSUSE
Kubic).
@sysrich
Copy link

sysrich commented Jul 31, 2018

While I like this idea, I think we should reach out to the maintainers of btrfsprogs about fixing the handling of scrub/trim/etc on read-only root filesystems

All of those functions should work on devices even when the filesystem is read-only - this can be proven by doing a scrub on a read-write subvolume on a read-only root filesystem - the entire filesystem, not just the read-write subvolume is scrubbed

So, the fact that btrfsprogs are failing on a read-only rootfs is a bug, which this PR worksaround, but I'm not sure we really want it to workaround that incorrect behaviour

@thkukuk
Copy link

thkukuk commented Aug 31, 2018

fstrim seems to work:

fstrim -av
/var: 8.4 GiB (8988311552 bytes) trimmed
/: 18.8 GiB (20178690048 bytes) trimmed

Defrag doesn't seem to work at all.

For balance and scrub: with this patch, if you have one read-only filesystem in your list, NO filesystem will be balanced or scrubed! Never. That's why I don't like this solution: it only hides the problem, but does not solve it.

As the paths are configure options in /etc/sysconfig/btrfsmaintenance, it would be better to find more clever solutions. If the path is "/", change it automatically to "/.snapshots" as we do already in a lot of other tools. If something is read-only, print a warning and skip the entry, so that the admin knows that something is wrongly configured and can fix it, but never ignore all entries and do nothing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants