On 07/04/2025 02:35, David Christensen wrote:
On 4/5/25 20:26, Max Nikulin wrote:
> UEFI almost certainly can boot from mbr (DOS) partition, otherwise it
> will be impossible to boot from USB pen drive. ...
AIUI the USB pen drive must be partitioned specially, each partition
must be formatted specially (e.g. raw machine code, binary data
structures, filesystems, etc.), and the various boot loader stages must
be coded specially for a USB pen drive to boot in both BIOS computers
and in UEFI computers.
Maybe I was lucky to avoid machines with extremely buggy Firmware or
BIOS, but my impression is that usual msdos (mbr) label with single FAT
partition worked well. My regular way to make a recovery pen drive was
(non-destructive one):
- download a live image
- set bootable flag to the partition
- remove unnecessary files from the drive
- extract .iso to the existing partition
- rename isolinux to syslinux
- adjust syslinux config a bit
- run syslinux and install-mbr. This is for BIOS (legacy) boot.
No special step for UEFI is required, EFI/Boot/bootx64.efi from live
.iso is enough.
The advantage over "dd of=/dev/sdb" is that you may keep additional
files on the pen drive.
Disclaimer: I used Ubuntu live images, in Debian at least symlinks to
kernel and initrd require special treatment. I am lazy enough to test
BIOS (CSM legacy or compatibility) mode nowadays.
In the case of internal drive with multiple msdos partitions I would
consult UEFI spec if it prescribes specific code for ESP. To be on the
safe side I would make ESP first partition.