The Funtoo Linux project has transitioned to "Hobby Mode" and this wiki is now read-only.
Difference between revisions of "User:Hackbyte/Memtest from EFI boot selection"
(First entry.. ;) rough scribbled... work in progress... ;)) |
m (minor edits) |
||
(3 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
== How to create a MemTest boot option directly as EFI Boot Entry. == | == How to create a MemTest boot option directly as EFI Boot Entry. == | ||
The idea is to have | The idea is to have [[Package:Memtest86+]] available direct from your BIOS even before grub is loaded, or if you directly boot [[EFI stub]] kernel without grub at all. So you can select it by going to the boot selection menu (like with pressing F-8 at initialisation time). | ||
You need to download memtest directly from the homepage, that way you can get a newer free to use version than usual repos are allowed to provide. | You need to download memtest directly from the homepage, that way you can get a newer free to use version than usual repos are allowed to provide. | ||
Line 19: | Line 19: | ||
Get your memtest86-usb.img online as loop device like: | Get your {{f|memtest86-usb.img}} online as loop device like: | ||
{{console|body= | |||
###i## mount -o loop,offset=263192576 /home/user/opt/memtest/memtest86-usb.img /mnt/memtest/ }} | |||
copy over everything from: | copy over everything from: | ||
{{console|body= | |||
$ ##i##ls -la /mnt/memtest/EFI/BOOT/ | |||
total 4684 | total 4684 | ||
drwxr-xr-x 3 root root 4096 May 7 23:38 . | drwxr-xr-x 3 root root 4096 May 7 23:38 . | ||
Line 35: | Line 37: | ||
-rwxr-xr-x 1 root root 6823 May 7 23:38 mt86.png | -rwxr-xr-x 1 root root 6823 May 7 23:38 mt86.png | ||
-rwxr-xr-x 1 root root 2358510 May 7 23:38 unifont.bin | -rwxr-xr-x 1 root root 2358510 May 7 23:38 unifont.bin | ||
}} | |||
to your {{f|/boot/EFI/memtest}} dir | |||
to your /boot/EFI/memtest dir | |||
like: | |||
{{console|body= | |||
###i## mkdir /boot/EFI/memtest | |||
###i## cp -r /mnt/memtest/EFI/BOOT/ /boot/EFI/memtest | |||
}} | |||
afterwards you need to add your memtest to your (U)EFI boot menu using efibootmgr like this: | afterwards you need to add your memtest to your (U)EFI boot menu using efibootmgr like this: | ||
efibootmgr -c -d /dev/sda -p 1 -L "memtest" -l "\EFI\memtest\BOOTX64.efi" | {{console|body= | ||
###i## efibootmgr -c -d /dev/sda -p 1 -L "memtest" -l "\EFI\memtest\BOOTX64.efi" | |||
}} | |||
Now you should find a new "memtest" boot entry in your UEFI setup which you can select to boot and have memtest at hand, whenever you need it. ;) | |||
[[Category:HOWTO]] |
Latest revision as of 23:04, July 18, 2020
How to create a MemTest boot option directly as EFI Boot Entry.
The idea is to have Package:Memtest86+ available direct from your BIOS even before grub is loaded, or if you directly boot EFI stub kernel without grub at all. So you can select it by going to the boot selection menu (like with pressing F-8 at initialisation time).
You need to download memtest directly from the homepage, that way you can get a newer free to use version than usual repos are allowed to provide.
You can find it here: https://www.memtest86.com/downloads/memtest86-usb.zip
After that, unzip it into a folder and cd in to there.
Now we need to open the included .img file (which you normally just would write on to a usb drive) to grab some of it's contents. The easiest way is to use Linux Loop Mount capabilities.
But there could be a catch. If your loop module is configured with max_part=0, you can not simply connect the image file to a loop device and access it's contents like a cdrom or partition image, because it is actually a whole disk image including it's own GPT partition header.
So, especially in that case, we need to "address" a specific "sector" within the image.
see (thx krish!!) https://www.yosoygames.com.ar/wp/2020/03/installing-memtest86-on-uefi-grub2-ubuntu/ (https://www.linuxquestions.org/questions/linux-general-1/how-to-mount-img-file-882386/ ## old)
Get your memtest86-usb.img
online as loop device like:
root # mount -o loop,offset=263192576 /home/user/opt/memtest/memtest86-usb.img /mnt/memtest/
copy over everything from:
user $ ls -la /mnt/memtest/EFI/BOOT/ total 4684 drwxr-xr-x 3 root root 4096 May 7 23:38 . drwxr-xr-x 3 root root 4096 May 7 23:38 .. -rwxr-xr-x 1 root root 1144864 May 7 23:38 BOOTIA32.efi -rwxr-xr-x 1 root root 1260640 May 7 23:38 BOOTX64.efi drwxr-xr-x 2 root root 4096 May 7 23:38 Benchmark -rwxr-xr-x 1 root root 4181 May 7 23:38 blacklist.cfg -rwxr-xr-x 1 root root 6823 May 7 23:38 mt86.png -rwxr-xr-x 1 root root 2358510 May 7 23:38 unifont.bin
to your /boot/EFI/memtest
dir
like:
root # mkdir /boot/EFI/memtest root # cp -r /mnt/memtest/EFI/BOOT/ /boot/EFI/memtest
afterwards you need to add your memtest to your (U)EFI boot menu using efibootmgr like this:
root # efibootmgr -c -d /dev/sda -p 1 -L "memtest" -l "\EFI\memtest\BOOTX64.efi"
Now you should find a new "memtest" boot entry in your UEFI setup which you can select to boot and have memtest at hand, whenever you need it. ;)