2

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?

  • Also take a step back and design your recovery objectives. Do you want to be able to restore a deleted file? Then importing the existing disks won't help. Snapshots, replication, and off site media will. – John Mahowald Feb 18 '19 at 15:04
2

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.

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.