#1040183 zfs-initramfs: snapshots for rootfs mounted in /root/.zfs/snapshot

Package:
zfs-initramfs
Source:
zfs-initramfs
Submitter:
Richard van den Berg
Date:
2024-04-14 04:03:02 UTC
Severity:
normal
Tags:
#1040183#5
Date:
2023-07-02 22:19:56 UTC
From:
To:
I have ZFS setup with rootfs which is mounted at boot in /root by initramfs.
This causes the ZFS snapshots to be mounted in /root/.zfs/snapshot instead
of /.zfs/snapshot

Accessing any snapshot in /.zfs/snapshot gives this error:

Too many levels of symbolic links

The root cause is explained at https://github.com/openzfs/zfs/issues/9461#issuecomment-1376162949

#1040183#10
Date:
2023-07-02 22:22:25 UTC
From:
To:

#1040183#17
Date:
2023-07-20 11:03:52 UTC
From:
To:
It looks like this has been fixed in 2.1.12:
https://github.com/openzfs/zfs/pull/14920

2.1.12-1 is already in unstable. Please consider including this fix in
Debian stable (bookworm) as well.

#1040183#24
Date:
2023-10-10 16:29:35 UTC
From:
To:
I can confirm this issue is resolve with zfs-dkms 2.1.12-2~bpo12+1 from
bookworm-backports.

Kind regards,

Richard

#1040183#29
Date:
2024-01-05 18:09:59 UTC
From:
To:
Thanks
Shengqi Chen

#1040183#40
Date:
2024-01-05 18:13:00 UTC
From:
To:
Also fixed in bookworm-backports by 2.1.12-2~bpo12+1 and confirmed by submitter.

Thanks,
Shengqi Chen

#1040183#49
Date:
2024-01-11 20:25:28 UTC
From:
To:
The upstream issue referenced in the OP is still open, and you can still
repro this error on 2.2.2-3 and 6.6.9-amd64:
  nabijaczleweli@chrust:~$ ls .zfs/snapshot/pre-keymap/
  ls: cannot access '/home/nabijaczleweli/.zfs/snapshot/pre-keymap/': Too many levels of symbolic links
  nabijaczleweli@chrust:~$ ls /.zfs/snapshot/pre-keymap/
  audio-script.tar  cros-keyboard-map  foreign.nabijaczleweli.xyz  typescript  xev.log
  nabijaczleweli@chrust:~/code/babfig/i3status.rs$ findmnt
  TARGET                      SOURCE                                     FSTYPE OPTIONS
  /                           chrust-zoot                                zfs    rw,relatime,xattr,posixacl,casesensitive
  ├─/home                     chrust-zoot/home                           zfs    rw,relatime,xattr,posixacl,casesensitive
  │ └─/home/nabijaczleweli    chrust-zoot/home/nabijaczleweli            zfs    rw,relatime,xattr,posixacl,casesensitive
  └─/.zfs/snapshot/pre-keymap chrust-zoot/home/nabijaczleweli@pre-keymap zfs    ro,relatime,xattr,posixacl,casesensitive
  $ uname -a
  Linux chrust 6.6.9-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.6.9-1 (2024-01-01) x86_64 GNU/Linux
  $ zfs --version
  zfs-2.2.2-3
  zfs-kmod-2.2.2-3
with the added spice of c-z/h/n@p-k instead of c-z@p-k being mounted.

#1040183#56
Date:
2024-01-12 02:46:15 UTC
From:
To:
Hi,

Thanks for testing. The fix actually got merged into 2.2.12 and master,
but not released with 2.2.0 till now. We will keep tracking it, and (probably)
backport the patch in the next debian release.

Thanks,
Shengqi Chen

#1040183#65
Date:
2024-01-12 07:12:34 UTC
From:
To:
Hi,

Sorry for the confusion. The fixes has landed in 2.1.12 and remains in all later versions.
I tested on my 2.2.2-3 and cannot reproduce your problem.


Seems .zfs/ of you home dataset goes wrongly to /.zfs, which is really weird,
since they are mounted in the different stage of booting sequence.
I don’t think it is the same problem as this report.
You might want to create a new report (and to upstream).

Thanks,
Shengqi Chen

#1040183#72
Date:
2024-01-12 17:29:33 UTC
From:
To:
Forwarded to https://github.com/openzfs/zfs/issues/15766.