8

I had the same problem as @coversnail here: How can I add the Memtest86+ options back to the Grub menu?

The problem is: I just can choose between older kernel versions and the actual Ubuntu version in GRUB. There are no other options.

I want to run memtest86+. It is installed and in /etc/grub.d/, but it is not in GRUB itself. I am kind of confused.

Marc
  • 293
  • memtest86 5.0 is available for 15.10, backport to 14.04 yet to be done - https://bugs.launchpad.net/ubuntu/+source/memtest86+/+bug/1234612 #8 – Hannu Oct 04 '15 at 05:11

2 Answers2

5

Try Grub Customizer. Grub Customizer is a graphical settings manager for GRUB2.

To install, just press Ctrl+Alt+T on your keyboard to open Terminal. When it opens, run the command(s) below:

sudo add-apt-repository ppa:adabbas/1stppa
sudo apt-get update
sudo apt-get install grub-customizer

Or just check out their website.

To add the memtest entries see images below, and the text.

enter image description here enter image description here enter image description here

First Entry

insmod part_msdos
insmod ext2
set root='hd0,msdos1'
if [ x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1  b4d22d74-d1db-44c3-a834-e879263662f5
else
  search --no-floppy --fs-uuid --set=root b4d22d74-d1db-44c3-a834-e879263662f5
fi
linux16 /boot/memtest86+.bin

Second Entry

insmod part_msdos
insmod ext2
set root='hd0,msdos1'
if [ x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1  b4d22d74-d1db-44c3-a834-e879263662f5
else
  search --no-floppy --fs-uuid --set=root b4d22d74-d1db-44c3-a834-e879263662f5
fi
linux16 /boot/memtest86+.bin console=ttyS0,115200n8

Note: Now the above information is correct, but keep in mind that memtest will not work in grub2-uefi . This is because UEFI does not support launching 16-bit binaries and memtest is a 16-bit binary. Thats also the reason why there is no linux16 command/module in grub2 uefi.

Also you may want to look at memtest86+ fails on efi systems.

Mitch
  • 107,631
  • There are 4 partitions to choose... I do not exactly know which is affected by memtest. 1 dev/sda and 3 dev/sdb... – Marc Jun 25 '13 at 06:09
  • Why exactly is insmod referring to ext2 when I only got partitions using ext4, vfat and swap? – Marc Jun 25 '13 at 06:42
  • 1
    ext2 covers ext2, ext3 and ext4. /boot/grub, is where the Grub 2 modules are stored, you will find ext2.mod. There is no ext4.mod – Mitch Jun 25 '13 at 06:49
  • Ok, after trying the above mentioned I get following errors: https://lh5.googleusercontent.com/--ctayCbzuLg/UcwCys6kOdI/AAAAAAAABH8/GTOyUgICCsM/w1044-h217-no/IMG_9785.JPG – Marc Jun 27 '13 at 09:15
  • You un-accepted the answer, Why? Then you post an error message that is not in English. How I'm suppose to further help you? – Mitch Jun 27 '13 at 10:31
  • Hey Mitch, the thing is that I did not manage to run memtest, because this error came. It actually says "device not found" plus the device and "linux16 could not be found" - "press any key to continue"

    Hence, the answer is not yet a solution, I un-accepted the answer. I do really appreciate your help!

    – Marc Jun 27 '13 at 10:58
  • The thing is: I managed to bring memtest to grub - but memtest is not working... :/ – Marc Jun 27 '13 at 11:55
  • Can you please give me the complete message in English? – Mitch Jun 27 '13 at 11:57
  • Error: no such device: b4d22d74-d1db-44c3-a834-e879263662f5. Error: command »linu16« could not be found.

    Press any key to continue.

    – Marc Jun 28 '13 at 09:32
  • Do you have UEFI BIOS? I'm going to be away for a few hours, but I will get back to you. – Mitch Jun 28 '13 at 11:00
  • Yes, I guess this is kind of the problem why my system crashes (kernel panic) - that's why I wanted to run memtest. Cheers. – Marc Jun 28 '13 at 12:00
  • 1
    See note I added in my answer. I'll leave the decision about the answer up to you. – Mitch Jun 28 '13 at 17:47
  • Thank you so much. Much appreciated. That's why I love the Ubuntu community. Thanks a lot again. – Marc Jun 29 '13 at 11:51
4

I know this is an old post, but it still comes up in searches, so I'm going to give a solution.

Most distros supply memtest86+. It is not compatible with UEFI, because UEFI does not support 16 bit . However, PassMark Memtest86 (ver. 5 or later) supports UEFI.

First, obtain the memtest files. Download the USB boot image. http://memtest86.com/download.htm Next, extract the files from the image. I burned the image to a flash drive to facilitate installing on multiple computers.

Second, install memtest86. I made a 500MB partition at the end of my HDD, and formatted to FAT32. Then copied all files from flash drive to this partition. Note: it is possible to install to your EFI directory, but files need to be renamed to avoid overwriting existing boot files.

Third, configure grub2-efi menu entry. There are many ways to add an entry, but the safest way that survives update-grub follows. Using root privileges create file /etc/grub.d/39_memtest, and set it executable. (Note: changing the number in the file name changes the position it appears in the grub menu. DO NOT make it lower than 6 to insure that header and theme run first)

Next make the contents of the file:

#!/bin/sh

echo "Adding Memtest86" >&2

exec tail -n +3 $0

menuentry "Memtest86" {

chainloader (hdx,y)/efi/boot/bootx64.efi

}

EOF

*Replace (hdx,y) with your appropriate HDD and partition information.

Then run update-grub You should now have a menu entry that boots into Memtest86

ravery
  • 6,874