ZFS LOOSE POOL AFTER SERVER REBOOT (CENTOS)

Problem:

Today I want to share something really quickly with you. If you are trying to build a storage using ZFSONLINUX and CentOS 7.2 and up, then you will experience a problem, when the server reboots, ZFS loses the pool. You can always import zfs pool manually or script it, but it is a hustle.

Now the issue is not new, it happened before back in 2014 and the ZFSONLINUX project have released the patch for it. It seems that the issue has been re-introduced. So without further ado, here we go.

Given:

Operating System: CentOS Linux release 7.2.1511 (Core)

Kernel: 3.10.0-327.36.2.el7.x86_64

ZFS version: zfs-0.6.5.8-1.el7.centos.x86_64

After you create a new pool and reboot a server for whatever reason, zfs throughs you an error: no pool found.

Solution:

This is a work around and I hope that the issue will be resolved shortly, but as of today, all you have to do to solve this on CentOS 7.2 and up (I believe Ubuntu can do the same), is run this command:

systemctl enable zfs-import-cache

After a reboot, your ZFS module will be able to find the pool and import it.

Enjoy!