-
-
Notifications
You must be signed in to change notification settings - Fork 14.5k
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 snapshot dir not accessible in non-root neededForBoot
mounts
#257505
Comments
Same here. However, I have to mount the snapshots slightly differently. The following works for me: mkdir -p /tmp/zfsmount
sudo mount -t zfs rpool/encrypted/safe@zfs-auto-snap_hourly-2024-03-26-06h00 /tmp/zfsmount Your suggestion sudo mount -t zfs rpool/encrypted/safe@zfs-auto-snap_hourly-2024-03-26-06h00 -o remount Gives me:
|
"/persist" = {
device = "rpool/safe/persist";
fsType = "zfs";
options = [
"zfsutil"
"X-mount.mkdir"
];
neededForBoot = true;
}; ─ ls /persist/.zfs/snapshot
zrepl_20240409_202739_000 zrepl_20240410_201732_000 zrepl_20240411_195737_000 |
@matthiasdotsh Try with the dataset instead of the snapshot
I've managed to reproduce this issue with both the legacy stage1 as well as the systemd stage1 The easiest workaround for this issue is to run In my personal setup I just add it as an extra command to the systemd.services.zfs-mount = {
serviceConfig = {
ExecStart = [ "${lib.getExe' pkgs.util-linux "mount"} -a -t zfs -o remount" ];
};
}; This works with both legacy ( |
I did some further testing and my previous setting led to my system being broken in some weird ways, the easiest workaround I have found is to set the
The Then instead I use this snippet: systemd.services.zfs-mount = {
serviceConfig = {
ExecStart = [ "${config.boot.zfs.package}/sbin/zfs mount -a -o remount" ];
};
}; All my ZFS datasets are marked as |
|
|
When I tested it I believe I was able to reproduce it with systemd stage1 and with the legacy stage1. @Shawn8901 Did you check if the contents of the |
Okay now I got it. Can repro. Hadn't read the inital content careful enough. |
Scratch that, it is indeed not working with systemd initrd either, I made a mistake when spot checking. |
The remount workaround used to work for me on zfs 2.2, but sadly it no longer does on zfs 2.3rc2. Upon bisecting, the commit that introduced this regression is: openzfs/zfs@34118eac06fba83 |
This seems to be fixed for me in 2.3.0-rc3. The snapshot dirs all appeared empty for me previously, but work after updating. I didn't implement any of the workarounds for this bug, and made no config changes other than the update. |
Looks like this is the PR that should fix it in 2.3.0-rc3 openzfs/zfs#16646 |
Same here. now upgrade to zfs 2.3.0-rc3 and it works like a charm |
I'll close this then. Feel free to re-open if ZFS 2.3 did not resolve the issue. |
Describe the bug
ZFS provides a
<mountpoint>/.zfs/snapshot
directory that automounts snapshots for easy access. This does not work for non-root mounts that areneededForBoot = true
.Steps to reproduce
Expected behavior
Expected to find the snapshot files (e.g.
bar
) in/foo/.zfs/snapshot/test
, but is empty.Additional context
/proc/spl/kstat/zfs/dbgmsg
contains lines likeThis appears to be related to Unable to access snapshot files using /.zfs/snapshot/testsnapshot/ openzfs/zfs#9461, however the dataset mounted at
/
does not exhibit this problem, only nested mounts.Removing
neededForBoot = true
resolvesmount -t zfs rootpool/foo -o remount
resolves.Notify maintainers
Unsure who…
Metadata
Using recent nixos-unstable (e35dcc0).
The text was updated successfully, but these errors were encountered: