zfs icon indicating copy to clipboard operation
zfs copied to clipboard

zfs mount fails without showing any error or output

Open Carbon401 opened this issue 3 years ago • 5 comments

System information

Type Version/Name
Distribution Name Debian
Distribution Version 11.0
Kernel Version 5.10.0-8-amd64
Architecture amd64
OpenZFS Version zfs-2.0.3-9

Describe the problem you're observing

"zfs mount" fails without error if mount point is set to /home but succeeds if mount point is changed to anything else. /home is empty, there are no open files there (checked with lsof) and not currently a mount point. Sound very strange and there could be some obscure reason why this happens but without proper error reporting there's no way to know what's going on. Any ideas how to debug this?

Describe how to reproduce the problem

root@test:~# zfs list tank/home
NAME        USED  AVAIL     REFER  MOUNTPOINT
tank/home  1.55T  1.96T      272K  /home

root@test:~# mount | grep /home

root@test:~# zfs mount tank/home
# no error message or output

root@test:~# mount | grep /home
# no output - not mounted

root@test:~# zfs set mountpoint=/home2 tank/home

root@test:~# zfs mount tank/home

root@test:~# mount | grep /home
# mounted at /home2
tank/home on /home2 type zfs (rw,relatime,xattr,posixacl)

# change back to /home
root@test:~# zfs set mountpoint=/home tank/home
# no error message or output

root@test:~# zfs mount base/home
# no error message or output

root@test:~# mount | grep /home
# not mounted again

Include any warning/errors/backtraces from the system logs

Carbon401 avatar Sep 12 '21 11:09 Carbon401

I had the same issue after sending some datasets, turns out the culprit was systemd:

systemd[1]: data-backup.mount: Unit is bound to inactive unit zfs-load-key-rpool-data-backup.service. Stopping, too.
systemd[1]: Unmounting /data/backup...
systemd[4155]: data-backup.mount: Succeeded.
systemd[1]: data-backup.mount: Succeeded.
systemd[1]: Unmounted /data/backup.

Trying to manage this service results in:

Warning: The unit file, source configuration file or drop-ins of zfs-load-key-rpool-data-downloads.service changed on disk. Run 'systemctl daemon-reload' to reload units.

And the problem was solved simply by running:

systemctl daemon-reload

mafredri avatar Oct 21 '21 21:10 mafredri

Thanks for the suggestion but that wasn't the issue in my case. Still wondering how can I debug this. The failed mount command doesn't print any error or message, no output in any log file. Just silently fails. Works immediately if mount point is changed to anything else.

Carbon401 avatar Oct 31 '21 14:10 Carbon401

@egalitarian looks like you hit the same bug as me: https://github.com/openzfs/zfs/issues/12418 - I thought about using ftrace to get a stacktrace but had no time yet - it's still there on latest kernel and latest git (5.15, 380b072403)

mtippmann avatar Nov 12 '21 11:11 mtippmann

I've just installed Debian on a flash drive using ext4 (it was on a zfs root before) and the issue is gone. Is there a possible connection here?

Carbon401 avatar Nov 15 '21 06:11 Carbon401

This issue has been automatically marked as "stale" because it has not had any activity for a while. It will be closed in 90 days if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Nov 22 '22 21:11 stale[bot]