NVMe passthrough to TrueNAS - Failed to start zfs-import-scan.service

rtorres

Member
Apr 3, 2024
60
11
8
33
Stockton, CA
Hello all,


I have an NVMe that I passed through to a TrueNAS VM as a sole network storage device. After passing through via Proxmox and configuring TrueNAS to use the drive as a NAS, I have seen the 'Failed to start zfs-import-scan.service - Import ZFS pools by device scanning.' error after every boot.

What can I do to resolve the error message?

Thank you in advance! :)


root@elitemini:~# systemctl status zfs-import-scan.service
× zfs-import-scan.service - Import ZFS pools by device scanning
Loaded: loaded (/lib/systemd/system/zfs-import-scan.service; enabled; preset: disabled)
Active: failed (Result: exit-code) since Sat 2024-06-01 01:47:39 PDT; 21h ago
Docs: man:zpool(8)
Process: 762 ExecStart=/sbin/zpool import -aN -d /dev/disk/by-id -o cachefile=none $ZPOOL_IMPORT_OPTS (code=exited, status=1/FAILURE)
Main PID: 762 (code=exited, status=1/FAILURE)
CPU: 27ms

Jun 01 01:47:39 elitemini systemd[1]: Starting zfs-import-scan.service - Import ZFS pools by device scanning...
Jun 01 01:47:39 elitemini zpool[762]: cannot import 'Elite Mini NAS Drive': pool was previously in use from another system.
Jun 01 01:47:39 elitemini zpool[762]: Last accessed by truenas (hostid=141d4132) at Sat Jun 1 01:46:39 2024
Jun 01 01:47:39 elitemini zpool[762]: The pool can be imported, use 'zpool import -f' to import the pool.
Jun 01 01:47:39 elitemini zpool[762]: cannot import 'boot-pool': pool was previously in use from another system.
Jun 01 01:47:39 elitemini zpool[762]: Last accessed by <unknown> (hostid=0) at Wed Dec 31 16:00:00 1969
Jun 01 01:47:39 elitemini zpool[762]: The pool can be imported, use 'zpool import -f' to import the pool.
Jun 01 01:47:39 elitemini systemd[1]: zfs-import-scan.service: Main process exited, code=exited, status=1/FAILURE
Jun 01 01:47:39 elitemini systemd[1]: zfs-import-scan.service: Failed with result 'exit-code'.
Jun 01 01:47:39 elitemini systemd[1]: Failed to start zfs-import-scan.service - Import ZFS pools by device scanning.
 
Did you use PCIe passthrough? Try hiding the NVMe from Proxmox by early binding to vfio-pci (and you might need a softdep to make sure the vfio-pci driver loads before nvme driver). This would be very similar to making sure a GPU is not touched by Proxmox before starting the VM with passthrough. (Don't blacklist nvme if you have other NVMe drives!)
 
Last edited:
Did you use PCIe passthrough? Try hiding the NVMe from Proxmox by early binding to vfio-pci (and you might need a softdep to make sure the vfio-pci driver loads before nvme driver). This would be very similar to making sure a GPU is not touched by Proxmox before starting the VM with passthrough. (Don't blacklist nvme if you have other NVMe drives!)
Thank you for your ultra fast response!

I did do it through PCIe passthrough to the VM via this command:
qm set 102 -scsi1 /dev/disk/by-id/nvme-model-and-serial-here

and made an edit to /etc/pve/qemu-server/102.conf to add serial # (since per video it is a requirement for trueNAS to have a serial number on the drive)

Considering I am very new to passthrough, what would be the command to early binding to vfio-pci?

I do have another NVMe in the system that Proxmox boots from. Would this also be affected?

Thanks again!
 
I did do it through PCIe passthrough to the VM via this command:
qm set 102 -scsi1 /dev/disk/by-id/nvme-model-and-serial-here
That is NOT PCIe passthrough, that is disk passthrough. Ignore my previous suggestions. I don't know how to help in this case. (PCIe passthrough comes with lots of caveats, so I don't recommend it either.)
 
Last edited:
  • Like
Reactions: rtorres
I know this is an old thread, but did anyone have a solution?
I am in the exact same situation... Followed guides on setting up TrueNas on Proxmox with Disk Passthrough, and it worked fine - until I reeboted the proxmox server...
With so many guides out there all describing the same approach i think its wird noone have mentioned or resolved it earlier

When it comes to this error the whole system halts, its not booting up