2

I want to add memtest86 to my Grub menu on an EFI system. I follow these instructions. However when choosing the new grub menu entry, I get this error:

error: disk `hd0,gpt1' not found

On my system, the boot/efi partition is on sda1, so that should be correct. This is my etc/grub.d/40_custom file:

#!/bin/sh
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.

menuentry 'MemTest86' { insmod part_gpt insmod fat set root='hd0,gpt1' chainloader ($root)/EFI/memtest86/BOOTX64.efi }

So what went wrong?

Till B
  • 328

2 Answers2

0

Try this:

$ sudo apt install memtest86+

It automatically updates your grub boot menu

Tejas Lotlikar
  • 2,945
  • 5
  • 17
  • 26
  • 1
    The question is about memtest86 'without plus' for UEFI mode; memtest86+ works only in BIOS mode alias CSM alias legacy mode. But on the other hand, it can be OK to boot the computer in BIOS mode in order to test the memory. See this link and links from it. – sudodus Sep 03 '22 at 19:23
-1

Worked here make certain your drive is correct the hd0,gpt1 I had mine wrong on the first try but after I seen it work with a direct loading on my EFI boot menu I knew it was something stupid I did in the configuration. If wanting to do the direct, from the in my case F12 boot menu do the below. You do not even need to change the line if it is the sda your install is on. Use the -o command to put the new entry last in the order and keep you existing boot order.

root@zeus-H370M:~# efibootmgr -v
BootCurrent: 0004
Timeout: 2 seconds
BootOrder: 0004,0000,0005
Boot0000* OpenCore  HD(1,GPT,f2d84cb4-e597-4ac4-a2b2-10f0351c8784,0x28,0x64000)/File(\EFI\OC\OPENCORE.EFI)
Boot0004* ubuntu    HD(1,GPT,9fad4e77-177d-4a3c-929a-3897e6bc1810,0x28,0x64000)/File(\EFI\UBUNTU\SHIMX64.EFI)
Boot0005* UEFI OS   HD(1,GPT,f2d84cb4-e597-4ac4-a2b2-10f0351c8784,0x28,0x64000)/File(\EFI\BOOT\BOOTX64.EFI)..BO
root@zeus-H370M:~# efibootmgr -c -d /dev/sda  -L "MemTest86" -l '\EFI\memtest86\BOOTX64.EFI'
BootCurrent: 0004
Timeout: 2 seconds
BootOrder: 0001,0004,0000,0005
Boot0000* OpenCore
Boot0004* ubuntu
Boot0005* UEFI OS
Boot0001* MemTest86
root@zeus-H370M:~# efibootmgr -v
BootCurrent: 0004
Timeout: 2 seconds
BootOrder: 0001,0004,0000,0005
Boot0000* OpenCore  HD(1,GPT,f2d84cb4-e597-4ac4-a2b2-10f0351c8784,0x28,0x64000)/File(\EFI\OC\OPENCORE.EFI)
Boot0001* MemTest86 HD(1,GPT,9fad4e77-177d-4a3c-929a-3897e6bc1810,0x28,0x64000)/File(\EFI\memtest86\BOOTX64.EFI)
Boot0004* ubuntu    HD(1,GPT,9fad4e77-177d-4a3c-929a-3897e6bc1810,0x28,0x64000)/File(\EFI\UBUNTU\SHIMX64.EFI)
Boot0005* UEFI OS   HD(1,GPT,f2d84cb4-e597-4ac4-a2b2-10f0351c8784,0x28,0x64000)/File(\EFI\BOOT\BOOTX64.EFI)..BO
root@zeus-H370M:~# efibootmgr -o 0004,0000,0005,0001
BootCurrent: 0004
Timeout: 2 seconds
BootOrder: 0004,0000,0005,0001
Boot0000* OpenCore
Boot0001* MemTest86
Boot0004* ubuntu
Boot0005* UEFI OS