Page 1 of 1
MX live USB GRUB boot rescue menu - standalone customized version
Posted: Tue Jul 06, 2021 1:05 am
by andrewjoseph
Hi all,
Congrats for making the brilliant MX USB GRUB boot rescue menu, really a godsend for unbootable OSes.
I want to make a EFI and BIOS bootable multiboot USB with MX GRUB rescue menus, rEFInd, MX KDE , Linux mint Cinnamon, Linux Mint Mate, MX XFCE 32-bit, Peppermint OS, Windows installer, Android x86 (64 bit) , Ubuntu Mate and Rescatux. It's for my friend (a computer technician). We want people to try out and choose their fit before installation.
This is what I did :
1) Create a FAT32 partition named "ESP", a /boot folder in it and
Code: Select all
sudo grub-install --target=i386-pc --boot-directory=/media/andrew/ESP/boot /dev/sdb
2) Copy /EFI and /boot folders from LM ISO (good for secure boot)
3) Copy all folders from MX KDE ISO (not replacing existing files)
4) Copy rEFInd into /EFI folder (name it refindx64.efi)
5) Make an exFAT partition and extract Windows ISO there
6) Make an extended partition with logical partitions (ext2) for Android and other Linuxes.
7) Edit /boot/grub/grub.cfg to add entries for all these :
Code: Select all
#------------------------------------------------------------------
# file: /boot/grub/grub.cfg for the Live version of MX
#
# This file can get updated automatically on a LiveUSB via the save
# feature in the text menus. It is possible to break these updates
# by editing this file.
#------------------------------------------------------------------
set timeout=60
set gfxmode=1024x768
set gfxpayload="1440x960;1440x900;1368x912;1366x768;1280x800;1280x720;1280x1024;1200x800;1024x768;auto"
set default=1
set WindowsInstallUUID="<UUID>"
set MainUUID="<UUID>"
search --no-floppy --set=root --fs-uuid $MainUUID
# load defaults
#
if [ -s $prefix/config/defaults.cfg ]; then
source $prefix/config/defaults.cfg
fi
menuentry "Linux Mint Cinnamon - good for beginners - looks just like Windows" {
insmod ext2
search --no-floppy --set=root --fs-uuid <UUID>
configfile /boot/grub/grub.cfg
}
if [ "${grub_platform}" = "pc" ]; then
# For Legacy BIOS systems
menuentry "Windows installation (Legacy BIOS mode)" {
insmod exfat
insmod ntldr
search --no-floppy --set=root --fs-uuid $WindowsInstallUUID
ntldr /bootmgr
}
else
# For EFI systems
menuentry "Windows installation (EFI mode)" {
insmod exfat
insmod chain
search --no-floppy --set=root --fs-uuid $WindowsInstallUUID
chainloader /efi/boot/bootx64.efi
}
menuentry "rEFInd boot manager" {
search --no-floppy --set=root --fs-uuid $MainUUID
insmod chain
chainloader /EFI/BOOT/refindx64.efi
}
fi
menuentry "Android-x86 (64 bit version) - Disable secure boot" {
insmod ext2
search --no-floppy --set=root --fs-uuid <UUID>
configfile /boot/grub/grub.cfg
}
menuentry "Linux and Windows Rescue USB (Rescatux) - DANGEROUS - be careful" {
insmod ext2
search --no-floppy --set=root --fs-uuid <UUID>
configfile /boot/grub/grub.cfg
}
submenu "Other Linux distros >>>>>>>>>>>" {
menuentry "Linux Mint MATE (good for low-spec devices)" {
insmod ext2
search --no-floppy --set=root --fs-uuid <UUID>
configfile /boot/grub/grub.cfg
}
menuentry " MX-19.4 kde x64 (March 31, 2021) - 10 min easy install - No secure boot" {
search --no-floppy --set=root --fs-uuid $MainUUID
linux /antiX/vmlinuz quiet splasht nosplash
initrd /antiX/initrd.gz
}
menuentry "MX Linux XFCE 32 bit - 10 min easy install - No secure boot" {
insmod ext2
search --no-floppy --set=root --fs-uuid <UUID>
configfile /boot/grub/grub.cfg
}
menuentry "Peppermint GNU/Linux (good for very low-spec devices) - 64bit" {
insmod ext2
search --no-floppy --set=root --fs-uuid <UUID>
configfile /boot/grub/grub.cfg
}
menuentry "Ubuntu MATE" {
insmod ext2
search --no-floppy --set=root --fs-uuid <UUID>
configfile /boot/grub/grub.cfg
}
submenu ">>> Advanced Options for MX-19.4 kde x64 <<<" {
menuentry " MX-19.4 kde x64 Customize Boot (text menus)" {
search --no-floppy --set=root --fs-uuid $MainUUID
linux /antiX/vmlinuz quiet splasht nosplash menus
initrd /antiX/initrd.gz
}
menuentry " MX-19.4 kde x64 Failsafe" {
search --no-floppy --set=root --fs-uuid $MainUUID
linux /antiX/vmlinuz quiet splasht nosplash nomodeset failsafe
initrd /antiX/initrd.gz
}
menuentry " MX-19.4 kde x64 (1024x768)" {
search --no-floppy --set=root --fs-uuid $MainUUID
linux /antiX/vmlinuz quiet splasht nosplash
initrd /antiX/initrd.gz
}
menuentry " Power Off" --hotkey=P {
halt
}
menuentry " Reboot" --hotkey=R {
reboot
}
if [ -f /boot/grub/theme/help.txt ]; then
menuentry " Help" --hotkey=H {
cat /boot/grub/theme/help.txt
echo -n "Press <Enter> to continue "
read xxx_help
}
fi
}
}
# load boot menus
#
if [ -f $prefix/config/bootmenu.cfg ]; then
source $prefix/config/bootmenu.cfg
fi

All set to boot......
But, the MX GRUB theme is not OK with chainloading Windows Installation media (distorted manufacturer logo in EFI systems).
So, I really need to use some other GRUB theme (something black and white, like LM's is preferred)
But, I don't know how to remove MX GRUB theme from my grub.cfg and /boot/grub/config/*.cfg without breaking anything and keeping MX boot rescue menus
Re: MX live USB GRUB boot rescue menu - standalone customized version
Posted: Tue Jul 06, 2021 2:57 am
by andrewjoseph
deleted
Re: MX live USB GRUB boot rescue menu - standalone customized version
Posted: Tue Jul 06, 2021 3:04 am
by Eadwine Rose
Don't bump topics please. People do have lives outside of this forum.
Re: MX live USB GRUB boot rescue menu - standalone customized version
Posted: Tue Jul 06, 2021 8:05 am
by dolphin_oracle
you probably just need to change the resolution, not the theme.
Re: MX live USB GRUB boot rescue menu - standalone customized version
Posted: Tue Jul 06, 2021 11:23 am
by andrewjoseph
@dolphin_oracle How can I change it ?
I want this USB to be used on any random machine coming to my friend's repair shop (will that require other steps?)
He is a Windows man who knows only GUI, and it would be good if everything works out of the box (on BIOS/EFI/SecureBoot etc.,)
Re: MX live USB GRUB boot rescue menu - standalone customized version
Posted: Tue Jul 06, 2021 11:50 am
by dolphin_oracle
andrewjoseph wrote: Tue Jul 06, 2021 11:23 am
@dolphin_oracle How can I change it ?
I want this USB to be used on any random machine coming to my friend's repair shop (will that require other steps?)
He is a Windows man who knows only GUI, and it would be good if everything works out of the box (on BIOS/EFI/SecureBoot etc.,)
the easiest way is to actually not use a theme, and unset the gfxmode option (comment it out).
we set the gfxmode option to something convenient for the grub theme.
Re: MX live USB GRUB boot rescue menu - standalone customized version
Posted: Tue Jul 06, 2021 12:06 pm
by andrewjoseph
I'm not so familiar in GRUB theming. Please forgive my ignorance.
the easiest way is to actually not use a theme, and unset the gfxmode option (comment it out).
Does that mean to comment out
Code: Select all
# set gfxmode=1024x768
# set gfxpayload="1440x960;1440x900;1368x912;1366x768;1280x800;1280x720;1280x1024;1200x800;1024x768;auto"
and no other changes ?
Re: MX live USB GRUB boot rescue menu - standalone customized version
Posted: Tue Jul 06, 2021 12:14 pm
by andrewjoseph
I would like the widest possible hardware support out of the box.
the easiest way is to actually not use a theme
How to do that ?
I see some theme-related things in /boot/grub/config/*.cfg
Any changes needed there ?
Can in use this in the starting of grub.cfg (from Linux Mint's grub.cfg), or is there a better option ?
Code: Select all
if loadfont /boot/grub/font.pf2 ; then
set gfxmode=auto
insmod efi_gop
insmod efi_uga
insmod gfxterm
terminal_output gfxterm
fi
set menu_color_normal=white/black
set menu_color_highlight=black/light-gray
Anyway, I'm happy that the developer himself answers my questions.
Thank you for making the best live USB ever.
Re: MX live USB GRUB boot rescue menu - standalone customized version
Posted: Tue Jul 06, 2021 12:22 pm
by nXecure
rename the theme folder (/boot/grub/theme/) to something else (like theme-backup) and that should be enough. then it will be a very plain grub live boot.
Re: MX live USB GRUB boot rescue menu - standalone customized version
Posted: Tue Jul 06, 2021 12:33 pm
by andrewjoseph
nXecure wrote: Tue Jul 06, 2021 12:22 pm
rename the theme folder (/boot/grub/theme/) to something else (like theme-backup) and that should be enough. then it will be a very plain grub live boot.
Will that break anything ? (especially, the boot rescue menus shouldn't lose functionality)
the easiest way is to actually not use a theme
And will it have maximum out of the box hardware support (without any modifications for specific hardware) ?
Re: MX live USB GRUB boot rescue menu - standalone customized version
Posted: Tue Jul 06, 2021 12:45 pm
by nXecure
andrewjoseph wrote: Tue Jul 06, 2021 12:33 pm
nXecure wrote: Tue Jul 06, 2021 12:22 pm
rename the theme folder (/boot/grub/theme/) to something else (like theme-backup) and that should be enough. then it will be a very plain grub live boot.
Will that break anything ? (especially, the boot rescue menus shouldn't lose functionality)
It doesn't break the boot menus or the options functionality. All grub references to any file in the theme don't work, so it renders in the undecorated mode.
Experiment! Try things, write down what you have changed and if it doesn't work, revert the changes back again. Learning is getting your hands dirty.
Re: MX live USB GRUB boot rescue menu - standalone customized version
Posted: Tue Jul 06, 2021 12:57 pm
by fehlix
andrewjoseph wrote: Tue Jul 06, 2021 11:23 am
I want this USB to be used on any random machine coming to my friend's repair shop (will that require other steps?)
He is a Windows man who knows only GUI, and it would be good if everything works out of the box (on BIOS/EFI/SecureBoot etc.,)
Not sure what this thread is about. Suggest to use MX/antiX LiveUSB Boot Rescue feature, which might do what you want to use it for: Find any attached EFI-/legacy grub loader/grub menus +plus WinOS loader and boot into.
Re: MX live USB GRUB boot rescue menu - standalone customized version
Posted: Tue Jul 06, 2021 1:07 pm
by andrewjoseph
fehlix wrote: Tue Jul 06, 2021 12:57 pm
andrewjoseph wrote: Tue Jul 06, 2021 11:23 am
I want this USB to be used on any random machine coming to my friend's repair shop (will that require other steps?)
He is a Windows man who knows only GUI, and it would be good if everything works out of the box (on BIOS/EFI/SecureBoot etc.,)
Not sure what this thread is about. Suggest to use MX/antiX LiveUSB Boot Rescue feature, which might do what you want to use it for: Find any attached EFI-/legacy grub loader/grub menus +plus WinOS loader and boot into.
Sorry, I didn't understand.
If you're asking about using default MX GRUB menu, I have problems chainloading Windows installation media (on an exFAT partition) -- screen tearing on EFI with "secure boot" .
Re: MX live USB GRUB boot rescue menu - standalone customized version
Posted: Tue Jul 06, 2021 1:15 pm
by nXecure
Though the OP says:
andrewjoseph wrote: Tue Jul 06, 2021 1:05 am
2) Copy /EFI and /boot folders from LM ISO (good for secure boot)
I think they meant they were using the EFI and boot folder for MX (which also work on Secure Boot; no need for LM inferior boot options).
What I was referring to is to rename the theme folder for the MX /boot/grub/theme/, and not for LM grub stuff. The menus still work but they are "ugly".
OT: @fehlix, thanks for the new changes in the live grub boot on antiX 21. I am really enjoying all the new options without having to go manually type the boot parameters.
andrewjoseph wrote: Tue Jul 06, 2021 1:07 pm
If you're asking about using default MX GRUB menu, I have problems chainloading Windows installation media (on an exFAT partition) --
screen tearing on EFI with "secure boot" .
This is totally different from
andrewjoseph wrote: Tue Jul 06, 2021 1:05 am
But, the MX GRUB theme is not OK with chainloading Windows Installation media
(distorted manufacturer logo in EFI systems).
Comment out the line that dolphin_oracle mentioned for gfxmode and rename the theme. Try it out first.
Re: MX live USB GRUB boot rescue menu - standalone customized version
Posted: Tue Jul 06, 2021 1:32 pm
by nXecure
Just came back after a little experiment.
Tests performed on antiX Linux 19.3 Live USB (should be almost the same as MX Linux 19.X live USB)
Results: no "skewed" windows/EFI boot screen.
Steps:
0. No need to rename the mxlinux /boot/grub/theme/ folder.
1. Edit /boot/grub/grub.cfg. Comment out both
Code: Select all
#set gfxmode=1024x768
#set gfxpayload=[...]
2. Edit /boot/grub/config/defaults.cfg and comment out all gfxmode related entries:
Code: Select all
# gfxmode
#
#set default_gfxmode="1024x768"
#export default_gfxmode
#if [ -z "$gfxmode" ]; then
# set gfxmode="$default_gfxmode"
#fi
#export gfxmode
Unmount the USB device and reboot to see if the changes work on your system.
Less than 5 minutes experiment.
Re: MX live USB GRUB boot rescue menu - standalone customized version
Posted: Tue Jul 06, 2021 1:34 pm
by fehlix
andrewjoseph wrote: Tue Jul 06, 2021 1:07 pm
fehlix wrote: Tue Jul 06, 2021 12:57 pm
andrewjoseph wrote: Tue Jul 06, 2021 11:23 am
I want this USB to be used on any random machine coming to my friend's repair shop (will that require other steps?)
He is a Windows man who knows only GUI, and it would be good if everything works out of the box (on BIOS/EFI/SecureBoot etc.,)
Not sure what this thread is about. Suggest to use MX/antiX LiveUSB Boot Rescue feature, which might do what you want to use it for: Find any attached EFI-/legacy grub loader/grub menus +plus WinOS loader and boot into.
Sorry, I didn't understand.
If you're asking about using default MX GRUB menu, I have problems chainloading Windows installation media (on an exFAT partition) -- screen tearing on EFI with "secure boot" .
If you have fond something is not working with the MX/antiX Boot Rescue menus, you might consider to report the issue in detail in a dedicated thread. AFAIK, winOS install on exFAT is rather unusual, but exFAT booting is supported through the MX/antiX Boot Rescue menus. Haven't seen screen tearing so far. disabling efi-graphic stack might help.
Re: MX live USB GRUB boot rescue menu - standalone customized version
Posted: Tue Jul 06, 2021 1:39 pm
by andrewjoseph
@fehlix It's not an installed Windows, but an Installer ( I've extracted the Windows ISO to an exFAT partition )
I am using grub from Linux Mint ISO (that plays better with SecureBoot, especially GRUB modules)
My setup is detailed in the first post of this thread
https://forum.mxlinux.org/viewtopic.ph ... 3#p643063
Re: MX live USB GRUB boot rescue menu - standalone customized version
Posted: Tue Jul 06, 2021 2:06 pm
by andrewjoseph
nXecure wrote: Tue Jul 06, 2021 1:32 pm
Just came back after a little experiment.
Tests performed on antiX Linux 19.3 Live USB (should be almost the same as MX Linux 19.X live USB)
Results: no "skewed" windows/EFI boot screen.
Steps:
0. No need to rename the mxlinux /boot/grub/theme/ folder.
1. Edit /boot/grub/grub.cfg. Comment out both
Code: Select all
#set gfxmode=1024x768
#set gfxpayload=[...]
2. Edit /boot/grub/config/defaults.cfg and comment out all gfxmode related entries:
Code: Select all
# gfxmode
#
#set default_gfxmode="1024x768"
#export default_gfxmode
#if [ -z "$gfxmode" ]; then
# set gfxmode="$default_gfxmode"
#fi
#export gfxmode
Unmount the USB device and reboot to see if the changes work on your system.
Less than 5 minutes experiment.
Now, when loading the GRUB boot rescue menus, I get a syntax error from GRUB saying about a missing ' or so.
Re: MX live USB GRUB boot rescue menu - standalone customized version
Posted: Tue Jul 06, 2021 4:09 pm
by nXecure
I just created a live USB with MX Linux that works as you mentioned before, and the changes I mentioned worked flawlessly.
Steps:
1. Use Live USB Maker with a 32GBs USB device and MX Linux 19.4 x64. I selected to use only 20% and leave the rest FREE; and also (advanced options) selected to create a GPT partition table.
2. Use Gparted to create a 8GBs NTFS partition for Windows 10, and the rest for an ext4 partition to store other Linux/Android distros.

3. I had to boot into Windows because I couldn't extract the 5.6 GBs Windows 10 ISO to the NTFS partition. Did it there (on the Windows system).
4. Edited the /boot/grub/grub.cfg file and /boot/grub/config/default.cfg files as described previously.
5. Rebooted. The MX Grub menus were taking up 100% of the screen and didn't look stretched (except for the background image).
6. Used Boot Rescue Menus to search for EFI entries. Found all my antiX EFI entries, and the installed Windows EFI entry. But also found the efibootmgr file for the NTFS W10 installer partition I created in step 2 and 3,
7. Selected this W10 EFI installer and got the screen with the windows circle progress animation not stretched and in the correct 16:9 proportions.
8. I finally got the Windows Installer to show up. Cancelled and exited the Installer screen and rebooted to my antiX installation to write this.
So, it works. The error you experienced may be already there before you edited anything or some other change you haven't explained yet.
If you need more proof I will record it with my phone and publish it on Youtube, but I cannot do this right now.
PS: I will also report something on the
MX bug tracker related to the grub.cfg which I already
reported on antiX, and thought was also fixed on the MX grub boot configuration.
Re: MX live USB GRUB boot rescue menu - standalone customized version
Posted: Tue Jul 06, 2021 4:45 pm
by fehlix
nXecure wrote: Tue Jul 06, 2021 4:09 pm
PS: I will also report something on the MX bug tracker related to the grub.cfg which I already reported on antiX, and thought was also fixed on the MX grub boot configuration.
Would you mind to post the link to the mentioned report on antiX forum.
Thanks
Re: MX live USB GRUB boot rescue menu - standalone customized version
Posted: Tue Jul 06, 2021 5:18 pm
by nXecure
fehlix wrote: Tue Jul 06, 2021 4:45 pm
Would you mind to post the link to the mentioned report on antiX forum.
Bug report, and
antiX report (the only one I found was for bullseye alpha in January, and not for 19.X, sorry for the misleading answer).
Also modified my previous reply.
Sorry for hijacking the thread.
Re: MX live USB GRUB boot rescue menu - standalone customized version
Posted: Tue Jul 06, 2021 5:34 pm
by fehlix
nXecure wrote: Tue Jul 06, 2021 5:18 pm
fehlix wrote: Tue Jul 06, 2021 4:45 pm
Would you mind to post the link to the mentioned report on antiX forum.
Bug report, and
antiX report (the only one I found was for bullseye alpha in January, and not for 19.X, sorry for the misleading answer).
Also modified my previous reply.
Sorry for hijacking the thread.
Thanks. Seems I missed the report on then antiX forum.
Re: MX live USB GRUB boot rescue menu - standalone customized version
Posted: Wed Jul 07, 2021 2:13 am
by andrewjoseph
Suggest to use MX/antiX LiveUSB Boot Rescue feature, which might do what you want to use it for: Find any attached EFI-/legacy grub loader/grub menus +plus WinOS loader and boot into.
@fehlix I have dd'ed MX 19.4 , and enabled secure boot . Then, boot rescue menus can't detect any EFI bootloader. (it just shows "***Secure Boot Restrictions***" and no bootloaders detected)
But, my customized version (using LM's grub and modules) can detect EFI bootloaders (it just shows some secure boot errors, but they can be ignored)
Also the MX exfat GRUB module shows "Secure boot forbids loading ........." error, and can't detect exfat partitions (I decided to switch to NTFS)
I think that is because some MX GRUB modules aren't signed for "secure boot" , while LM's GRUB modules are signed.
Re: MX live USB GRUB boot rescue menu - standalone customized version
Posted: Wed Jul 07, 2021 2:15 am
by andrewjoseph
In short, with "secure boot" on, MX boot rescue menus don't work at all to find EFI bootloaders .
Re: MX live USB GRUB boot rescue menu - standalone customized version
Posted: Wed Jul 07, 2021 5:37 am
by fehlix
andrewjoseph wrote: Wed Jul 07, 2021 2:13 am
(using LM's grub and modules) can detect EFI bootloaders
The displayed secure boot warning message indicates the restrictions, b/c EFI loader won't normally be loaded directly with enabled secureboot. It may have shown the found Grub EFI load but I'm afraid, they won't load.
From which Linux Mint ISO (version) did you extract the grub-modules?
Re: MX live USB GRUB boot rescue menu - standalone customized version
Posted: Wed Jul 07, 2021 10:55 am
by andrewjoseph
@fehlix Linux Mint 20.1 Cinnamon (sha256sum: 14f73c93f75e873f4ac70b6cddc83703755c2421135a8fbbfd6ccfeed107e971)
Remove everything related to themes (and gfxmode) from /boot/grub/config/*.cfg >> rename /boot/grub/config/theme.cfg >> rename /boot/grub/theme (as
@nXecure said) >> replace starting of grub.cfg lines with starting of LM's grub.cfg (
https://forum.mxlinux.org/viewtopic.ph ... 5#p643145 ) >> Copy LM's /boot/grub/x86_64-efi (replacing MX GRUB modules with LM ones whenever possible) >> Replace /EFI/* with LM's /EFI/*
Now, Enable secure boot in EFI firmware settings >> go to boot rescue menus >> Find EFI bootloaders >> Gives a lot of errors (secure boot forbids loading .... ), but just press Enter >> Happily boot detected EFI bootloader
