4

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:

  1. being able to boot Linux from the stick.
  2. being able to detect / chainload windows on the target computer (not creating a bootable win install).
  • What I use is a combination of syslinux's isolinux (for legacy BIOS) and grub (for EFI bootloader) and isohybrid (to make bootable iso image). This has been working well because I am able to not only support a hybrid iso that can boot in both legacy and UEFI but also boot on MAC hardware which uses a special type of EFI. – likewhoa Jun 11 '16 at 4:20
  • @likewhoa can you write that as a detailed answer by any chance? – OneOfOne Jun 11 '16 at 17:30
1

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 gpt
parted /dev/sdX -- mkpart biosgrub fat32 1MiB 4MiB
parted /dev/sdX -- mkpart efi fat32 4MiB 200MiB
parted /dev/sdX -- set 1 bios_grub on
parted /dev/sdX -- set 2 esp on
mkfs.vfat -F 32 -n EFI /dev/sdX2

mkdir /tmp/new-boot && mount /dev/sdX2 /tmp/new-boot
grub-install --removable --no-nvram --efi-directory=/tmp/new-boot/ --boot-directory=/tmp/new-boot/ --target=x86_64-efi
grub-install --removable --no-nvram --efi-directory=/tmp/new-boot/ --boot-directory=/tmp/new-boot/ --target=i386-efi
grub-install --removable --boot-directory=/tmp/new-boot/ --target=i386-pc /dev/sdX
  • Not a good idea to try and have a single recovery media for both BIOS/MBR and UEFI/GPT. For BIOS/MBR there are plenty of good rescue tools available. For UEFI/GPT, see blog.fpmurphy.com/2014/12/creating-a-uefi-rescue-dvd.html for an early version of a rescue DVD that I developed. Can be burned onto a USB stick. – fpmurphy Jun 13 '16 at 0:44
  • @fpmurphy1 it's for my personal use and it works (tm), but all means please post some details and if your answer shows better information, I'll mark it. – OneOfOne Jun 13 '16 at 1:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.