This is a brief summary of a full disk encryption user error on OpenBSD. This results in the error message softraid0: Invalid metadata format. Hopefully this can quickly help anyone else who makes the same error.
As per the manual, encryption is handled by softraid and bioctl and should be configured during the initial boot install. Entering the shell and typing the following is required to setup full disk encryption:
# fdisk -iy sd0
Writing MBR at offset 0.
# disklabel -E sd0
Label editor (enter '?' for help at any prompt)
> a a
offset: [2104515]
size: [39825135] *
FS type: [4.2BSD] RAID
> w
> q
No label changes.
At this point I kept getting my error because I didn’t type RAID at FS type. Instead I pressed enter which normally selects the default configuration in the OpenBSD installer. So when I proceeded to use the standard bioctl command:
# bioctl -cC -l sd0a softraid0
I recieved a softraid error about an incorrect metadata format.
softraid0: Invalid metadata format
Once this was fixed I could move on to the next steps. You need to choose a custom layout for the disk and then do the following with disklabel making sure you have selected the correct mount point.
> a a offset: [64] size: [6265286] * FS type: [4.2BSD] mount point: [none] / Rounding size to bsize (32 sectors): 6265280 > w > qNow you should be asked for a password to secure your encrypted drive. Make sure you pick a strong one.