I was hoping for some help with the following questions:
What are some best practices when preparing to export a zfs pool?
When I import the pool under FreeBSD, will I need to create GPT labels for each drive
or will my “/dev/disk/by-id” reference and defined drives in the exported pool
be persistent after the import to FreeBSD.
Basically, once I export the pool, FreeBSD will be installed on the same system and
after that the pool will be imported under the new FreeBSD installation.
Building the pool from scratch is not an option, in this case.
Nothing special you need to do. zpool export poolname before your last shutdown in Ubuntu is nice, but not strictly necessary (if you didn’t export the pool, you’ll need an -f when you import it to a different system later, but no big deal really).
/dev/disk/by-id is a Linux-ism, it won’t happen that way under FreeBSD. On FreeBSD, you can create GPT labels and use those, or you can use /dev/diskid. But unlike Linux’s version, FreeBSD’s must first be enabled, last time I messed with it.
You need geom_label_load=YES and kern.geom.label.disk.ident_enable="1" set in /boot/loader.conf. Also, I don’t think FreeBSD exposes disk IDs at all for NVME–though my FreeBSD chops are a bit rusty, so you might want to check elsewhere before you take that as gospel.
Once you can see your disks showing up in /dev/diskid, you can zpool import -d /dev/diskid mypool and Bob’s your uncle.
To add to what Jim said, if you just zpool export $foo on Ubuntu, and zpool import $foo on FreeBSD, it will “just work”, but, you may wish to do the diskid thing to have the device names in ZFS be the disk serial # instead of just ada0 and ada1 etc.