ZFS: automatically import zpools and mount zfs filesystems.

Patch contributed by Jack Cummings.
This commit is contained in:
Evgeny Egorochkin 2013-05-05 16:31:10 +03:00
parent 17f10f70ad
commit d6df27277b

View File

@ -63,6 +63,28 @@ in
'';
};
systemd.services."zpool-import" = {
description = "Import zpools";
after = [ "systemd-udev-settle.service" ];
serviceConfig = {
Type = "oneshot";
RemainAfterExit = true;
ExecStart = "${kernel.zfs}/sbin/zpool import -f -a -d /dev";
};
};
systemd.services."zfs-mount" = {
description = "Mount zfs volumes";
after = [ "zpool-import.service" ];
wantedBy = [ "local-fs.target" ];
serviceConfig = {
Type = "oneshot";
RemainAfterExit = true;
ExecStart = "${kernel.zfs}/sbin/zfs mount -a";
ExecStop = "${kernel.zfs}/sbin/zfs umount -a";
};
};
system.fsPackages = [ kernel.zfs ]; # XXX: needed? zfs doesn't have a fsck
environment.systemPackages = [ kernel.zfs ];
services.udev.packages = [ kernel.zfs ]; # to hook zvol naming, etc.