[Bug 258987] 13.0-RELEASE installer broken redundancy with UEFI and ZFS

From: <bugzilla-noreply_at_freebsd.org>
Date: Sat, 10 Dec 2022 19:48:13 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=258987

--- Comment #3 from topical <topical@gmx.net> ---
Sure. 

I have an host that was initially set up with 12.2.

There, you can see in /var/log/bsdinstall_log the detailed process of setting
up a disk:

```
DEBUG: zfs_create_diskpart: disk=[ada0] index=[0]
DEBUG: zfs_create_diskpart: Exporting ZFS pools...
DEBUG: zfs_create_diskpart: Detaching all GELI providers...
geli: Command 'status' not available; try 'load' first.
DEBUG: zfs_create_diskpart: Destroying all data/layouts on `ada0'...
DEBUG: zfs_create_diskpart: gpart destroy -F "ada0"
DEBUG: zfs_create_diskpart: retval=1 <output below>
gpart: arg0 'ada0': Invalid argument
DEBUG: zfs_create_diskpart: graid delete "ada0"
DEBUG: zfs_create_diskpart: retval=1 <output below>
graid: Array 'ada0' not found.
DEBUG: zfs_create_diskpart: zpool labelclear -f "/dev/ada0"
DEBUG: zfs_create_diskpart: retval=1 <output below>
failed to read label from /dev/ada0
DEBUG: zfs_create_diskpart: gpart create -s gpt "ada0"
DEBUG: zfs_create_diskpart: retval=0 <output below>
ada0 created
DEBUG: zfs_create_diskpart: gpart destroy -F "ada0"
DEBUG: zfs_create_diskpart: retval=0 <output below>
ada0 destroyed
DEBUG: zfs_create_diskpart: Creating GPT layout...
DEBUG: zfs_create_diskpart: gpart create -s gpt "ada0"
DEBUG: zfs_create_diskpart: retval=0 <output below>
ada0 created
DEBUG: zfs_create_diskpart: gpart add -a 4k -l efiboot0 -t efi -s 200M "ada0"
DEBUG: zfs_create_diskpart: retval=0 <output below>
ada0p1 added
DEBUG: zfs_create_diskpart: mkdir -p "/tmp/bsdinstall_etc/esp"
DEBUG: zfs_create_diskpart: retval=0 <no output>
DEBUG: zfs_create_diskpart: newfs_msdos -F 16 -L "EFISYS" "/dev/ada0p1"
DEBUG: zfs_create_diskpart: retval=0 <output below>
/dev/ada0p1: 409360 sectors in 25585 FAT16 clusters (8192 bytes/cluster)
BytesPerSec=512 SecPerClust=16 ResSectors=1 FATs=2 RootDirEnts=512 Media=0xf0
FATsecs=100 SecPerTrack=63 Heads=16 HiddenSecs=0 HugeSectors=409600
DEBUG: zfs_create_diskpart: mount -t msdosfs "/dev/ada0p1"
"/tmp/bsdinstall_etc/esp"
DEBUG: zfs_create_diskpart: retval=0 <no output>
DEBUG: zfs_create_diskpart: mkdir -p "/tmp/bsdinstall_etc/esp/efi/boot"
DEBUG: zfs_create_diskpart: retval=0 <no output>
DEBUG: zfs_create_diskpart: cp "/boot/loader.efi"
"/tmp/bsdinstall_etc/esp/efi/boot/BOOTx64.efi"
DEBUG: zfs_create_diskpart: retval=0 <no output>
DEBUG: zfs_create_diskpart: echo "BOOTx64.efi" >
"/tmp/bsdinstall_etc/esp/efi/boot/startup.nsh"
DEBUG: zfs_create_diskpart: retval=0 <no output>
DEBUG: zfs_create_diskpart: umount "/tmp/bsdinstall_etc/esp"
DEBUG: zfs_create_diskpart: retval=0 <no output>
DEBUG: zfs_create_diskpart: gpart add -a 4k -l gptboot0 -t freebsd-boot -s 512k
"ada0"
DEBUG: zfs_create_diskpart: retval=0 <output below>
ada0p2 added
DEBUG: zfs_create_diskpart: gpart bootcode -b "/boot/pmbr" -p
"/boot/gptzfsboot" -i 2 "ada0"
DEBUG: zfs_create_diskpart: retval=0 <output below>
partcode written to ada0p2
bootcode written to ada0
DEBUG: zfs_create_diskpart: gpart add -a 1m -l swap0 -t freebsd-swap -s
34359738368b "ada0"
DEBUG: zfs_create_diskpart: retval=0 <output below>
ada0p3 added
DEBUG: zfs_create_diskpart: zpool labelclear -f "/dev/ada0p3"
DEBUG: zfs_create_diskpart: retval=1 <output below>
failed to read label from /dev/ada0p3
DEBUG: zfs_create_diskpart: gpart add -a 1m -l zfs0 -t freebsd-zfs "ada0"
DEBUG: zfs_create_diskpart: retval=0 <output below>
ada0p4 added
DEBUG: zfs_create_diskpart: zpool labelclear -f "/dev/ada0p4"
DEBUG: zfs_create_diskpart: retval=1 <output below>
failed to read label from /dev/ada0p4
DEBUG: zfs_create_diskpart: printf "$FSTAB_FMT" "/dev/mirror/swap.eli" "none"
"swap" "sw" "0" "0" >> "/tmp/bsdinstall_etc/fstab"
DEBUG: zfs_create_diskpart: retval=0 <no output>
```

There is no official documentation. I just stumbled over this file when I had
replaced a disk and was wondering how to get it running. 

Unfortunately, this trick doesn't work anymore.

-- 
You are receiving this mail because:
You are the assignee for the bug.