ZFS pool not auto-mounting at boot after zpool upgrade fix

Davidoff

Well-Known Member
Nov 19, 2017
66
2
48
A very minor issue but one I'm hoping there's an easy fix for. In brief, I made the mistake of running zpool upgrade a while back which of course borked my system rendering it unbootable. Thankfully, I found the specific page that describes how to fix it and managed to unbork things so that the system now boots just fine, with one exception.

I have three zpools on my system: rpool which is a mirrored pool that serves as the boot drive; rpool2, another mirrored pool that serves as a supplemental pool to store system images, containers, etc.; and data, which is only used for data storage and not any system functions. After implementing the fix, rpooland rpool2 are auto-mounted as they were in the past, but data is not. Before implementing the fix, data was auto-mounted. So now each time I reboot, I need to manually run zpool import data. This isn't of course the end of the world, but it sure would be nice to fix this so that it happens automatically once more.

I've googled the issue and found the various suggestions on which ZFS services, etc. need to be enabled, and have checked to confirm they're all running. Not sure how else to fix this. Any suggestions would be most gratefully received.
 
Hi!
zfs 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.
 
  • Like
Reactions: Davidoff
Hi!
zfs 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.
Perfect. This seemed to do the trick - thank you very much!

Just one related question: It turns out that zfs-import@data was disabled and so I enabled it, but interestingly zfs-import@rpool (which serves as my boot drive) was also disabled. Should I also enable that one? The system seems to boot just fine, and it shows up just fine when I run zpool status, so just thought I'd double check in case doing so might just muck things up further.
 
Hi!
your rpool is probably getting imported automatically (your /proc/cmdline also has a zfs-specific directive) because the service starts too late to import it as a boot drive. Note that there is also a zpool.cache file, which gets read by the zfs-import-cache.service which also imports all the pools in the file.
So either the import is done automatically by the kernel at startup, or the import pool is cached and imported by the zfs-import-cache.service.

Sadly these things are documented very poorly (or none at all in this case).
 
Hi!
your rpool is probably getting imported automatically (your /proc/cmdline also has a zfs-specific directive) because the service starts too late to import it as a boot drive. Note that there is also a zpool.cache file, which gets read by the zfs-import-cache.service which also imports all the pools in the file.
So either the import is done automatically by the kernel at startup, or the import pool is cached and imported by the zfs-import-cache.service.

Sadly these things are documented very poorly (or none at all in this case).
Appreciate the additional information Gabriel. That makes sense. Guess I'll leave the rest alone then for the time being.
 

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!