Score:1

Converting sgdisk to sfdisk for old machine with MBR

cn flag

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.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.