zfs-import-scan.service fails on virtual machine volume

gpz500

New Member
Nov 29, 2024
1
0
1
Hi,
since I created a VM with FreeBSD and a ZFS volume, zfs-import-scan.service fails:

Code:
root@pve:~# 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 Mon 2024-11-11 10:25:58 CET; 2 weeks 4 days ago
       Docs: man:zpool(8)
   Main PID: 713 (code=exited, status=1/FAILURE)
        CPU: 36ms

Nov 11 10:25:56 pve systemd[1]: Starting zfs-import-scan.service - Import ZFS pools by device scanning...
Nov 11 10:25:58 pve zpool[713]: cannot import 'zroot': pool was previously in use from another system.
Nov 11 10:25:58 pve zpool[713]: Last accessed by  (hostid=0) at Fri Jun 14 15:17:11 2024
Nov 11 10:25:58 pve zpool[713]: The pool can be imported, use 'zpool import -f' to import the pool.
Nov 11 10:25:58 pve systemd[1]: zfs-import-scan.service: Main process exited, code=exited, status=1/FAILURE
Nov 11 10:25:58 pve systemd[1]: zfs-import-scan.service: Failed with result 'exit-code'.
Nov 11 10:25:58 pve systemd[1]: Failed to start zfs-import-scan.service - Import ZFS pools by device scanning.
root@pve:~# systemctl cat zfs-import-scan.service
# /lib/systemd/system/zfs-import-scan.service
[Unit]
Description=Import ZFS pools by device scanning
Documentation=man:zpool(8)
DefaultDependencies=no
Requires=systemd-udev-settle.service
After=systemd-udev-settle.service
After=cryptsetup.target
After=multipathd.service
Before=zfs-import.target
ConditionFileNotEmpty=!/etc/zfs/zpool.cache
ConditionPathIsDirectory=/sys/module/zfs

[Service]
Type=oneshot
RemainAfterExit=yes
EnvironmentFile=-/etc/default/zfs
ExecStart=/sbin/zpool import -aN -d /dev/disk/by-id -o cachefile=none $ZPOOL_IMPORT_OPTS

[Install]
WantedBy=zfs-import.target

Actually the 'zroot' pool belongs to the FreeBSD Virtual Machine, and lives into some LVM Thin volumes, that are scanned together with the physical volumes by the command
Code:
/sbin/zpool import -aN -d /dev/disk/by-id -o cachefile=none $ZPOOL_IMPORT_OPTS
.
Is there any way to exclude that specific pool from scanning?
Thank You so much!