ZFS on Ubuntu Export/Import to FreeBSD

Hello All,

I will be migrating an existing ZFS pool from “Ubuntu 22.04.5 LTS” to FreeBSD 14.2.
The pool will remain on the same box.

On FreeBSD, The ZFS version would be the following:
zfs-2.2.6-FreeBSD_g33174af15
zfs-kmod-2.2.6-FreeBSD_g33174af15

On Ubuntu, The ZFS version is the following:

zfs-2.1.5-1ubuntu6~22.04.4
zfs-kmod-2.1.5-1ubuntu6~22.04.4

It is a Raidz pool.

I was hoping for some help with the following questions:

  1. What are some best practices when preparing to export a zfs pool?
  2. 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.
  3. 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.
  4. Building the pool from scratch is not an option, in this case.

Any information, would be greatly appreciated.

Thanks!!

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.

As usual Jim, You’re AWESOME!!!

Thank you!!

1 Like