If I have an USB drive plugged in when the grub menu displays, my x86 OpenWrt can fail with
error: disk 'hd0,gpt1' not found.
If the USB drive has not been plugged, then OpenWrt boots successfully.
It seems the USB drive assumes hd0
if it's plugged in and OpenWrt always boots from hd0
.
The grub entry that boots OpenWrt is the vanilla content:
set params 'OpenWrt'
linux /boot/vmlinuz root=PARTUUID=[uuid] rootwait console=tty0 console=ttyS0,115200n8 noinitrd
My machines supports UEFI only, and both a Debian live cd USB drive that support UEFI or an empty USB drive that is formatted as FAT can prevent OpenWrt from booting.
How can I prevent the disk index from being messed up by an inserted USB drive, or make grub always boot from hard disk intelligently?