ZFS: automatically import zpools and mount zfs filesystems.
Patch contributed by Jack Cummings.
This commit is contained in:
parent
17f10f70ad
commit
d6df27277b
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user