Hey,
I have a server with ZFS filesystem for both boot and my data. Now, the boot from ZFS works just fine, but the boot process falls on its face when it tries to mount the other ZFS volumes.
Error:
Starting Mount ZFS filesystems...
[FAILED] FAILED to mount /mnt/data.
See 'systemctl status mnt-data.mount' for details.
[DEPEND] Dependency failed for Local FIle Systems
...
You are in emergency mode. After logging in, type "journalctl -xb" to view
system logs, "systemctl reboot" to reboot, "systemctl default" or "exit"
to boot into default mode.
Give root password for maintenance
(or press Control-D to continue):
When use Control-D
the system starts up fine. When I check the systemd mount I find:
root@melchior> systemctl status mnt-data.mount ~
â—Ź mnt-data.mount - /mnt/data
Loaded: loaded (/etc/fstab; generated)
Active: active (mounted) since Sun 2020-01-12 13:41:22 CET; 5min ago
Where: /mnt/data
What: DATA/data
Docs: man:fstab(5)
man:systemd-fstab-generator(8)
IP: 0B in, 0B out
Tasks: 0 (limit: 4915)
Memory: 0B
CPU: 0
CGroup: /system.slice/mnt-data.mount
It’s mounted just fine:
root@melchior> df -h /mnt/data ~
Filesystem Size Used Avail Use% Mounted on
DATA/data 799G 709G 90G 89% /mnt/data
But the logs show a different story:
root@melchior> journalctl -f -u mnt-data.mount ~
-- Logs begin at Sat 2020-01-11 17:47:51 CET. --
Jan 12 13:40:37 melchior systemd[1]: Unmounting /mnt/data...
Jan 12 13:40:37 melchior systemd[1]: mnt-data.mount: Succeeded.
Jan 12 13:40:37 melchior systemd[1]: Unmounted /mnt/data.
-- Reboot --
Jan 12 13:41:21 melchior systemd[1]: Mounting /mnt/data...
Jan 12 13:41:22 melchior mount[2961]: filesystem 'DATA/data' cannot be mounted using 'mount'.
Jan 12 13:41:22 melchior mount[2961]: Use 'zfs set mountpoint=legacy' or 'zfs mount DATA/data'.
Jan 12 13:41:22 melchior mount[2961]: See zfs(8) for more information.
Jan 12 13:41:22 melchior systemd[1]: mnt-data.mount: Mount process exited, code=exited, status=1/FAILURE
Jan 12 13:41:22 melchior systemd[1]: mnt-data.mount: Failed with result 'exit-code'.
Jan 12 13:41:22 melchior systemd[1]: Failed to mount /mnt/data.
And hare are mount related settings:
root@melchior> zfs get -r type,mountpoint,canmount,mounted DATA/data ~
NAME PROPERTY VALUE SOURCE
DATA/data type filesystem -
DATA/data mountpoint /mnt/data local
DATA/data canmount on default
DATA/data mounted yes -
Here is how it’s configured in my hardware-configuration.nix
:
fileSystems."/mnt/data" =
{ device = "DATA/data";
fsType = "zfs";
neededForBoot = false;
};
I tried setting neededForBoot
to false
just in case but it does nothing, since it should be false
anyway.
I loaded other ZFS settings in my configuration.nix
:
boot.supportedFilesystems = [ "zfs" ];
boot.loader.grub.copyKernels = true;
My boot.loader.grub.devices
contains only two devices from my root pool, not the DATA
one.
And here is my full configuration:
https://github.com/jakubgs/nixos-config
I really don’t understand why the volume fails to mount.