Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

After having installed the 64bit version of Ubuntu 12.04 on my Lenovo B570 I ran into the same problems I had when installing 11.10 with Grub not playing nicely with a uEFI system. I used the same technique as last time to solve the problem (using a Super Grub Disc LiveCD session to repair Grub) and my system happily dual boots between Ubuntu and Windows 7

However now when I boot up the Grub menu only displays

  • Ubuntu, with Linux 3.2.0-24-generic
  • Ubuntu, with Linux 3.2.0-24-generic (recovery mode)
  • Previous Linux versions
  • Windows 7 (loader) (on /dev/sda1)
  • Windows Recovery Environment (loader) (on /dev/sda4)

I no longer see the option to use Memtest86+ which was there previously, having checked in the Ubuntu Software Center I can see that the package is installed, but how to I make the option to run it once again appear in the Grub menu?

I've tried:

sudo update-grub 

which doesn't make any difference.

sudo chmod +x /etc/grub.d/20_memtest86+ 

results in:

chmod: cannot access /etc/grub.d/20_memtest86+': No such file or directory

and entering

ls /etc/grub.d/

results in:

00_header        10_linux      30_os-prober  41_custom
05_debian_theme  20_linux_xen  40_custom     README
share|improve this question
Try adding the script as detailed below, copied it from my machine, do the chmod +x and grub update and see if that works. I see you did - welcome. –  Elfy Apr 27 '12 at 20:19

4 Answers 4

up vote 10 down vote accepted

Try opening a terminal and running

sudo chmod +x /etc/grub.d/20_memtest86+
sudo update-grub

Check to see if it's there

cat /boot/grub/grub.cfg |grep memtest

Just done the same as I had it disabled

hob@hob-HP-dx5150-MT:~$ cat /boot/grub/grub.cfg |grep memtest
hob@hob-HP-dx5150-MT:~$ sudo chmod +x /etc/grub.d/20_memtest86+
[sudo] password for hob: 
hob@hob-HP-dx5150-MT:~$ sudo update-grub
Generating grub.cfg ...
Found linux image: /boot/vmlinuz-3.2.0-24-generic
Found initrd image: /boot/initrd.img-3.2.0-24-generic
Found linux image: /boot/vmlinuz-3.2.0-23-generic
Found initrd image: /boot/initrd.img-3.2.0-23-generic
Found memtest86+ image: /boot/memtest86+.bin
Found Ubuntu 11.10 (11.10) on /dev/sda6
Found Trisquel 5.5 (5.5) on /dev/sda8
Found Ubuntu 12.04 LTS (12.04) on /dev/sda9
hob@hob-HP-dx5150-MT:~$ cat /boot/grub/grub.cfg |grep memtest
### BEGIN /etc/grub.d/20_memtest86+ ###
menuentry "Memory test (memtest86+)" {
    linux16 /boot/memtest86+.bin
menuentry "Memory test (memtest86+, serial console 115200)" {
    linux16 /boot/memtest86+.bin console=ttyS0,115200n8
### END /etc/grub.d/20_memtest86+ ###

You could try creating the file if it's not there, using nano in a terminal

sudo nano /etc/grub.d/20_memtest86+

or with a gui editor

gksudo gedit /etc/grub.d/20_memtest86+

Fill it with

set -e

if [ -f /usr/lib/grub/grub-mkconfig_lib ]; then
  . /usr/lib/grub/grub-mkconfig_lib
elif [ -f /usr/lib/grub/update-grub_lib ]; then
  . /usr/lib/grub/update-grub_lib
  # no grub file, so we notify and exit gracefully
  echo "Cannot find grub config file, exiting." >&2
  exit 0

# We can't cope with loop-mounted devices here.
  /dev/loop/*|/dev/loop[0-9]) exit 0 ;;

prepare_boot_cache="$(prepare_grub_to_access_device ${GRUB_DEVICE_BOOT} | sed -e "s/^/\t/")"

if test -e /boot/memtest86+.bin ; then
  MEMTESTPATH=$( make_system_path_relative_to_its_root "/boot/memtest86+.bin" )
  echo "Found memtest86+ image: $MEMTESTPATH" >&2
  cat << EOF
menuentry "Memory test (memtest86+)" {
  printf '%s\n' "${prepare_boot_cache}"
  cat << EOF
menuentry "Memory test (memtest86+, serial console 115200)" {
  printf '%s\n' "${prepare_boot_cache}"
  cat << EOF
    $LX $MEMTESTPATH console=ttyS0,115200n8

#if test -e /boot/memtest86+_multiboot.bin ; then
#  MEMTESTPATH=$( make_system_path_relative_to_its_root "/boot/memtest86+_multiboot.bin" )
#  echo "Found memtest86+ multiboot image: $MEMTESTPATH" >&2
#  cat << EOF
#menuentry "Memory test (memtest86+, experimental multiboot)" {
#  printf '%s\n' "${prepare_boot_cache}"
#  cat << EOF
#   multiboot   $MEMTESTPATH
#menuentry "Memory test (memtest86+, serial console 115200, experimental multiboot)" {
#  printf '%s\n' "${prepare_boot_cache}"
#  cat << EOF
#   multiboot   $MEMTESTPATH console=ttyS0,115200n8

Make sure to run the chmod +x command on it afterwards.

I'd be a bit concerned that it's missing though - do you have everything else in grub.d ?

ls /etc/grub.d/

00_header        10_linux.bak       20_memtest86+  41_custom
05_debian_theme  10_linux.dpkg-old  30_os-prober   README
10_linux         20_linux_xen       40_custom
share|improve this answer
sudo chmod +x /etc/grub.d/20_memtest86+ resulted in: chmod: cannot access /etc/grub.d/20_memtest86+': No such file or directory –  coversnail Apr 27 '12 at 14:34
Edited answer to include this –  Elfy Apr 27 '12 at 19:57
Added ls /etc/grub.d/ result to question, no mention of memtest, but your answer has now made it work perfectly, thank you. –  coversnail Apr 27 '12 at 20:18
I found 20_memtest86+ lurking in /etc/grub.d.bak/ somehow. Moved it into place, updated GRUB and everything worked fine for me. –  Naftuli Tzvi Kay Jan 8 '13 at 7:29

I didn't managed to make this work in 2 days, then I checked Synaptic for grub packages... Seems to be, that the absence of package grub-imageboot are the root of the problem.

sudo apt-get install grub-imageboot
share|improve this answer

I had the same issue, and due to the fact that I have EFI on my laptop the memtest86+ version 4.x shipped by ubuntu won't work, since EFI is only supported by version 5 and newer.

The latest versions are non-GPL and must be downloaded manually from the memtest website(they have ISO and USB images), but at least they are free of charge.

share|improve this answer
memtest86.com/download.htm –  Marcos Apr 16 at 22:56
apt-get install memtest86+

This will automatically reconfigure grub and add the entry to the boot menu.

share|improve this answer

protected by Community Mar 11 at 15:09

Thank you for your interest in this question. Because it has attracted low-quality answers, posting an answer now requires 10 reputation on this site.

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.