Caution: Following instructions may break your computer wiping off your
harddisk. These instructions are my personal notes. They were written as a
future reference and don’t mean to be a complete guide. Follow them at your own
risk.
It is convenient to have a USB stick that can boot in both UEFI and Legacy modes
and we can choose a live operating system to install from the grub menu. This
post walks through the steps to have such a USB stick. I use a 8 GB USB stick.
Preparing USB Stick
Insert your USB flash and check its /dev/sdX
Mine is /dev/sdc. fdisk -l or dmesg | tail also would do the trick.
Create partitions for both legacy bios boot and efi boot. Replace /dev/sdX with
yours.
Print what we have now. Here is my /dev/sdc.
Make a file system on /dev/sdX2 labeling it MULTIBOOT. Mount it and install
legacy and uefi grub on it.
Copy your iso files into your USB stick.
Create a mnt/grub/grub.cfg
Modify the following content according to your iso files and put it into your
mnt/grub/grub.cfg
Make your Legacy Bootable OS boot with UEFI
Don’t forget to create fat32 250MiB sdX1 partition with boot, esp flags during
installation. After installation, use a UEFI booted live system to chroot into
installed system and install uefi support.
In a live UEFI booted system, mount installed system for chroot. You can check
your installed system partition with lsblk or fdisk -l (sda1, sdb2, etc…)
replace them with sdXY in the following commands.
chroot into installed system.
Get necessary packages and install UEFI support. Replace Pardus with your
distro name.
Generate grub configuration, exit chroot, unmount and reboot.
As a side note, you can check boot entries and change their boot order using
efibootmgr
Make your UEFI Bootable OS boot with Legacy BIOS
In a live BIOS booted system, mount installed system for chroot. You can check
your installed system partition with lsblk or fdisk -l (sda1, sdb2, etc…)
replace them with sdXY in the following commands.
chroot into installed system.
Get necessary packages and install UEFI support. Replace Pardus with your
distro name.
Generate grub configuration, exit chroot, unmount and reboot.