[SOLVED] Second ZFS pool failed to import on boot

mstefan

New Member
Jan 3, 2022
10
3
3
31
Hello,

i have 2 zfs pools on my machine (PVE 7.1):
  • rpool (Mirror SSD)
  • datapool (Mirror HDD)
Everytime i boot up my machine, i get an error, the import of datapool failed.
A view in the syslog shows everytime the same enty:
Code:
Jan  3 13:31:29 pve systemd[1]: Starting Import ZFS pool datapool...
Jan  3 13:31:29 pve zpool[1642]: cannot import 'datapool': no such pool available
Jan  3 13:31:29 pve systemd[1]: zfs-import@datapool.service: Main process exited, code=exited, status=1/FAILURE
Jan  3 13:31:29 pve systemd[1]: zfs-import@datapool.service: Failed with result 'exit-code'.
Jan  3 13:31:29 pve systemd[1]: Failed to start Import ZFS pool datapool.
Jan  3 13:31:29 pve zed: eid=7 class=config_sync pool='datapool'
Jan  3 13:31:29 pve zed: eid=8 class=pool_import pool='datapool'
Jan  3 13:31:29 pve zed: eid=10 class=config_sync pool='datapool'

I already tried:
  • adding rootdelay=10 to /etc/defaults/grub
  • adding rootdelay=10 to /etc/kernel/cmdline
  • adding ZFS_INITRD_PRE_MOUNTROOT_SLEEP='5' and ZFS_INITRD_POST_MODPROBE_SLEEP='5' to /etc/defaults/zfs
and refreshed with pve-efiboot-tool refresh.
None of these helped.

When PVE is up and running, the pool is online and everything ist fine.

Is this something i have to worry about?
How can i fix this error message?

Thanks for your help!
 

oguz

Proxmox Retired Staff
Retired Staff
Nov 19, 2018
5,207
693
118
hi,

can you check the following:
Code:
systemctl status zfs-import.service zfs-import-cache.service

if the zfs-import-cache service is enabled, then maybe your zfs cachefile is corrupt. you could try:
Code:
zpool set cachefile=/etc/zfs/zpool.cache <YOURPOOL> # do this for all your pools
update-initramfs -k all -u
reboot

or alternatively you can use the zfs-import service (can cause slower boot time since it needs to scan the drives without cache) instead of zfs-import-cache: systemctl disable zfs-import-cache.service && systemctl enable zfs-import.service followed by a reboot should hopefully fix the issue.
 

mstefan

New Member
Jan 3, 2022
10
3
3
31
Thanks for your reply.

Here is the output:
Code:
systemctl status zfs-import.service zfs-import-cache.service
● zfs-import.service
     Loaded: masked (Reason: Unit zfs-import.service is masked.)
     Active: inactive (dead)

● zfs-import-cache.service - Import ZFS pools by cache file
     Loaded: loaded (/lib/systemd/system/zfs-import-cache.service; enabled; vendor preset: enabled)
     Active: active (exited) since Mon 2022-01-03 13:31:29 CET; 1h 26min ago
       Docs: man:zpool(8)
   Main PID: 1641 (code=exited, status=0/SUCCESS)
      Tasks: 0 (limit: 76969)
     Memory: 0B
        CPU: 0
     CGroup: /system.slice/zfs-import-cache.service

Jan 03 13:31:28 pve systemd[1]: Starting Import ZFS pools by cache file...
Jan 03 13:31:29 pve systemd[1]: Finished Import ZFS pools by cache file.

Setting the cachefile and updating initramsfs didnt change anything.
The exact error on the bootscreen is:
[FAILED] Failed to start Import ZFS pool datapool.

Disabling cache and activating import throws an error:
Code:
systemctl disable zfs-import-cache.service && systemctl enable zfs-import.service
Removed /etc/systemd/system/zfs-import.target.wants/zfs-import-cache.service.
Failed to enable unit: Unit file /lib/systemd/system/zfs-import.service is masked.
 

oguz

Proxmox Retired Staff
Retired Staff
Nov 19, 2018
5,207
693
118
Failed to enable unit: Unit file /lib/systemd/system/zfs-import.service is masked.
ah sorry. you can try like: systemctl enable zfs-import@POOLNAME and it should be enabled.

if after reboot you still get the same error please post the output from journalctl -b0 | grep -i zfs -C 2
 
Last edited:

mstefan

New Member
Jan 3, 2022
10
3
3
31
I enabled zfs-import for my datapool and deactivated cache for the pool with zpool set cachefile=none datapool.
Now after a reboot no error occurs.

But i really do not understand what the problem is/was.
This solution just changes the behavior to search for pools (in my understanding)

I will go on trying. Maybe a cachefile per pool makes a difference?

Thanks for your help!

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

No error after reboot.

I will have a closer look in the future if this error will come back again.
 
Last edited:
  • Like
Reactions: i_am_jam

oguz

Proxmox Retired Staff
Retired Staff
Nov 19, 2018
5,207
693
118
Now after a reboot no error occurs.
great!! also thanks for trying the alternative solution as well :)

please mark the thread [SOLVED] if the error doesn't occur anymore, so others can know what to expect ;)
 

madmaximus

New Member
May 20, 2022
2
0
1
Have the same problem with a second pool named BIG for HDD pool
But have some issues with errors on the pool status
Sorry i don't have zpool status before the manip.
I do the same manipulation as you "set a second cache for this pool" but steal have errors on the pool for one disk (all the disk are new 200hours)
PVE1_BIG ONLINE 0 0 0
raidz1-0 ONLINE 0 0 0
ata-WDC_WD40EFZX-68AWUN0_WD-WX82DA112DD4 ONLINE 1 1 0
ata-WDC_WD40EFZX-68AWUN0_WD-WX12DC128V96 ONLINE 0 0 0
ata-WDC_WD40EFZX-68AWUN0_WD-WX52DB45EVT4 ONLINE 0 0 0
Maybe the first disk id defective but does anybody knows what is the consequences of using the same cache for 2 different pools ?
 

madmaximus

New Member
May 20, 2022
2
0
1
Well it seems the set cachefile doesn't resist to a reboot
Code:
PVE1_BIG  cachefile                      none                           local
The service is already inactive
Code:
systemctl status zfs-import@PVE1_BIG

zfs-import@PVE1_BIG.service - Import ZFS pool PVE1_BIG

     Loaded: loaded (/lib/systemd/system/zfs-import@.service; disabled; vendor preset: enabled)

     Active: inactive (dead)

       Docs: man:zpool(8)
 

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 your own in 60 seconds.

Buy now!