I'm creating a bootable recovery flash and I was wondering how to create it so it can boot on both UEFI and BIOS systems?I'm experimenting with GRUB but I'm open to any other bootloader. Requirements:being able to boot Linux from the stick.being able to detect / chainload windows on the target computer (not creating a bootable win install).
how to create a bootable flash that can boot as both BIOS and UEFI?
arch linux;usb drive;uefi;bios
After a lot of research, I found https://debian-administration.org/users/dkg/weblog/112:Copy/pasting here for longevity, all credit goes to the original author.(I modifed the steps a little so the EFI partition is only 200mb and the rest of the flash has multiple ISOs and shared ntfs files):parted /dev/sdX -- mktable gptparted /dev/sdX -- mkpart biosgrub fat32 1MiB 4MiBparted /dev/sdX -- mkpart efi fat32 4MiB 200MiBparted /dev/sdX -- set 1 bios_grub onparted /dev/sdX -- set 2 esp onmkfs.vfat -F 32 -n EFI /dev/sdX2mkdir /tmp/new-boot && mount /dev/sdX2 /tmp/new-bootgrub-install --removable --no-nvram --efi-directory=/tmp/new-boot/ --boot-directory=/tmp/new-boot/ --target=x86_64-efigrub-install --removable --no-nvram --efi-directory=/tmp/new-boot/ --boot-directory=/tmp/new-boot/ --target=i386-efigrub-install --removable --boot-directory=/tmp/new-boot/ --target=i386-pc /dev/sdX