On the Raspberry Pi Image, there are 3 partitions, ESP EFI FAT32 (or FAT16) 50MB, SWAP partition 2048 MB for HDD, SDD, or USB Flash Drive. Not for TF card or microSD card, Note, system hangs a little when NO SWAP is availble when you have 50+ Firefox Browser Tabs open. Mouse cursor does not move, or only slowly. A quick Ctrl-W or Alt-F4, is it Ctrl-F4 will close the last window that used up the free memory. On 8 Gig Raspberry Pi 4B, normally no swap memory is used. ( Well until you go past the limit of 8 Gb :>) A memory space low notifier would help for the Desktop User.
Then ZFS or UFS partition for your FreeBSD Data , Kernel /boot/kernel/kernel.image ?? and FreeBSD /boot files, /etc files.
BSAIDUS, Sounds like you wish to save off the files from a ZFS partition to an outside file storage area, Change the partition type from ZFS-data to UFS partition type. Next newfs /dev/da0p3, and then write the saved files back from outside file storage area into the new UFS partition. That sounds do able. Me tired tonight, Don't know what gltches and problems could arise from this operation. Please, I welcome copious notes here and maybe a copy and paste onto my blogsite detailing how to manually create a ZFS file system on an empty ZFS-data type partition.
Learning ZFS on root setup for Raspberry Pi 4B
Honey I broke my zfs USB sata ssd 1TB
So on a USB Flash Drive using GPT scheme gpart -s GPT /dev/da0 for Raspberry Pi, Don't Touch the ESP EFI partition. Should be able to boot "either a ZFS partition or UFS partition" with the EFI image:
Gpart Manual 13.2 newfs Manual 13.2
Vermaden had better instructions on setting up a microSD card for ARM processors. UFS operates with gptboot.efi file
The needed fix is to copy
/boot/gptboot.efi in place of
bootaa64.efi file. (which is a copy of /boot/gptzfsboot.efi 4 ZFS)
Code:
ls -l /mnt/esp/EFI/BOOT/bootaa64.efi
cp -p /boot/gptboot.efi /mnt/esp/EFI/BOOT/bootaa64.efi
ls -l /mnt/esp/EFI/BOOT/bootaa64.efi
ls -l /mnt/esp/EFI/FREEBSD
cp -p /boot/gptboot.efi /mnt/esp/EFI/FREEBSD/bootaa64.efi
# copyover existing bootaa64.efi (copy of gtpzfsboot.efi) with gptboot.efi file for UFS boot operation
mkdir -p /mnt/esp
mkdir -p /mnt/rootfs
mount -t msdosfs /dev/da0p1 /mnt/esp
mount /dev/da0p3 /mnt/rootfs UFS partition type
mount -t zfs /dev/da0p3 /mnt/rootfs ZFS partition type
cp -pr /mnt/rootfs /mnt/external_storage_disk/
umount /mnt/rootfs
gpart modify -i 3 -t freebsd-ufs /dev/da0
newfs /dev/da0p3
mount /dev/da0p3 /mnt/rootfs
cp -pr /mnt/external_storage_disk /mnt/rootfs/
ls -l /mnt/rootfs
df -h /mnt/rootfs
du -d1 -h /mnt/rootfs
umount /mnt/rootfs
Discussion of Gpart tool and Partitions. resize You can move the contents to a separate disk, unmount, shrink the original partition, create a fresh new empty filesystem and copy everything back.
Bakul
Conclusion you can modify a partition type from freebsd-zfs to freebsd-ufs, destroy the data newfs, recopy data from external storage. Leave the Raspberry Pi boot ESP EFI partition the same.
Search Klara Systems FreeBSD articles.
Building customized FreeBSD images The FreeBSD Boot Process
Booting a pool from the Rescue System
Yes
Your Question is darn interesting to me. I have spent a lot of time studying these topics. Enjoy porting GhostBSD to my Raspberry Pi 4B. Almost there, now running GhostBSD compiled kernel source code. md5deep audit files
Ghostbsd-arm64.blogspot.com Disk setup FreeBSD on ZFS on Raspberry Pi