-
-
Notifications
You must be signed in to change notification settings - Fork 14.3k
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: Fail on boot due to zfs
mount point being non-empty
#212762
Comments
This might be unrelated, but the first thing I would try would be to do the following: $ zfs set mountpoint=legacy zroot/root/home Otherwise, it might be possible that /home is trying to be mounted by both systemd and zfs during boot. I usually recommend disabling zfs's auto-mount functionality (by setting If that alone doesn't fix it, I would try the following:
If there are any files or directories in /home at this point, these files/directories are in your root filesystem rather than your home filesystem, so you should move them out of the way, mount /home and then move them back into their place. |
Also, I would try removing all the It sounds like |
I am unable to test if this would work currently. Will get back to it later hopefully. However, I am also interested if these are issues
I did this during my debugging, the issue is an empty user directory in |
I think this issue that you mentioned is known: #6481 However, judging from the following systemd message from your log, this should not be preventing
The failure seems to come from the I think changing the Alternatively (i.e. if you prefer ZFS to mount the filesystem instead of systemd), you could try removing However, generally speaking I recommend using systemd to mount ZFS filesystems due to systemd being aware of non-ZFS filesystems and thus being able to mount all filesystems in their proper order. |
Thank you, I opted to not using a dataset for the Can the automount functionality and using This issue can be considered "fixed" for me as I now know what to avoid what the expected errors might be. You can close it if deemed suitable or keep it open for future reference. I suppose this is a quite a major caveat when using the automount functionality of |
I think you should be able to use ZFS auto-mount for I think the race condition should only arise when both ZFS and
As far as I know, yes. |
Thank you for the clarification (and patience to explain these things! :D) as I had misunderstood some parts! But if I do not add |
Yes, but as far as I know, that only means that NixOS will not configure systemd to mount/unmount this filesystem automatically. However, ZFS should do it instead. From the point of view of NixOS, it will look like |
I seem to be unable to reproduce this issue with Root on ZFS guide. That guide uses a separate dataset for |
As I understand it, this issue is not a problem if you use |
The non-empty mount point bit is a red herring, I see the same issue ( Also, unfortunately I think the best solution to this is likely implementing #62644, as that would allow sane integration of systemd mounts with zfs mount configuration, without having to fall back to using only legacy mounts. I'm testing it out locally at the moment, and so far so good, but given the issue is racey to begin with I can't be certain as of yet that it is solved... |
Describe the bug
With the following
fileSystems
, the/home
mount fails due to "non-emptydirectory there" (logs further below):
The relevant error log parts from
sudo journalctl --boot
is as follows(cleaned some probably irrelevant logs from the middle):
Output from
zfs list
is as follows:Finally, even though the boot goes to emergency mode due to the failing
mounting, simply continuing will then successfully mount the
/home
mountwithout any further issues in use. So this is a somewhat minor issue.
Steps To Reproduce
Steps to reproduce the behavior:
fileSystems
config with correctly partitioned single-drive setupnixos
and rebootHowever, the issue seems to appear somewhat sporadically during reboots.
Currently, it occurs every time I boot the machine. But when I tried to debug
the issue, sometimes the issue occurred and sometimes not even with the same
config.
Expected behavior
I expected the boot to succeed.
Notify maintainers
zfs
package maintainers (hopefully correct):@jcumming @jonringer @wizeman @globin
Additional info
I first posted this issue in
nix-community/disko
(nix-community/disko#114) as I used it for
partitioning and mounting the drives. But the relevant
fileSystems
config should be the one pasted above (printed from the final config
produced by
disko
). For additional info you can check the issue threadthere (e.g. some settings I have tried to use to debug the issue with no
success).
As mentioned in that thread, I suspect there is a race condition with
some
systemd
service that creates the empty user directory.My host configuration with relevant parts:
i.e. configuration.nix
partitions.nix
Metadata
Please run
nix-shell -p nix-info --run "nix-info -m"
and paste the result.The text was updated successfully, but these errors were encountered: