ZFS pool doesn’t mount on startup in CentOS 7

I recently upgraded two of my CentOS 6 VMs to CentOS 7.3.  Both of these utilized ZFS.  I installed ZFS using the repos from zfsonlinux.com as I have always done.  I do always use the kmod version since I’ve had issues with the dkms version in the past when performing updates.  I got my zpools imported just fine, but noticed that after rebooting that I would have to re-import them again.  I started investigating this and eventually discovered such a simple solution.

For some reason, when installing ZFS on CentOS 7.3, the services associated with ZFS don’t get enabled automatically and therefore don’t start when the system starts.  To fix this, simply run the following commands:

systemctl enable zfs-import-cache
systemctl enable zfs-import-scan
systemctl enable zfs-mount
systemctl enable zfs-share
systemctl enable zfs-zed
systemctl enable zfs.target

After enabling these services, I rebooted my system and then re-imported my zpools.  After a subsequent reboot, the zpools mounted normally.

Hopefully this will help save someone else lots of time in trying to figure out the root cause of this.  I was beginning to get frustrated myself and was so happy that it was something this simple.  As always, thanks for reading and feel free to leave comments below.

6 thoughts on “ZFS pool doesn’t mount on startup in CentOS 7

Leave a Reply