I somehow messed my grub config hard enough to where grub-mkconfig runs multiple times

So some context, i did the terrible thing of using grub-customizer once… being unaware it broke grub severly.

Just now i tried to change some grub config settings and noticed that it failed. Leading my realise that grub customizer is a piece of shit and corrupted my grub.d stuff

I managed to restore a version where i can get it to build the grub again. However i seems to run OS discovery multiple times (and snapper snapshots for grub)

Generating grub configuration file ...
Found background: /usr/share/endeavouros/splash.png
Found linux image: /boot/vmlinuz-linux-zen
Found initrd image: /boot/amd-ucode.img /boot/initramfs-linux-zen.img
Found fallback initrd image(s) in /boot:  amd-ucode.img initramfs-linux-zen-fallback.img
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
Adding boot menu entry for UEFI Firmware Settings ...
Found linux image: /boot/vmlinuz-linux-zen
Found initrd image: /boot/amd-ucode.img /boot/initramfs-linux-zen.img
Found fallback initrd image(s) in /boot:  amd-ucode.img initramfs-linux-zen-fallback.img
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
Detecting snapshots ...
Found snapshot: 2024-02-11 22:30:23 | @/.snapshots/59/snapshot | post | kio-admin                                                                |
Found snapshot: 2024-02-11 22:30:23 | @/.snapshots/58/snapshot | pre  | pacman -S kio-admin                                                      |
Found snapshot: 2024-02-11 22:27:47 | @/.snapshots/57/snapshot | post | snapper-support                                                          |
Found snapshot: 2024-02-11 22:27:46 | @/.snapshots/56/snapshot | pre  | pacman -U --config /etc/pacman.conf -- /home/vasilis/.cache/yay/snapper- |
Found snapshot: 2024-02-11 22:25:59 | @/.snapshots/55/snapshot | post | snapper-support                                                          |
Found snapshot: 2024-02-11 22:25:58 | @/.snapshots/54/snapshot | pre  | pacman -U --config /etc/pacman.conf -- /home/vasilis/.cache/yay/snapper- |
Found snapshot: 2024-02-11 22:24:19 | @/.snapshots/53/snapshot | post | attica5 baloo5 bluez-qt5 breeze-icons btop ell frameworkintegration5 git |
Found snapshot: 2024-02-11 22:24:10 | @/.snapshots/52/snapshot | pre  | pacman -Syu grub                                                         |
Found snapshot: 2024-02-11 22:22:49 | @/.snapshots/51/snapshot | post | grub-customizer                                                          |
Found snapshot: 2024-02-11 22:22:49 | @/.snapshots/50/snapshot | pre  | pacman -R grub-customizer                                                |
Found 10 snapshot(s)
Unmount /tmp/grub-btrfs.ps2aXdYJL3 .. Success
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.
Found Windows Boot Manager on /dev/nvme0n1p3@/efi/Microsoft/Boot/bootmgfw.efi
Adding boot menu entry for UEFI Firmware Settings ...
Detecting snapshots ...
Found snapshot: 2024-02-11 22:30:23 | @/.snapshots/59/snapshot | post | kio-admin                                                                |
Found snapshot: 2024-02-11 22:30:23 | @/.snapshots/58/snapshot | pre  | pacman -S kio-admin                                                      |
Found snapshot: 2024-02-11 22:27:47 | @/.snapshots/57/snapshot | post | snapper-support                                                          |
Found snapshot: 2024-02-11 22:27:46 | @/.snapshots/56/snapshot | pre  | pacman -U --config /etc/pacman.conf -- /home/vasilis/.cache/yay/snapper- |
Found snapshot: 2024-02-11 22:25:59 | @/.snapshots/55/snapshot | post | snapper-support                                                          |
Found snapshot: 2024-02-11 22:25:58 | @/.snapshots/54/snapshot | pre  | pacman -U --config /etc/pacman.conf -- /home/vasilis/.cache/yay/snapper- |
Found snapshot: 2024-02-11 22:24:19 | @/.snapshots/53/snapshot | post | attica5 baloo5 bluez-qt5 breeze-icons btop ell frameworkintegration5 git |
Found snapshot: 2024-02-11 22:24:10 | @/.snapshots/52/snapshot | pre  | pacman -Syu grub                                                         |
Found snapshot: 2024-02-11 22:22:49 | @/.snapshots/51/snapshot | post | grub-customizer                                                          |
Found snapshot: 2024-02-11 22:22:49 | @/.snapshots/50/snapshot | pre  | pacman -R grub-customizer                                                |
Found 10 snapshot(s)
Unmount /tmp/grub-btrfs.RA6XYAvJ36 .. Success
done

I spent a lot of time trying to find out why its happening but this grub stuff is overwelming and getting dupe entries is the only way i can have a working system otherwise. Does anyone know what i should try doing next? I can send the entries if needed or anything else i really dont know what to provide in this situation

Im willing to get this regenerated or whatever if someone tells me

thank you

For context, i can boot into my os just fine and be make config changes and stuff. Its just the dupe entries

One could use an axe to chop some wood and chop off the leg on the attempt.
Would you blame the axe?

Now, try the following and see if you can restore your grub environment:

sudo mv /etc/grub.d /etc/grub.d.old
sudo pacman -S grub-btrfs

After that regenerate your grub.cfg.

1 Like

Thank you for that, it seemed to improve stuff however I can now only boot through snapshots. In the grub.d i only got the 41_snapchats-btrfs

Im assuming when you said to regen grub you meant with sudo grub-mkconfig -o /boot/grub/grub.cfg right?

Also i will take that quote as a compliment…

Yes. Did you run it? Any anomalies observed?

You are welcome!

Yeah, i can now only boot from the snapshots. No other entries appear. grub.d only has the snapshot script. Should i copy over some of the other scripts? Or is there a more proper way

also trying to run grub-mkconfig now results in /usr/bin/grub-probe: error: failed to get canonical path of `rootfs'. guessing i will need to go into a live rescue disk (booted into the snapshot right now)

Not sure. I have never “sanitized” a system after grub customizer when grub-btrfs has been used. Only with the regular grub.

Perhaps, you could start off the whole thing from scratch. That is, remove grub-btrfs and use just the regular grub to regenerate the grub.cfg. See if your kernels are found and added to the grub boot menu.
Then set up grub-btrfs fronm scratch again.

How do i regenerate the grub files though? That’s my main question. Just sudo grub-mkconfig -o /boot/grub/grub.cfg does not bring them back

That’s a problem. :thinking:

Let’s see if we can start from the scratch:

sudo pacman -R grub-btrfs

sudo pacman -S grub

Now run sudo grub-mkconfig -o /boot/grub/grub.cfg and post the whole output.

EDIT

Perhaps you are right about this.
I overlooked the fact that you are booted into a snapshot.

Are you familiar with how to chroot from the live usb?

Here is an article from our Wiki. Scroll down to the part for Btrfs filesystem:

https://discovery.endeavouros.com/system-rescue/arch-chroot/2022/12/

Yes, I am aware but thank you for linking it. Just took me a moment since btrfs does stuff differently :stuck_out_tongue:

However good news! I got my stuff back! Thank you so much for your help. I seem to have my snapshots and boot entries back without them being duped.

And thank you for roasting me

That’s great news (sigh of relief!). I am glad you could get back everything up and running!

And also welcome to EnOS’ community @Vasilis !

:enos: :handshake:t5:

1 Like

Thank you so much. And thanks for the quick answers too

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.