Always do "zpool export" for easier and/or more reliable recovery?

Setting up a new (zfs-on-linux) setup with a zpool as data storage (not for system) I would like to prepare myself for the worst case as far as possible. But as I do not have any practical ZFS recovery experience I do not know what I might need in such scenario.

Asuming the host system catches fire with only the ZFS disks surviving, I want to be able to recover the pool as easy and reliable as possible. There was a answer in that direction on stackoverflow five years ago (Backup ZFS pool metadata) stating that ZFS disks will automatically be recognized when running "zpool import". The manpage for "zpool export" states:

Exports the given pools from the system. All devices are marked as exported, but are still considered in use by other subsystems. The devices can be moved between systems (even those of different endianness) and imported as long as a sufficient number of devices are present.

That makes me wonder: Should I always do an export after setting up a new zpool, to increase the chances of a secussful recovery? Or is there any metadata not written to the disks, that should be in a backup?


Solution 1:

Theres is no situation in regular use where you would want to manually run a zpool export. Pools are imported expected automatically during the Linux boot and shutdown process.

However, ZFS zpools are already and inherently portable, provided access to the disks is still possible. You don't need to take any additional action do to what you're asking about.

Solution 2:

If you zpool export a pool, the system to which the disks are attached can no longer use it, until you zpool import it again. So you can't do that routinely. It's meant for situations when you know you are moving a zpool somewhere by moving its physical media.

If you need to import a pool that wasn't properly exported, for instance because the server it was in died, you can simply use zpool import -f.