Linux ZFS partition type code

I’m curious why on linux arch wiki and openzfs-docs recommend using bf00(solaris) partition type over a504(freebsd) or any other. They don’t even mention a504. Is there any difference or is this just number? I’ve read this, but does this apply for zfs too?

In my experience, it’s utterly irrelevant. I have yet to either find a ZFS based application that cared about partition codes, or, frankly, anything ELSE that cares about them either.

I usually manually specify the freebsd partition type when I create partitions on the command line, just out of a desire for correctness, but I don’t always bother even then–I have LOTS of machines floating around with pools stored on partitions using the generic default “Linux filesystem” partcode.

I use parted to setup my storage. On my laptop with a single SSD, I made 3 partitions: bios (grub), vfat (for uefi), and zfs. I didn’t specify a partition type, but it seems the partition type defaults to ‘Linux’ (ext2) even though I’m using one for vfat and the other for ZFS

On my home server, I skipped manually partitioning and told ZFS to use the whole disk(s). It created two ‘Solaris’ partitions. fdisk labels them as “Solaris /usr & Apple ZFS” and “reserved 1”. ZFS behaves the same for me on both Linux and Solaris partition types.

My systems only use ZoL for data…not boot/root. With that being said, before I built them I spent some time reading trying to find the ‘correct’ partition type for ZoL. I too consulted the wonderful arch wiki, but I finally realized that there did not appear to be a definitive answer. I settled on this, and it has worked without issue:

NOTE: The following will partition a 1 TB (938 GiB) disk with a 6 MiB alignment and typecode “FreeBSD ZFS”:

sudo sgdisk --new=1:6M:+838G --typecode=1:a504 /dev/disk/by-id/ata-Samsung_SSD_860_EVO_1TB_S3Z8NB0Kxxxxxxx

Yes, I leave 100 GiB of trimmed slack space on each 938 GiB TLC SSD. My PCIe SAS/SATA HBA does not support trim of SATA disks.