-2

My objective is to install Grub 2 on an initially blank drive and then add the boot partition for UEFI so that the UEFI .img can be added and everything can boot as a standalone.

There are instructions at:

MemTest86 Grub Install with Ubuntu Linux

However, these end up with the UEFI boot option as as a sideline GRUB install from the other boot options and not as a standalone.

There is some information about how to install the UEFI .img (like Memtest86+) on top of a fresh install of Ubuntu. Rather I would like to use the root terminal to just add GRUB and configure it from Ubuntu so it is ready to work from a standalone disk with the one UEFI partition and the GRUB boot area:

Wiki Community GRUB installing

The above link is very hard for me to understand. I am looking for simpler instructions or suggestions. Thank you for your suggestions or recommended specific steps.

Update: I made sure that the GRUB version was updated to the latest:

/mnt/boot/memtest86# grub-install --version
grub-install (GRUB) 2.04-1ubuntu26.15

The grub-install proceeded to install GRUB in the boot sector with the force option, and of course specifying not the UBUNTU boot disk, but rather a different SATA disk that I would transfer to the new computer to boot. I am able to boot to the "Grub>" prompt now to manually issue the commands. However, the last command, the chain loader is not working.

On a different computer, everything works fine. But I want to return the USB stick that I purchased to get a refund instead of installing memtest86 V10 there as PassMark, the software developer, supports.

I also found a similar question at this site memtest efi grub installation; however that question dead-ended without a real answer.

Update 2:

I found some other reference(s) that might be helpful:

boot-able setup for BIOS and UEFI

SOLVED: Grub 2 gives Error: Invalid Signature

How to get a UUID from a device from the GRUB2 prompt

I still have not been able to get the chain loader to work, even with the force option, even with boot after. With the force option there is no output except another "grub>" prompt. If I remember correctly, boot just goes to a blank screen.

  • I decided to keep the Ubuntu 20.04 Live SSD disk attached because it's GRUB worked in UEFI mode. Then I could type 'c' to get into the command line. From there it was very simple - ironically. I navigate to the UEFI image with the ls command. Then I use the chainloader command to load it and the boot command to boot from it. The main problem boils down to how to fix the GRUB install also on the Ubuntu Linux main disk. I can boot the Ubuntu Linux main disk in UEFI mode fine using the same manual steps, but it is a shame that I still cannot get GRUB working from there and that is it. – Stephen Elliott Dec 21 '22 at 12:29
  • I seem to have made some progress with this link on the grub install grub efi reinstall instructions, with finally no error from grub-install. Setting the different partition names to the correct partitions are critical. The "for" statement gives a good hint for which partition is what; the "ls" statement can be used to confirm the choices. – Stephen Elliott Dec 21 '22 at 13:45

2 Answers2

3

External drives boot from /EFI/Boot/bootx64.efi. Internal drives may have that entry as fallback or drive boot entry. Ubuntu normally boots from /EFI/ubuntu/shimx64.efi.

You need to create a decent sized ESP - efi system partition on your drive. I do not know how large memtest is.

From my Ubuntu install, so I have grub and a flash drive's ESP labeled focal, mounted at /media/fred, I installed grub. The standalong parameter installs grub to /EFI/Boot. You still have to manually create a grub.cfg in /EFI/ubuntu or /EFI/Boot. Not sure what I did back then. I think I used a typical configfile UEFI entry to load another grub.cfg in another folder similar to how UEFI configfile loads full grub.cfg from install's / partition.

sudo grub-install --target=x86_64-efi --boot-directory=/media/fred/FOCAL/EFI/BOOT --efi-directory=/media/fred/FOCAL --removable

My Kubuntu dolphin does not auto mount ESP partitions, so I have to manually mount to see or edit them.

As per your link on memtest. Then you need to extract your memtest file. Copy to /EFI/memtest/bootx64.efi and create boot stanza. If this drive only for memtest, you can probablyh make the one grub.cfg the example they show for 40_custom

example UEFI configfile:

How make external usb disk bootable for bios and uefi

If you have any live installer ISO, you can mount it and look at folders & grub.cfg it uses for directly booting a flash drive. You configuration needs to be similar.

oldfred
  • 12,100
0

I was trying the GRUB load previously because the main instructions for creating a USB boot disk for Linux or Mac were not working for me. Also, the GRUB boot instructions did not work. However, now with a newer version of Memtest86 Version 10.1.0009 the Linux USB boot instructions work again, solving the boot problem that was the road-block even with the GRUB boot attempt previously.

Update: I copied the UBUNTU .iso file with dd to an SSD and booted from it in order to install the UEFI version of Ubuntu on the second SSD drive. I was able to UEFI boot it manually using the instructions with a manual GRUB boot from the live UBUNTU SSD:

GRUB boot loader instructions

One thing important to note is that I added the module chain with "insmod chain" and after the "chainloader" step, I had to add the line "boot". I was able to boot to the UEFI Ubuntu Linux in the second drive fine! I copied the necessary files also from the updated memtest86-10.01.009 source .img from the .iso file (easy to do with Ubuntu Disks). I created the recommended directory and then I could manually boot from there also.

So now I can boot from just GRUB. But it is quite a kludge right now because Ubuntu is not putting in GRUB correctly on the disk that it installs the UEFI version of the OS on. There is only one entry for that BOOT disk and it is not working as a boot volume using this second disk's GRUB. Only the Ubuntu live manual GRUB works at this time.

Older comments:

I needed to use a boot disk because the MemTest Free Version 10 from PassMark was not booting. The trouble was that a newer workaround was needed from PassMark. This issue is documented here:

Memtest86 hangs on Boot from USB - Macbook 2014 article from PassMark

The reference image is at this link on that site:

memtest86-usb-10.1.0009.zip file download link

I downloaded the link file and then in the Downloads directory I created a sub-directory named "memtest86-usb-10.1.0009". I copied the zip file into that directory and then used unzip like this:

unzip memtest86-usb-10.1.0009

I then copied the .iso image using dd following this link from the question, being careful to use an actual usb drive instead of an SSD. It may work also from an SSD image also but I have not tried that yet. I used the MemTest86 boot loader instead of GRUB because it is simpler to install:

Creating a MemTest86 bootable USB Flash drive in Linux/Mac

I just boot the Intel computer in BIOS mode and choose the first UEFI entry. The computer is configured in the BIOS for a UEFI boot since version 10, the latest MemTest version, requires that to boot properly according to their web-site.

I am currently testing 32 GB of Memory that had been previously tested with an older version, and all is fine as to be expected.

P.S. I also tested the dd from the .iso file to the SSD /dev/sda and then I moved that SSD drive to another computer and I chose to boot from it from the BIOS selection menu. Everything was fine there also. The computer boots fine and MemTest 10.1 FREE works fine. A next step would be the UEFI installation of Ubuntu. For some reason, my computers lack the UEFI option. I am still trying to figure out how to install Ubuntu on a fresh disk -- with a UEFI boot option.

I did find a reference:

Installation/UEFI-and-BIOS/stable-alternative

But the reference is overly-complicated for me as as-of-yet. Is there a simpler approach that works well?

  • I tried also using dd from the image .iso file to an internal SSD as in "dd if=./memtest86-usb.img of=/dev/sda status=progress". I placed the SSD inside the computer that was not booting before with the SSD or USB disk and everything works fine. The version of Memtest86 seems to toggle the issue here. I have not yet tried GRUB but I would not be surprised if GRUB also works with the new USB disk image boot. – Stephen Elliott Dec 20 '22 at 11:26
  • I found this reference that is extremely helpful. Also one of our computers gives a very clear option to select UEFI boot mode. I copied the .iso image to the SSD and booted to UEFI mode. Then I had the option in the install menu to add a UEFI partition. I completely erased the drive (no partition table even) before starting the Ubuntu install from the image iso. How To Install Ubuntu 20.04 LTS (Focal Fossa) On UEFI and Legacy BIOS System – Stephen Elliott Dec 20 '22 at 13:43