PBS on PVE zpool import after reboot

Jun 6, 2024
20
0
1
I did setup a PBS on same host as a pve (I will not use this pve for running propouse, I have others), but I need to connect my backup disk who is a iscsi disk (previous used on another pbs) .
My iscsi disk is going up normaly after reboot, but zpool import doesn't work.
So my datastore is not available after reboot host.


# systemctl status zfs-import-cache.service
○ zfs-import-cache.service - Import ZFS pools by cache file
Loaded: loaded (/lib/systemd/system/zfs-import-cache.service; enabled; preset: enabled)
Active: inactive (dead)
Condition: start condition failed at Wed 2024-08-14 21:55:25 -03; 3min 16s ago
└─ ConditionFileNotEmpty=/etc/zfs/zpool.cache was not met
Docs: man:zpool(8)

Aug 14 21:55:25 pve4 systemd[1]: zfs-import-cache.service - Import ZFS pools by cache file was skipped because of an unmet condition check (ConditionFileNotEmp
 
Last edited:
Hi!
this is the zfs-import-cache service which imports pools mentioned in the zpool.cache file (which in your case is empty). zfs also creates a service for each pool, i.e. zfs-import@<pool-name>.service which runs at startup and imports the pool. Check if there is a service with your pool name and enable it if it isn't (systemctl enable). If it's enabled, check its logs for any errors using systemctl status.
 
Hi!
There was no service 'zfs-import@poolname.service', and no exclusive cache file, so I did create the cache file with the following:
Code:
zpool set cachefile=/etc/zfs/zpoolbackups.cache backups
and then created a service for that import.

On reboot, it fails. I think it's because the this is iscsi and zpool import is running before iscsi is ready, but I don't know I to verify this.

My service is working fine, when I start it manually.
Code:
root@pve4:~# zpool list
no pools available
root@pve4:~# systemctl status zfs-import-backups-cache
● zfs-import-backups-cache.service - Import ZFS pools by cache file
     Loaded: loaded (/etc/systemd/system/zfs-import-backups-cache.service; enabled; preset: enabled)
     Active: active (exited) since Wed 2024-08-21 13:41:18 -03; 32s ago
       Docs: man:zpool(8)
    Process: 546 ExecStart=/sbin/zpool import -c /etc/zfs/zpoolbackups.cache -aN $ZPOOL_IMPORT_OPTS>
   Main PID: 546 (code=exited, status=0/SUCCESS)
        CPU: 36ms

Aug 21 13:41:14 pve4 systemd[1]: Starting zfs-import-backups-cache.service - Import ZFS pools by ca>
Aug 21 13:41:17 pve4 zpool[546]: cannot import 'backups': no such pool or dataset
Aug 21 13:41:18 pve4 zpool[546]: no pools available to import
Aug 21 13:41:18 pve4 zpool[546]:         Destroy and re-create the pool from
Aug 21 13:41:18 pve4 zpool[546]:         a backup source.
Aug 21 13:41:18 pve4 zpool[546]: cachefile import failed, retrying
Aug 21 13:41:18 pve4 systemd[1]: Finished zfs-import-backups-cache.service - Import ZFS pools by ca>
root@pve4:~# systemctl status zfs-import-backups-cache
● zfs-import-backups-cache.service - Import ZFS pools by cache file
     Loaded: loaded (/etc/systemd/system/zfs-import-backups-cache.service; enabled; preset: enabled)
     Active: active (exited) since Wed 2024-08-21 13:41:18 -03; 54s ago
       Docs: man:zpool(8)
    Process: 546 ExecStart=/sbin/zpool import -c /etc/zfs/zpoolbackups.cache -aN $ZPOOL_IMPORT_OPTS>
   Main PID: 546 (code=exited, status=0/SUCCESS)
        CPU: 36ms

Aug 21 13:41:14 pve4 systemd[1]: Starting zfs-import-backups-cache.service - Import ZFS pools by ca>
Aug 21 13:41:17 pve4 zpool[546]: cannot import 'backups': no such pool or dataset
Aug 21 13:41:18 pve4 zpool[546]: no pools available to import
Aug 21 13:41:18 pve4 zpool[546]:         Destroy and re-create the pool from
Aug 21 13:41:18 pve4 zpool[546]:         a backup source.
Aug 21 13:41:18 pve4 zpool[546]: cachefile import failed, retrying
Aug 21 13:41:18 pve4 systemd[1]: Finished zfs-import-backups-cache.service - Import ZFS pools by ca>
root@pve4:~# systemctl restart zfs-import-backups-cache
root@pve4:~# zpool list
NAME      SIZE  ALLOC   FREE  CKPOINT  EXPANDSZ   FRAG    CAP  DEDUP    HEALTH  ALTROOT
backups  5.98T  3.79T  2.19T        -         -    21%    63%  1.00x    ONLINE  -
root@pve4:~# systemctl status zfs-import-backups-cache
● zfs-import-backups-cache.service - Import ZFS pools by cache file
     Loaded: loaded (/etc/systemd/system/zfs-import-backups-cache.service; enabled; preset: enabled)
     Active: active (exited) since Wed 2024-08-21 13:42:26 -03; 14s ago
       Docs: man:zpool(8)
    Process: 1479 ExecStart=/sbin/zpool import -c /etc/zfs/zpoolbackups.cache -aN $ZPOOL_IMPORT_OPT>
   Main PID: 1479 (code=exited, status=0/SUCCESS)
        CPU: 265ms

Aug 21 13:42:24 pve4 systemd[1]: Starting zfs-import-backups-cache.service - Import ZFS pools by ca>
Aug 21 13:42:26 pve4 systemd[1]: Finished zfs-import-backups-cache.service - Import ZFS pools by ca>
 
Hmm, yes looks like it.
You could try including this line in the /etc/modprobe.d/zfs.conf file:
Code:
options scsi_mod scan=sync
this forces the zfs module to do a scsi scan before loading.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!