Transfer existing Linux pool to FreeBSD?

Questions:

  1. How would I asses compatibility of my Linux created zfs pool with FreeBSD zfs?

  2. Can I swap my pool back and forth between Debian and FreeBSD? or is this a one way trip or not even possible/recommended?

Background:

I have been using zfs under Debian since August on my home file server based on an old (2013) Supermicro 846, I have a basic 8x 14TB z2 pool on a single vdev, 72TB usable its about 50% full at the moment. no L2Arc or any special devices. I have found ZFS pleasant to administer with no drama and I would like to keep it that way.

Everything is currently working great but I am steadily adding services and its getting more complex than I would like. I am considering starting over with a more host/hypervisor model, and I would like FreeBSD to be that hypervisor using Bhyve. services living in VM’s, most of them Linux. FreeBSD host would of course handle the zfs pool and nfs shares to my Linux desktops on the LAN.

Fist question to answer is weather this is viable. Can I import my existing pool to FreeBSD? obviously a must have function, as I understand it both are using the same OpenZFS code, the question is the zfs pool version,

The pool was created using bookworm backports version zfs-kmod-2.1.11-1 I am now at zfs-kmod-2.2.3-1. At one point early on I did upgrade the pool,I don’t know at what version this happened, I failed to capture that in my notes.

When I query “zpool get all” I get “-” for version, apparently this is expected behavior

I have read about a bug in BSD zfs code
https://www.reddit.com/r/freebsd/comments/1ccgvra/freebsden2409zfs_high_cpu_usage_by_kernel_threads/

Apparently release FreeBSD 13.2 is safe from this bug and uses “OpenZFS release 2.1.9” release 14.0 uses “release 2.2, providing significant performance improvements.” I have 48 threads loosing one would not be the end of the world and hopefully will be patched soon?

Swapping:
I know I can not stand up FreeBSD in one sitting, I would prefer/will need to take my time. I have 2x boot SSD in my file server, the idea here is to install FreeBSD to the second SSD and when I am done for that sitting switch back to Debian on the other SSD. Can a pool move back and forth between the two? or is that asking for trouble?

Data on the pool: My core crucial data is backed up to a NAS, and again to backblaze B2, but the bulk of the Data is not backed up, this non backup up data is “replaceable” but still represents a significant sunk costs in time and bandwidth acquiring.

Generally speaking, yes, you can pass pools back and forth between Linux distros and FreeBSD without issue. The potential issues arise when one distro is much newer than the other, and therefore has a newer OpenZFS than the other; if the newer version is the source and has enabled feature flags that change the on-disk storage format, then you won’t be able to import the pool on the older side.

These days, what this typically comes down to is “as long as the version of FreeBSD is newer than the one you were using in Linux, it’ll be fine” and vice versa for changes in the other direction. You’re more likely to have a real problem when you use a NAS distro that might have gone a bit cowboy with the codebase; ixSystems (makers of TrueNAS) have been known to enable features they’ve been working on in-house that aren’t in any production version of OpenZFS yet.

Essentially, what you want to do here is just boot your system from a FreeBSD live installer, then check to make sure you can import the pool. If the pool imports and you can see your data, you’re good to go, and you can simply export it again and your “real” system will automatically import it again on boot. Then, you can start work on actual migration.

1 Like

That makes a lot of sense, let zfs inform me weather it will work.

Jim I want personally thank you for what you do.

Your articles on Ars, the 2.5 admins podcast, the zfs tuning guide on your page, i just watched your Bhyve video from Klara systems in YouTube, and individual help here.

I don’t know when you sleep but your free flowing digestible information has been instrumental in helping me elevate to a home server admin.

2 Likes

You’re welcome!

And the one big warning here, while you’re moving the pool back and forth between systems: do not run any zpool upgrade process on either side! Doing so might potentially enable a feature flag which is supported on the newer system but unsupported on the older, and bring a halt to your pool-swapping fun. :slight_smile: