-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
zfs-mount-generator: canmount=noauto for backups causing mount problems at boot #10530
Comments
wrong pr :)
I 100% agree, everything is working as expected given the caveat of how systemd 'recursively' activates the mounts. Actually, while looking at rpool.txt and the generated units in detail, we can see that the real culprit is canmount=on:
Since during design everyone seemed to think the noauto in combination with the systemd mounting behaviour was not a problem (that can also hit you with canmount=on datasets as seen above, as we have no way to prioritize between two canmount=on datasets for the same mountpoint without user intervention), we just need to communicate the changes. We can work on improving the existing documentation, but I think the real problem is people didn't know to revisit the documentation. Someone should submit a talk for the dev summit this year :) |
@InsanePrawn Somehow a modified version of the rpool wound up being uploaded--- |
Sorry, I don't know what I was thinking---I've replaced the github upload with a direct link to the user's upload in the Debian BTS. |
I've only been skimming this, but I still don't have a good understanding of what is going on. I only see these two as having canmount=on:
I get how those two (or even just the first one, since they share a parent) would pull in /backups/kirby and /backups. But what is pulling in a mount for /usr? |
Yeah, it's tricky: the This is the way systemd understand dependencies between mountpoints: it assumes that you would not want to mount a filesystem deeper into the hierarchy unless you mount the containing mountpoint. To be fair to systemd, that's not an unreasonable assumption. The user does not want their |
I see now. Thanks! Right, I agree. The user in this case should choose one of: A) not managing backup mountpoints with systemd, or B) mounting them at another location. This is something that hasn't yet, but easily could, affect me personally. So I'm not unsympathetic to the problem. But I don't see any better solution. systemd's behavior isn't unreasonable here (and we can't change it anyway). So that leaves us with the choice of either creating units for canmount=noauto, which allows them to be manually mounted but creates this issue, or not creating them which has the opposite trade-offs. Given that trade-off, I think we should stick with the one that allows for more use cases. |
This is a request for a discussion, particularly with @rlaager and @InsanePrawn who, with me, worked on #9649, which is responsible for the behavior in Debian bug report 962424.
System information
Describe the problem you're observing
The user complains that their system is broken when the mount generator is enabled, and resolved when it is disabled. They have determined that
Describe how to reproduce the problem
The user has provided a copy of the responsible
zfs-list.cache
rpoolIndeed, running
zfs-mount-generator
on this (modifyFSLIST
to do this as an unprivileged user), you will get a systemd unitusr.mount
. Per @InsanePrawn's comment (and warning):Which means that the user's
rpool/backup/support/rpool/usr
is (attempted to be) mounted at/usr
. In their case, this is I think an empty dataset that is just used as a parent for their/usr/local/
dataset.Include any warning/errors/backtraces from the system logs
No access to system, but presumably the whole system falls apart trying to mount the backup's
/usr
, probably failing because the mountpoint isn't empty.Discussion
I think this is a user configuration error: the user (apparently) went through and ran
on all their backup datasets. This promoted a
canmount=off
unit tocanmount=noauto
, and is why this is happening. Moreover, the user definitely does not want their backup mounted at/usr
, ever. They should presumably have setmountpoint=/backups
or something on their backup parentrpool/backups
dataset.I don't think we have an obligation to try to force sane behavior when explicitly stated configuration is not.
But--still--this is new behavior:
canmount=noauto
has meant mounts are never activated unless there is an explicit call tozfs mount
in the past. There will be no solution to this problem unless we roll back creating units forcanmount=noauto
, and I don't think we want to do that. I maintain that a global configuration flag to disable thecanmount
behavior is inappropriate, introducing too many configuration branches to think about, both as a user, a developer, and a tester.We should decide on an official position so that I can address the Debian bug report, and possibly modify documentation. This is still relatively new behavior, hybridizing zfs and systemd mount point logic, and it is apparently confusing users.
The text was updated successfully, but these errors were encountered: