Ubuntu – BIOS/GRUB is unable to detect external hard disk drive

biosgrub2grubrescue

Cannot boot to Linux because BIOS boot menu and GRUB rescue image console unable to locate external hard disk drive

Best Answer

Due to the limitations of some BIOS, external hard drives are unable to be detected. A work around is to use USB drive to load GRUB which then run configfile of grub.cfg inside external hard drive. However GRUB uses data from BIOS to get the list of devices, thus external hard drive is still not visible. The solution is to use GRUB native driver to look for the external driver.

https://www.gnu.org/software/grub/manual/grub/html_node/nativedisk.html#nativedisk

Switch from firmware disk drivers to native ones.

Using nativedisk, all your USB devices will be detected by GRUB using GRUB's own drivers instead of data from BIOS. Once this is done, you can use ls normally inside the grub> console and all of your USB devices will be listed. By listing each device one by one, you then find the root of Linux installation, boot folder, grub folder, and grub.cfg. eg: ls (hd1,msdos2)/boot/grub/ output: grub.cfg

https://www.gnu.org/software/grub/manual/grub/html_node/configfile.html#configfile

Load file as a configuration file. If file defines any menu entries, then show a menu containing them immediately. Any environment variable changes made by the commands in file will not be preserved after configfile returns.

Using the command configfile, we will load the grub.cfg inside the external drive to boot to it. eg: configfile (hd1,msdos2)/boot/grub/grub.cfg

The grub.cfg in the USB drive can then be modified to run nativedisk and configfile (hd1,msdos2)/boot/grub/grub.cfg automatically without user input.

Example grub.cfg to put inside USB Grub Rescue

nativedisk
configfile (hd1,msdos2)/boot/grub/grub.cfg
Related Question