Hello I worked this out with a shell script file. ZFS uses many command line entries. UFS file system you can probably type in by hand from memory.
1.) Use and edit a shell script file for creating that SSD partitions and then adding the filesystems.
https://ghostbsd-arm64.blogspot.com/2024/04/create-ghostbsd-usb-ssd-500gb-or-larger.html
ZFS works with "vdevs' which can be a single blank partition or several partitions or several blank disks. This is all your choice and creation for your needs. ZFS DOES NOT need a file system laid down on that blank partition you wish to use. UFS and Linux EXT4 and MSDOS FAT32 or NTFS 32 do need a file system created or laid down on the blank partition before you can use the partition for creating and saving files. This ZFS has different methodology than regular file systems.
Here create several partitions on a USB SSD 500GB or larger disk.
https://ghostbsd-arm64.blogspot.com/2024/04/create-ghostbsd-usb-ssd-500gb-or-larger.html
Think I will copy and paste here, so you do not have to leave. Well that looked too complicated.
You can read on my blogpost and Ctrl-P to print to a PDF file from your browser.
https://ghostbsd-arm64.blogspot.com/2023/12/zfs-boot-on-root-setup-for-usb-ssd.html
Here is a tar.xz archive single file download of several files you can read and learn from
http://ghostbsdarm64.hopto.org/packages/gh14_jan01_arm64_create_disk.tar.xz
echo " ${DISK1} <--- This is the DISK1 environmental variable, set example: DISK1=/dev/da1; export DISK1 "
Setup for writing to a USB Flash drive stick. Create a Unix File System UFS partition
https://ghostbsd-arm64.blogspot.com/2024/01/january-19-2024-howto-download.html#more
cat ./create_ssd_GhostBSD.sh
#!/bin/sh
set -e
set -x
echo " ${DISK1} <--- This is the DISK1 environmental variable, set example: DISK1=/dev/da1; export DISK1 "
echo " Made for a 500GB size USB to NVMe style SSD disk style SSD disk "
# echo "If da1 already exists, use gpart destroy -F da1 or gpart destroy -F ${DISK1} to clean off partitions on da1 "
sleep 6
gpart list ${DISK1}
gpart status ${DISK1}
gpart show -lp ${DISK1}
echo " create a GPT scheme on ${DISK1} hit ctrl-C to exit. "
# test if geom disk list da1 , then gpart destroy -F ${DISK1}
if gpart status ${DISK1} ;
then
gpart show -lp ${DISK1}
echo " Type Ctrl-C NOW! to stop destroy ${DISK1} "
sleep 6
gpart destroy -F ${DISK1}
else
echo " ${DISK1} is unformatted , good to create 7 partitions "
fi
sleep 6
# here is the shell commands to create a GPT scheme on a blank USB SSD disk
gpart show -lp ${DISK1}
echo " Type Ctrl-C NOW! to stop destroy ${DISK1} "
sleep 6
gpart destroy -F ${DISK1}
else
echo " ${DISK1} is unformatted , good to create 7 partitions "
fi
sleep 6
gpart create -s GPT ${DISK1}
gpart add -t efi -a1M -s3G -l msdos_ESP ${DISK1}
gpart add -t freebsd-swap -a1M -s4G -l swapfs ${DISK1}
gpart add -t freebsd-zfs -a1M -s240G -l rootfs ${DISK1}
gpart add -t linux-swap -a1M -s2G -l linux-swap ${DISK1}
gpart add -t linux-data -a1M -s80G -l linux-data ${DISK1}
gpart add -t linux-data -a1M -s80G -l linux-data2 ${DISK1}
gpart add -t linux-data -a1M -l linux-data3 ${DISK1}
echo "Format ${DISK1}p1 with command newfs_msdos to create ESP EFI FAT32 partition"
newfs_msdos -F 32 -c 1 ${DISK1}"p1"
echo "Completed 7 partitions on ${DISK1}p1 is the ESP EFI FAT32 partition. "
echo "${DISK1}p2 is the SWAP partition. "
echo "${DISK1}p3 is the freebsd-zfs boot on root data partition. "
echo "Other partions are for testing Linux on the Raspberry Pi 4B,3B,400 like Manjaro or POP!_OS "
gpart show -lp ${DISK1} # show the 7 paritions
Here is an archive to download these shell script files I used.
http://ghostbsdarm64.hopto.org/packages/gh14_jan01_arm64_create_disk.tar.xz
I will be happy if you reply here or reply on my Blog post:
https://ghostbsd-arm64.blogspot.com/2023/12/zfs-boot-on-root-setup-for-usb-ssd.html
files available of my private NGING webserver running on a Raspberry Pi 4B running FreeBSD 15.0-CURRENT
http://ghostbsdarm64.hopto.org/packages/
Sorry the post is so long. I do hope you see the answer you were searching for contained in the above verbiage. Fred Finster June 5, 2024