ZFS zpool raid1z change disk path from /dev/adaX to /dev/gpt/labelX


I have root mount point on a raidz1 pool.
After one disk was broken I replaced it and change path to a gpt label and got following:
        NAME                      STATE     READ WRITE CKSUM
        zroot                     ONLINE     0     0     0
          raidz1-0                 ONLINE     0     0     0
            ada0p3                ONLINE       0     0     0
            ada1p3                ONLINE       0     0     0
            ada2p3                ONLINE       0     0     0
            gpt/disk3             ONLINE       0     0     0

As I know it's better having a pool based on gpt label instead of adaX.

How can I change the disk path from /dev/adaX to /dev/gpt/labelX without destroying the pool?

I have tried:
offline a disk
next replace the disk but it doesn't work.

Now I'm trying - offline a disk, clean the disk by dd < /dev/zero > /dev/ada2 next restore ...

What is the best way doing that?

Thanks in advance!
Last edited by a moderator:
Export the pool.
Modify the GPT on each disk to add a label to the partitions.
Then import the pool using -d to point it to the GPT labels: zpool import -d /dev/gpt zroot

As this is your root pool, you'll need to boot off an mfsBSD USB stick or similar to work on the pool.