Arch doesn’t have standard hooks for grub. Unless you install the hooks yourself, grub-mkconfig doesn’t get run.
Ah ok! I remember doing this manually in the past, got it.
if i did a clean install now, would the problem still be there? just asking
If you do an offline install, yes.
If you do an online install, no.
OK, maybe I’m missing something here, but if I remove grub-tools
, update the grub
package, and then run sudo grub-mkconfig -o /boot/grub/grub.cfg
to regenerate the grub.cfg, I can boot the machine just fine. I’ve done it 4 times in a row now, with fresh (cloned) VMs.
After this, the machine boots:
And, for the record, I have not advocated removing grub-tools
as a “solution” - I’m just reporting the results from experimenting in VMs.
I booted my EndeavourOS ISO then mounted and arch-chrooted into my hard drive where EOS was installed, then I was able to run timeshift from there.
I can reproduce this issue 100% of the time in a pure Arch VM.
That being said, I have some questions:
- What version of grub were you using when you ran
grub-install
initially? - Have you verified that the VM is a UEFI machine?
The version on the Artemis Neo ISO, grub 2:2.06.r261.g2f4430cc0-1
. Good point, there was a version after that (grub 2:2.06.r297.g0c6c1aff2-1
), I should have updated to that version first. I can try it with that version after lunch.
Ok so, maybe the thing to try next is…
Boot into your VM UEFI system without grub-tools. (and latest grub of course)
Install grub-tools
run ‘grub-mkconfig -o /boot/grub/grub.cfg’
Then run grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=EndeavourOS-grub
and see if it can reboot with grub-tools installed.
If you run grub-install afterwards, it will boot fine.
I just replicated your test. It results in failure for me. Here is the full output:
[dalto@dalto-vmware71 ~]$ pacman -Qi grub
Name : grub
Version : 2:2.06.r261.g2f4430cc0-1
Description : GNU GRand Unified Bootloader (2)
Architecture : x86_64
URL : https://www.gnu.org/software/grub/
Licenses : GPL3
Groups : None
Provides : grub-common grub-bios grub-emu grub-efi-x86_64
Depends On : sh xz gettext device-mapper
Optional Deps : freetype2: For grub-mkfont usage [installed]
fuse2: For grub-mount usage [installed]
dosfstools: For grub-mkrescue FAT FS and EFI support [installed]
lzop: For grub-mkrescue LZO support
efibootmgr: For grub-install EFI support [installed]
libisoburn: Provides xorriso for generating grub rescue iso using grub-mkrescue
os-prober: To detect other OSes when generating grub.cfg in BIOS systems
[installed]
mtools: For grub-mkrescue FAT FS support [installed]
Required By : grub-tools grub2-theme-endeavouros
Optional For : None
Conflicts With : grub-common grub-bios grub-emu grub-efi-x86_64 grub-legacy
Replaces : grub-common grub-bios grub-emu grub-efi-x86_64
Installed Size : 32.88 MiB
Packager : Christian Hesse <eworm@archlinux.org>
Build Date : Wed 08 Jun 2022 08:46:04 AM CDT
Install Date : Fri 05 Aug 2022 02:22:33 AM CDT
Install Reason : Explicitly installed
Install Script : Yes
Validated By : Signature
[dalto@dalto-vmware71 ~]$ yay -Rc grub-tools
checking dependencies...
Package (1) Old Version Net Change
grub-tools 1.6.9-2 -0.01 MiB
Total Removed Size: 0.01 MiB
:: Do you want to remove these packages? [Y/n] y
:: Processing package changes...
(1/1) removing grub-tools [--------------------------------] 100%
:: Running post-transaction hooks...
(1/1) Arming ConditionNeedsUpdate...
[dalto@dalto-vmware71 ~]$ yay -S grub
resolving dependencies...
looking for conflicting packages...
Package (1) Old Version New Version Net Change Download Size
core/grub 2:2.06.r261.g2f4430cc0-1 2:2.06.r322.gd9b4638c5-1 0.14 MiB 6.78 MiB
Total Download Size: 6.78 MiB
Total Installed Size: 33.02 MiB
Net Upgrade Size: 0.14 MiB
:: Proceed with installation? [Y/n]
:: Retrieving packages...
grub-2:2.06.r322.gd9b4638c5-1-x86_64 6.8 MiB 590 KiB/s 00:12 [------------------------------------------------------------------------------------------------------------] 100%
(1/1) checking keys in keyring [------------------------------------------------------------------------------------------------------------] 100%
(1/1) checking package integrity [------------------------------------------------------------------------------------------------------------] 100%
(1/1) loading package files [------------------------------------------------------------------------------------------------------------] 100%
(1/1) checking for file conflicts [------------------------------------------------------------------------------------------------------------] 100%
:: Processing package changes...
(1/1) upgrading grub [------------------------------------------------------------------------------------------------------------] 100%
:: Running post-transaction hooks...
(1/3) Arming ConditionNeedsUpdate...
(2/3) Checking which packages need to be rebuilt
(3/3) Updating the info directory file...
[dalto@dalto-vmware71 ~]$ sudo grub-mkconfig -o /boot/grub/grub.cfg
Generating grub configuration file ...
Found theme: /boot/grub/themes/EndeavourOS/theme.txt
Found linux image: /boot/vmlinuz-linux
Found initrd image: /boot/amd-ucode.img /boot/initramfs-linux.img
Found fallback initrd image(s) in /boot: amd-ucode.img initramfs-linux-fallback.img
Warning: os-prober will be executed to detect other bootable partitions.
Its output will be used to detect bootable binaries on them and create new boot entries.
Adding boot menu entry for UEFI Firmware Settings ...
done
No grub-tools, same results.
I tried that before and got put put into grub_rescue mode with a “grub_debug_malloc not found” error message.
I couldn’t reproduce your results. The steps I took
- EndeavourOS Artemis Neo Offline install
- After install, remove
grub-tools
- Update system (including
grub
) - run
sudo grub-mkconfig -o /boot/grub/grub.cfg
- Reboot
Here is the result:
Conclusion: It’s not a grub-tools issue
These steps worked for me, for the most part. These are some things I also did since it didn’t work without doing so:
- I didn’t do the line:
sudo mount -o subvol=@home /dev/sdaX /mnt/home
because it always failed anyway. - After downgrading grub, I also did these two things:
sudo grub-mkconfig -o /boot/grub/grub.cfg
and
sudo grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=EndeavourOS-grub
Those last two may be specific to me, but if the original steps don’t work, try them. Or do them anyway since it certainly won’t hurt.
PS: I’m now considering switching to a hybrid rolling setup where core stuff (like grub, linux kernels, etc.) get updated once a month and everything else gets updated daily.
I see you pacman.conf
I found the solution for my issue with Grub! I use a different boot efi!
How I found out.
After toying around, removing (hopefully) Grub Customizer, I local booted via Ventroy, since I forgot the USB in. I noticed I didn’t use EndeavourOS-Grub, but boot/bootx64.efi ??
So I did the following:
[swebow@swebow-xmgcoreczne21 ~]$ sudo grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=boot
Now latest grub boots, and now I can even update my grub.cfg file?
So if you are unsure, boot Ventoy USB and do “Local boot” and I got to pick which EFI to boot and then I saw it.
[dalto@dalto-vmware71 ~]$ yay -S grub
resolving dependencies...
looking for conflicting packages...
Package (1) Old Version New Version Net Change Download Size
core/grub 2:2.06.r261.g2f4430cc0-1 2:2.06.r322.gd9b4638c5-1 0.14 MiB 6.78 MiB
Total Download Size: 6.78 MiB
Total Installed Size: 33.02 MiB
Net Upgrade Size: 0.14 MiB
:: Proceed with installation? [Y/n]
:: Retrieving packages...
grub-2:2.06.r322.gd9b4638c5-1-x86_64 6.8 MiB 3.78 MiB/s 00:02 [------------------------------------------------------------------------------------------------------------] 100%
(1/1) checking keys in keyring [------------------------------------------------------------------------------------------------------------] 100%
(1/1) checking package integrity [------------------------------------------------------------------------------------------------------------] 100%
(1/1) loading package files [------------------------------------------------------------------------------------------------------------] 100%
(1/1) checking for file conflicts [------------------------------------------------------------------------------------------------------------] 100%
:: Processing package changes...
(1/1) upgrading grub [------------------------------------------------------------------------------------------------------------] 100%
:: Running post-transaction hooks...
(1/4) Arming ConditionNeedsUpdate...
(2/4) Fix 'grub' and 'os-prober' after upgrading either of them.
===> INFO: grub-tools / grub-fix-initrd-generation:
===> INFO: /etc/grub.d/30_os-prober changed. See file /var/log/grub-fix-initrd-generation.log.
===> INFO: /etc/grub.d/10_linux changed. See file /var/log/grub-fix-initrd-generation.log.
Generating grub configuration file ...
Found theme: /boot/grub/themes/EndeavourOS/theme.txt
Found linux image: /boot/vmlinuz-linux
Found initrd image: /boot/amd-ucode.img /boot/initramfs-linux.img
Found fallback initrd image(s) in /boot: amd-ucode.img initramfs-linux-fallback.img
Warning: os-prober will be executed to detect other bootable partitions.
Its output will be used to detect bootable binaries on them and create new boot entries.
Adding boot menu entry for UEFI Firmware Settings ...
done
(3/4) Checking which packages need to be rebuilt
(4/4) Updating the info directory file...
[dalto@dalto-vmware71 ~]$ sudo grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=EOS
Installing for x86_64-efi platform.
Installation finished. No error reported.
Adding grub-install to the end makes it work. No problems.
Had the same issue! Check my solution!
Interesting. I’ve done this with, and without, grub-tools
installed multiple times now, starting from clones of 3 different offline installs, and the results are consistent here.
Well, sorry to have wasted everyone’s time. But I can assure you that I get the same results here every time. I don’t know why, but it’s 100% consistent for me.
For the record, these are the exact steps I took:
-
Offline install.
-
sudo pacman -Syu --ignore=grub
-
Make clones of the VM from this state. This has all packages updated except for the
grub
package.
I ended up cloning 3 different installs; all produced the same outcome for me.
And, just to double verify that the VMs are proper UEFI installs:
[staggerlee@eos-test ~]$ sudo efibootmgr
BootCurrent: 0004
Timeout: 0 seconds
BootOrder: 0004,0000,0001,0002,0003
Boot0000* UiApp FvVol(7cb8bdc9-f8eb-4f34-aaea-3ee4af6516a1)/FvFile(462caa21-7614-4503-836e-8ab6f4662331)
Boot0001* UEFI VBOX CD-ROM VB2-01700376 PciRoot(0x0)/Pci(0x1,0x1)/Ata(1,0,0){auto_created_boot_option}
Boot0002* UEFI VBOX HARDDISK VBe47908eb-f21d1762 PciRoot(0x0)/Pci(0xd,0x0)/Sata(0,65535,0){auto_created_boot_option}
Boot0003* EFI Internal Shell FvVol(7cb8bdc9-f8eb-4f34-aaea-3ee4af6516a1)/FvFile(7c04a583-9e3e-4f1c-ad65-e05268d0b4d1)
Boot0004* endeavouros-3287 HD(1,GPT,b373d150-40e8-2242-bd17-d219e4567e56,0x1000,0x96000)/File(\EFI\endeavouros-3287\grubx64.efi)
Again, sorry for wasting your time. I don’t know why I’m getting different results here.
After going through removing grub-tools and updating i didn’t have any issues updating and booting. But, as soon as i run the grub update command it boots directly into UEFI.
I still don’t know what needs to be done to stop it from happening again?
run grub-install.