The /etc/zfs/zpool.cache file
Whenever a pool is imported on the system it will be added to the /etc/zfs/zpool.cache file
. This file stores pool configuration information, such as the device names and pool state. If this file exists when running the zpool import
command then it will be used to determine the list of pools available for import. When a pool is not listed in the cache file it will need to be detected and imported using the zpool import -d /dev/disk/by-id
command.
Generating a new /etc/zfs/zpool.cache file
The /etc/zfs/zpool.cache
file will be automatically updated when your pool configuration is changed. However, if for some reason it becomes stale you can force the generation of a new /etc/zfs/zpool.cache
file by setting the cachefile property on the pool.
$ zpool set cachefile=/etc/zfs/zpool.cache tank
Conversely the cache file can be disabled by setting cachefile=none
. This is useful for failover configurations where the pool should always be explicitly imported by the failover software.
$ zpool set cachefile=none tank