diff options
author | Sven Göthel <[email protected]> | 2024-12-02 07:08:24 +0100 |
---|---|---|
committer | Sven Göthel <[email protected]> | 2024-12-02 07:08:24 +0100 |
commit | 0eae3b000704165acb41d4286682514836bf9d20 (patch) | |
tree | 7666220ef2da961a876b16c562388a641b7c42d4 | |
parent | b7ecb60d80cf0190af6a316cee99ef7ad51f47f6 (diff) |
Fix UEFI notes in setup helper
-rw-r--r-- | setup/convert-mbr_to_uefi.txt | 46 | ||||
-rw-r--r-- | setup/new_gpt_efi_disk.sh | 37 | ||||
-rw-r--r-- | setup/new_gpt_mpr_disk.sh | 25 |
3 files changed, 55 insertions, 53 deletions
diff --git a/setup/convert-mbr_to_uefi.txt b/setup/convert-mbr_to_uefi.txt index d4e8c3f..798a936 100644 --- a/setup/convert-mbr_to_uefi.txt +++ b/setup/convert-mbr_to_uefi.txt @@ -1,3 +1,22 @@ +Dual BIOS + UEFI Bootable Disk: + # EF02 Bios-Boot (Grub core) + # EF00 EFI System + # BF01 ZFS Root + sgdisk --zap-all \ + --new 1::+1M --typecode=1:EF02 \ + --new 2::+700M --typecode=2:EF00 \ + --new 3::0 --typecode=3:BF01 \ + /dev/disk/by-id/DISK + +Single UEFI Bootable Disk: + # EF00 EFI System + # BF01 ZFS Root + sgdisk --zap-all \ + --new 1::+700M --typecode=1:EF00 \ + --new 2::0 --typecode=2:BF01 \ + /dev/disk/by-id/DISK + + Setup /boot/efi vfat mount 505 mkdir /boot/efi 509 mount /dev/disk/by-id/ata-QEMU_HARDDISK_QM00007-part2 /boot/efi @@ -10,20 +29,23 @@ Setup /boot/efi vfat mount 515 mount /boot/efi Install grub efi - 522 sudo apt install grub-efi-amd64 -y 525 dpkg -P grub-pc grub-pc-bin - 533 rm -rf /boot/grub/i386-pc - check - - existing /etc/default/grub - - only /boot/efi/EFI/debian/ should exist - - rm -rf /boot/efi/EFI/GRUB (???) - - may need: `sudo apt reinstall grub-efi-amd64 -y` - - - Misc - - Not needed: `grub-install --target=x86_64-efi --bootloader-id=debian --efi-directory=/boot/efi` - - But could `sudo apt install --reinstall grub-efi-amd64` - 536 update-grub + 526 rm -rf /boot/grub/i386-pc + 527 sudo apt install grub-pc-bin efibootmgr grub-efi-amd64 grub-efi-amd64-bin grub-efi-amd64-signed -y + + Dual BIOS + UEFI Bootable Disk: + - grub-install --target=i386-pc --force-file-id /dev/disk/by-id/DISK + - update-grub + - mkdir -p /boot/efi/EFI/debian + - grub-install --target=x86_64-efi --removable --force-file-id --efi-directory=/boot/efi --bootloader-id=debian + + Single UEFI Bootable Disk: + - update-grub + - mkdir -p /boot/efi/EFI/debian + - grub-install --target=x86_64-efi --removable --force-file-id --efi-directory=/boot/efi --bootloader-id=debian + 537 ls -la /boot/grub/ + 537 ls -la /boot/efi/EFI/debian BIOS - Disable Secure-Boot diff --git a/setup/new_gpt_efi_disk.sh b/setup/new_gpt_efi_disk.sh index c9a5b75..62982d1 100644 --- a/setup/new_gpt_efi_disk.sh +++ b/setup/new_gpt_efi_disk.sh @@ -3,35 +3,24 @@ NDISK1=ata-QEMU_HARDDISK_QM00007 NDISK2=ata-QEMU_HARDDISK_QM00009 NDISK3=ata-QEMU_HARDDISK_QM00011 -# Clear the partition table: -sgdisk --zap-all /dev/disk/by-id/$NDISK1 -sgdisk --zap-all /dev/disk/by-id/$NDISK2 -sgdisk --zap-all /dev/disk/by-id/$NDISK3 - -# 2.2 Partition your disk: -# -# Legacy (BIOS) booting (part-1): Used for GRUB boot-code in 'MBR-gap': -sgdisk -a1 -n1:40:8191 -t1:EF02 /dev/disk/by-id/$NDISK1 -sgdisk -a1 -n1:40:8191 -t1:EF02 /dev/disk/by-id/$NDISK2 -sgdisk -a1 -n1:40:8191 -t1:EF02 /dev/disk/by-id/$NDISK3 - -# Run this if you need legacy (EFI) booting: -sgdisk -n2:0:+1G -t2:EF00 /dev/disk/by-id/$NDISK1 -sgdisk -n2:0:+1G -t2:EF00 /dev/disk/by-id/$NDISK2 -sgdisk -n2:0:+1G -t2:EF00 /dev/disk/by-id/$NDISK3 - -#Run these in all cases: -sgdisk -n3:0:0 -t3:BF01 /dev/disk/by-id/$NDISK1 -sgdisk -n3:0:0 -t3:BF01 /dev/disk/by-id/$NDISK2 -sgdisk -n3:0:0 -t3:BF01 /dev/disk/by-id/$NDISK3 +# EF02 Bios-Boot (Grub core) +# EF00 EFI System +# BF01 ZFS Root +for dname in "${NDISK1}" "${NDISK2}" "${NDISK3}" ; do + sgdisk --zap-all \ + --new 1::+1M --typecode=1:EF02 \ + --new 2::+700M --typecode=2:EF00 \ + --new 3::0 --typecode=3:BF01 \ + "/dev/disk/by-id/${dname}" +done sleep 3 sync # Create EFI filesystems -mkfs.fat -F32 /dev/disk/by-id/$NDISK1-part2 -mkfs.fat -F32 /dev/disk/by-id/$NDISK2-part2 -mkfs.fat -F32 /dev/disk/by-id/$NDISK3-part2 +mkfs.fat -n EFISYS -F32 /dev/disk/by-id/$NDISK1-part2 +mkfs.fat -n EFISYS -F32 /dev/disk/by-id/$NDISK2-part2 +mkfs.fat -n EFISYS -F32 /dev/disk/by-id/$NDISK3-part2 echo "Now replace the disk .." echo "zpool replace risa 12458555210078177352 /dev/disk/by-id/ata-WDC_WD40EFZX-68AWUN0_WD-WX92DA0798JN-part1" diff --git a/setup/new_gpt_mpr_disk.sh b/setup/new_gpt_mpr_disk.sh index 4335a25..fba8aba 100644 --- a/setup/new_gpt_mpr_disk.sh +++ b/setup/new_gpt_mpr_disk.sh @@ -3,24 +3,15 @@ NDISK1=ata-WDC_WD40EFZX-68AWUN0_WD-WX92DA0798JN NDISK2=ata-WDC_WD40EFZX-68AWUN0_WD-WX92DA0791VU NDISK3=ata-WDC_WD40EFZX-68AWUN0_WD-WX92DA02K427 -# Clear the partition table: -sgdisk --zap-all /dev/disk/by-id/$NDISK1 -#sgdisk --zap-all /dev/disk/by-id/$NDISK2 -#sgdisk --zap-all /dev/disk/by-id/$NDISK3 +# EF02 Bios-Boot (Grub core) +# BF01 ZFS Root +for dname in "${NDISK1}" "${NDISK2}" "${NDISK3}" ; do + sgdisk --zap-all \ + --new 1::+1M --typecode=1:EF02 \ + --new 2::0 --typecode=2:BF01 \ + "/dev/disk/by-id/${dname}" +done -# 2.2 Partition your disk: -# -# Legacy (BIOS) booting (part-1): Used for GRUB boot-code in 'MBR-gap': -sgdisk -a1 -n1:40:8191 -t1:EF02 /dev/disk/by-id/$NDISK1 -#sgdisk -a1 -n1:40:8191 -t1:EF02 /dev/disk/by-id/$NDISK2 -#sgdisk -a1 -n1:40:8191 -t1:EF02 /dev/disk/by-id/$NDISK3 - -#Run these in all cases: -sgdisk -n2:0:0 -t2:BF01 /dev/disk/by-id/$NDISK1 -#sgdisk -n2:0:0 -t2:BF01 /dev/disk/by-id/$NDISK2 -#sgdisk -n2:0:0 -t2:BF01 /dev/disk/by-id/$NDISK3 - -sleep 3 sync echo "Now replace the disk .." |