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”
Thanks for this, josh. It solved a major problem for me. Now I don’t have to go back to Solaris 11. ?
Thanks, you saved my day !!!
Thanks for your post, it solved my problem 🙂
thank you. I also had to enable zfs-import.target (per the following github discussion)
Yeah, unlike Ubuntu, CentOS does not start nor enable services when they are installed.
For me this take effect
systemctl enable zfs-import-scan