[SOLVED] ZFS Pool Import on boot

skinnyl

New Member
Oct 18, 2023
3
0
1
Hi there,

I'm getting the following error on boot..
[FAILED] Failed to start zfs-import..rvice - Import ZFS pool zfs01
But after a while it boots and mounts all the pools

This is what I've noticed in syslog..

Mar 12 14:47:58 meg systemd[1]: Starting zfs-import-cache.service - Import ZFS pools by cache file...
Mar 12 14:47:58 meg systemd[1]: zfs-import-scan.service - Import ZFS pools by device scanning was skipped because of an unmet condition check (ConditionFileNotEmpty=!/etc/zfs/zpool.cache).
Mar 12 14:47:58 meg systemd[1]: Starting zfs-import@zfs01.service - Import ZFS pool zfs01...
Mar 12 14:47:58 meg zpool[1074]: cannot import 'zfs01': no such pool available
Mar 12 14:47:58 meg systemd[1]: zfs-import@zfs01.service: Main process exited, code=exited, status=1/FAILURE
Mar 12 14:47:58 meg systemd[1]: zfs-import@zfs01.service: Failed with result 'exit-code'.
Mar 12 14:47:58 meg systemd[1]: Failed to start zfs-import@zfs01.service - Import ZFS pool zfs01.
Mar 12 14:47:58 meg kernel: fbcon: Taking over console
Mar 12 14:47:58 meg kernel: zd0: p1 p2
Mar 12 14:47:58 meg kernel: zd16: p1 p2
Mar 12 14:47:58 meg kernel: zd32: p1 p2
Mar 12 14:47:58 meg kernel: zd48: p1 p2 p3
Mar 12 14:47:58 meg kernel: Alternate GPT is invalid, using primary GPT.
Mar 12 14:47:58 meg kernel: zd64: p1 p2 p3
Mar 12 14:47:58 meg systemd[1]: Finished zfs-import-cache.service - Import ZFS pools by cache file.
Mar 12 14:47:58 meg systemd[1]: Reached target zfs-import.target - ZFS pool import target.
Mar 12 14:47:58 meg lvm[1483]: /dev/zd64p3 excluded: device is rejected by filter config.
Mar 12 14:47:58 meg systemd[1]: Starting zfs-mount.service - Mount ZFS filesystems...
Mar 12 14:47:58 meg systemd[1]: Starting zfs-volume-wait.service - Wait for ZFS Volume (zvol) links in /dev...
Mar 12 14:47:58 meg zvol_wait[1486]: Testing 5 zvol links
Mar 12 14:47:58 meg zvol_wait[1486]: All zvol links are now present.
Mar 12 14:47:58 meg systemd[1]: Finished zfs-volume-wait.service - Wait for ZFS Volume (zvol) links in /dev.
Mar 12 14:47:58 meg systemd[1]: Reached target zfs-volumes.target - ZFS volumes are ready.
Mar 12 14:47:58 meg systemd[1]: Finished zfs-mount.service - Mount ZFS filesystems.

Now, I've read a few similar threads, but I'm not 100% on what to do here, I tried the below with no change.

Bash:
zpool set cachefile=/etc/zfs/zpool.cache YOUR_POOLNAME
update-initramfs -k all -u
reboot

I'm pretty sure this happened after installing a new network card, all the pool drives are nvmes on a pci controller.

Help apprecaited.

Thanks, Jack.
 
Also tried the below posts advice.

https://forum.proxmox.com/threads/second-zfs-pool-failed-to-import-on-boot.102409/post-441210

Which has removed the 'FAILED' error but left me with a long boot time and the below which doesn seem 100% happy..

Mar 12 19:56:33 meg systemd[1]: Starting zfs-import-cache.service - Import ZFS pools by cache file...
Mar 12 19:56:33 meg systemd[1]: zfs-import-scan.service - Import ZFS pools by device scanning was skipped because of an unmet condition check (ConditionFileNotEmpty=!/etc/zfs/zpool.cache).
Mar 12 19:56:33 meg zpool[1075]: no pools available to import
Mar 12 19:56:33 meg systemd[1]: Finished zfs-import-cache.service - Import ZFS pools by cache file.
Mar 12 19:56:33 meg systemd[1]: Reached target zfs-import.target - ZFS pool import target.
Mar 12 19:56:33 meg systemd[1]: Starting zfs-mount.service - Mount ZFS filesystems...
Mar 12 19:56:33 meg systemd[1]: Starting zfs-volume-wait.service - Wait for ZFS Volume (zvol) links in /dev...
Mar 12 19:56:33 meg zvol_wait[1078]: No zvols found, nothing to do.
Mar 12 19:56:33 meg systemd[1]: Finished zfs-volume-wait.service - Wait for ZFS Volume (zvol) links in /dev.
Mar 12 19:56:33 meg systemd[1]: Reached target zfs-volumes.target - ZFS volumes are ready.
Mar 12 19:56:33 meg systemd[1]: Finished zfs-mount.service - Mount ZFS filesystems.
Mar 12 19:58:02 meg systemd[1]: dev-disk-by\x2duuid-9d1bbbe6\x2db265\x2d402c\x2d80a7\x2d4dfc00adec61.device: Job dev-disk-by\x2duuid-9d1bbbe6\x2db265\x2d402c\x2d80a7\x2d4dfc00adec61.device/start timed out.
Mar 12 19:58:02 meg systemd[1]: Timed out waiting for device dev-disk-by\x2duuid-9d1bbbe6\x2db265\x2d402c\x2d80a7\x2d4dfc00adec61.device - /dev/disk/by-uuid/9d1bbbe6-b265-402c-80a7-4dfc00adec61.

Again, if left, it comes up fine but would like to smooth it out if possible.

Thanks.

Edit:

Would: /lib/systemd/system/zfs-import-cache.service need 'zpool.cache' changed to 'zpool2.cache' after doing this:

// Edit:
Just for all those who find this thread, I just re-disabled the import for my datapool with systemctl disable zfs-import@zfs01 and changed the cachefile of this pool to a seperate one /etc/zfs/zpool2.cache with zpool set cachefile=/etc/zfs/zpool2.cache zfs01.

[Unit]
Description=Import ZFS pools by cache file
Documentation=man:zpool(8)
DefaultDependencies=no
Requires=systemd-udev-settle.service
After=systemd-udev-settle.service
After=cryptsetup.target
After=multipathd.service
After=systemd-remount-fs.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 -c /etc/zfs/zpool.cache -aN $ZPOOL_IMPORT_OPTS

[Install]
WantedBy=zfs-import.target
 
Last edited:
Had time this morning to test the above, and renaming to 'zpool2.cache' seems to have done the trick - no errors in the syslog or on boot. Boot was faster too. Marking as solved for future pilgrims.
 

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!