[SOLVED] ZFS not mounting on boot

Clete2

New Member
Nov 26, 2022
17
5
3
I've been having an issue since 2019. I found some others on these forums with the same issues but none of the fixes worked for me.

ZFS doesn't mount my datasets on boot, and in fact it "forgets" about my second pool.

I have 2 pools:
* rpool -> SSD / boot
* tank -> HDD / data

My fix for the past 2 years has been to add "zpool import tank; zfs mount -O -a" to `/etc/rc.local` and also add startup delays to any service which depends on ZFS, including my containers. But this fix is very fragile. I want to get away from this fix and do it the right way.

What I found was to enable `zfs-mount` and `zfs-import-cache` services. I enabled them but they are not starting on boot. What have I done wrong?


⚡  ~  systemctl status zfs-mount.service
● zfs-mount.service - Mount ZFS filesystems
Loaded: loaded (/lib/systemd/system/zfs-mount.service; enabled; vendor preset: enabled)
Active: inactive (dead)
Docs: man:zfs(8)
⚡  ~  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; vendor preset: disabled)
Active: inactive (dead)
Docs: man:zpool(8)


If I manually start the services they work but they do not load on boot.
 
Solved!

Code:
systemctl enable zfs-volumes.target
systemctl enable zfs.target
systemctl enable zfs-import.target

I didn't realize I had to enable these targets to get the services to load. I read up a little on targets and it makes sense to me now (sorta).
 

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!