I want to put ZFS on an old machine, however it apparently fails to boot with GPT. So I wanted to convert this script, mainly these 3 lines to sfdisk, which uses MBR.
https://github.com/terem42/zfs-hetzner-vm (Debian11)
sgdisk -a1 -n1:24K:+1000K -t1:EF02 "$selected_disk"
sgdisk -n2:0:+512M -t2:BF01 "$selected_disk" # Boot pool
sgdisk -n3:0:"$tail_space_parameter" -t3:BF01 "$selected_disk" # Root pool
It was suggested to just dump the partition structure and import it to sfdisk but this breaks the script entirely. Grub then fails to install since it can't find the boot drive.
sfdisk -d $selected_disk > partitions
sed -i -e 's/label: gpt/label: dos/g' partitions
sfdisk $selected_disk < partitions
If you have an questions, ideas or suggestions to solve this, please lemme know.
Thanks.