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

mo' asked:

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?

My answer:

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.

View the full question and any other answers on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.