ke 14. elok. 2024 klo 1.08 Pascal Hambourg (pas...@plouf.fr.eu.org) kirjoitti: > > On 13/08/2024 at 22:02, Martin-Éric Racine wrote: > > > > I've been trying to implement a chainloader (see below at > > /etc/grub.d/40_custom) to boot off external USB disks as needed. > > Finding external disks requires using GRUB's 'nativedisk' > > Only with flawed BIOS which cannot boot from USB or do not expose all > drives. I observed that some BIOS expose only a USB drive when booting > from it, but others expose all USB drives regardless of the boot device.
This BIOS only shows fd0 and hd0, when I type 'ls' on GRUB's command line... > > Further investigating this suggests that if Debian used 'grub-install > > --disk-module=native /dev/sdX' to install GRUB, this would work as > > expected. > > Native disk drivers do not work properly on all machines, so they cannot > be enabled by default for a rare use case. ... however, typing 'nativedisk' suddenly finds the CD and USB drives, except that it uses a different naming strategy. > > menuentry "USB chainloader" { > > insmod part_msdos > > insmod ext2 > > insmod fat > > insmod iso9660 > > Why do you load these modules ? Chainloading a disk boot sector does not > require to read any partition table nor filesystem. > Instead you should load the "chain" module which provides the > "chainloader" command. > > > nativedisk > > set root='ata0,msdos1' > > chainloader (usb0)+1 > > } > > Why do you set $root to an internal disk partition if you intend to > chainload a USB drive ? Did you mean to set $prefix so that GRUB can > find its directory and modules after switching to native disk drivers ? You're welcome to suggest a better recipe. Martin-Éric