zfs change device path

First of all: Before disconnecting or shutting down, you should export “external” pools. When you import them again, the current set of device names will be used.

If you want to import a pool using “predictable device names”, you can use the method outlined in Arch Linux’ ZFS Installation Guide:

zpool import -d /dev/disk/by-id <poolname>

The important part is the -d parameter. It tells zpool where to look for devices. The /dev/disk/by-id directory should always be available when using a reasonably recent distribution with udev.

That being said, I didn’t have that much luck with this method, the device names always reverted to their “sda1” state after rebooting.