I want to make bootable USB drive with Debian and make it bootable on both BIOS and UEFI systems. I've found only separate instructions for BIOS and UEFI systems. Please help me to find a solution.
If you're talking about creating a Debian installation image, I can't provide step-by-step instructions for it; however, the general way to create a USB drive that's bootable in both EFI and Linux is:
The Debian installer, of course, has things set up in its own way, so step #2 will involve figuring out how the installer works and "translating" it to work from the USB flash drive.
I would think that Debian and Ubuntu are technically close enough so that this method for Ubuntu may work also for Debian: https://help.ubuntu.com/community/Installation/UEFI-and-BIOS
EDIT: You need to first decide which flavor you want: 32-bit or 64-bit. Most people will want to go with 64-bit i.e.
Then install Debian, preferably in UEFI mode. After configuring the bootloader (which will be installed to the ESP) reboot again with the Debian installation media, but this time in BIOS mode. Try to install GRUB to the
On Debian you will probably have to install GRUB by hand, manually, and make sure it is installed once as UEFI bootloader on the ESP and once as BIOS boot sector on the
Be aware that automatic kernel updates will only be updated on the system that is currently running, i.e. either BIOS or UEFI, and depending on your current configuration. THIS IS NOT AUTOMATIC.
There are a couple of other possibilities described in the linked source, and sources linked from there. It is also different for an installed Debian vs. the installer for Debian to be multi-system (UEFI+BIOS). Additionally, in UEFI mode you have to take some thought if you want it to be able to use Secure Boot or not.