nix-community / impermanence

Modules to help you handle persistent state on systems with ephemeral root storage [maintainer=@talyz]
MIT License
1.1k stars 81 forks source link

"Failed unmounting /nix/store" with a bind-mounted `/nix` #21

Closed Nadrieril closed 3 years ago

Nadrieril commented 3 years ago

I just changed my system to have a tmpfs root, and found impermanence amazing! But my /nix is bind-mounted and I get the following error on boot:

Nov 09 20:41:02 meluin systemd[1]: Listening on Journal Audit Socket.
Nov 09 20:41:02 meluin systemd[1]: Listening on Journal Socket (/dev/log).
Nov 09 20:41:02 meluin systemd[1]: Listening on udev Control Socket.
Nov 09 20:41:02 meluin systemd[1]: Listening on udev Kernel Socket.
Nov 09 20:41:02 meluin systemd[1]: Unmounting /nix/store...
Nov 09 20:41:02 meluin systemd[736]: nix-store.mount: Failed to connect stdout to the journal socket, ignoring: No such file or directory
Nov 09 20:41:02 meluin systemd[1]: nix-store.mount: Mount process exited, code=exited, status=32/n/a
Nov 09 20:41:02 meluin systemd[1]: Failed unmounting /nix/store.

So far everything seems to be working normally, but I don't really know what this means so I hope nothing is broken.

talyz commented 3 years ago

Hi! Glad you like it! :)

My /nix is a btrfs subvolume and I see the same error in my log whether impermanence is used or not, so this is likely a NixOS bug. However, it hasn't (to my knowledge) affected my system negatively in any way.

Nadrieril commented 3 years ago

Hm ok good to know. I think it's trying to unmount /nix from the initrd root so it shouldn't be too bad if that fails.

dschrempf commented 1 year ago

Do you still have this problem? I am using tmpfs and also get "failed unmount /nix" error messages. (I have my persisted directories in /nix).

Nadrieril commented 1 year ago

Yep, still happening!

EDIT: oops I was looking at very old logs, actually it's not happening anymore

iclanzan commented 1 year ago

I am seeing this error when shutting down. Also on tmpfs root and with all persisted things under /nix.

mcsimw commented 2 months ago

I have tested various filesystem configurations in nixos and I only get this error on shutdown when / is mounted to a tmpfs and /nix is mounted to an xfs partition. ext4, btrfs, zfs, no issues at all with the / mounted to a tmpfs.

dschrempf commented 2 months ago

I use tmpfs for root and a LUKS encrypted ext4 partition which is mounted at /nix, and I still get this error on every shutdown.

tensor5 commented 2 weeks ago

I use tmpfs for root and a LUKS encrypted ext4 partition which is mounted at /nix, and I still get this error on every shutdown.

I have exactly the same problem.

dschrempf commented 1 week ago

I am also still having this problem, I think it is only solvable by having a separate partition for persistently stored files.