How can I run Memtest86+ on my UEFI system?

Solution Verified - Updated -

Environment

Red Hat Enterprise Linux 8, 9 with UEFI

Issue

The Memtest86+ included on RHEL rescue media doesn't work on UEFI systems. How can I test my memory?

Resolution

A convenient method is to download the Memtest86+ EFI binary from the upstream provider and make a GRUB menu entry that launches it. This version has not gone through RHEL's quality control process and is not something Red Hat can support - these instructions are provided as a convenience.

To install the upstream version, first download Memtest86+ from the upstream source, downloading their "Binary Files (.bin/.efi)" archive:

  • https://www.memtest.org/

(Please note that the aforementioned link is to an external site. Red Hat cannot guarantee the accuracy of the information provided therein.)

Unpacking the resulting archive yields, among other files, memtest64.efi. Move this to the redhat directory in your EFI System Partition:

cp memtest64.efi /boot/efi/EFI/redhat/

Then, add a boot entry to the end of your /etc/grub.d/40_custom file. It should look like this now:

#!/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 chain
    search --no-floppy --set=root --file /EFI/redhat/memtest64.efi
    chainloader ($root)/EFI/redhat/memtest64.efi
}

Finally, update your GRUB config, which will add the menu entry we just created to your boot-time GRUB config:

grub2-mkconfig -o /etc/grub2-efi.cfg

Now, on reboot, you should see a memtest86+ entry in your GRUB menu. Selecting this will launch the Memtest86+ memory tester.

Root Cause

RHEL rescue media includes an older version of Memtest86+ that doesn't support UEFI. A newer version is required for UEFI systems.

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Comments