Skip to content

Instantly share code, notes, and snippets.

@noxowl
Created January 5, 2020 16:51
Show Gist options
  • Save noxowl/e7e6f11d96738a4f68bcbd70d28c3128 to your computer and use it in GitHub Desktop.
Save noxowl/e7e6f11d96738a4f68bcbd70d28c3128 to your computer and use it in GitHub Desktop.

Method written by reddit user jkool702: Original Post

#!/bin/bash

cat << EOF | sudo tee '/usr/lib/systemd/system/zfs-modprobe.service'
[Unit]
Description=Import ZFS kernel modules using modprobe 
Documentation=man:modprobe(8)
DefaultDependencies=no
Requires=systemd-udev-settle.service
After=systemd-udev-settle.service
After=cryptsetup.target
Before=zfs-import.target
Before=zfs-import-scan.service
Before=zfs-import-cache.service

[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/sbin/modprobe zfs

[Install]
WantedBy=zfs-import.target
EOF
sudo sync
sudo systemctl daemon-reload
sudo systemctl enable zfs-modprobe.service
sudo systemctl daemon-reload
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment