ZFS zpool create on removable media compatible with older versions

Not tried, but maybe creating pool, then, disabling all pool options that are NOT supported by 2.1 BEFORE YOU DO ANYTHING ELSE TO THE POOL would do. Then, create datasets (ZFS filesystems) you need.

If you're going to do the job on environment having running ZFS pool, and any dataset name collision is supposed, use temporary mount point (i.e., /mnt if it's empty) with -R option would be needed.
 
It's all about enabled features.
By default all supported features are enabled on the new pool. The -d
option and the -o compatibility property (e.g -o compatibility=2020)
can be used to restrict the features that are enabled, so that the pool
can be imported on other releases of ZFS.

-d Do not enable any features on the new pool. Individual fea-
tures can be enabled by setting their corresponding proper-
ties to enabled with -o. See zpool-features(7) for details
about feature properties.
From zpool-create(8).
 
  • Thanks
Reactions: mro
Just FYI:
I've using ZFS on USB memstick for main (aka -Current) environment for testing until I obtained notebook having multiple drive bays (one NVMe and one 2.5inch SATA). But it was before FreeBSD switched to OpenZFS and never tried auto imports.

And recently I purchased a M2 NVMe SSD for replacing with smaller working one. In this time, I've put the new one into USB-NVMe converter, create GPT scheme, partition and label, format ESP and create ZFS pool for Root on ZFS WITH DIFFERENT POOL NAME as the one in internal M2 NVMe slot.
Then send / recv to new one on /dev/da0 from snapshot of running datasets to set up new one. Of course, as I've named labels and pool name differently, /etc/fstab needed to be edited. The new one is what I'm running with.
 
In the future the zpool command will have composite commands that know symbols like "compatible with this old version" or "compatible with Linux".

Until then the only sure way is to actually try the created zpool on the lower system. Or of course create the zpool on that lower system in the first place.

Here is an older snippet I used:
Code:
 -o feature@userobj_accounting=disabled \
    -o feature@edonr=disabled \
    -o feature@project_quota=disabled \
    -o feature@allocation_classes=disabled \
    -o feature@resilver_defer=disabled \
    -o feature@zilsaxattr=disabled
 
  • Thanks
Reactions: mro
You could make a VM with an old FreeBSD and use disk passthrough to use it for creating the pools.

Alternatively you could once create such a zpool on an old system in a small size that you store as a disk image. When you want to format a new portable device you dd the diskimage and then expand the partition table and zpool to the actual disk size.
 
  • Thanks
Reactions: mro
I'm confused, I'm not sure I understand the question.

You want to create a pool that will work with zfs-2.1? If that so, the following should work... I guess.

Code:
# zpool create -o compatibility=/usr/share/zfs/compatibility.d/openzfs-2.1-freebsd ...
 
  • Thanks
Reactions: mro
I'm confused, I'm not sure I understand the question.

You want to create a pool that will work with zfs-2.1? If that so, the following should work... I guess.

Code:
# zpool create -o compatibility=/usr/share/zfs/compatibility.d/openzfs-2.1-freebsd ...

I didn't realize this is already in. This is the way to go of course.
 
Back
Top