Recovering grub settings form file thats in use by grub.

Hello,
My problem is that my grub settings are corrupted (probably because i was using grub-customizer) and command update-grub show errors and dont save changes. But my actual grub.cfg file is fine and i want to keep it as it is. Is there any way to dont change actual used settings (grub.cfg file) but make command grub-update working again?

This is a result of update-grub command:

Generating grub configuration file ...
Found theme: /boot/grub/themes/starfield/theme.txt
Found linux image: /boot/vmlinuz-5.4-x86_64
Found initrd image: /boot/intel-ucode.img /boot/initramfs-5.4-x86_64.img
Found initrd fallback image: /boot/initramfs-5.4-x86_64-fallback.img
Found Windows 10 on /dev/sda1
Found linux image: /boot/vmlinuz-5.4-x86_64
Found initrd image: /boot/intel-ucode.img /boot/initramfs-5.4-x86_64.img
Found initrd fallback image: /boot/initramfs-5.4-x86_64-fallback.img
Found Windows 10 on /dev/sda1
Found memtest86+ image: /boot/memtest86+/memtest.bin
Found memtest86+ image: /boot/memtest86+/memtest.bin
błąd: syntax error.
błąd: Incorrect command.
błąd: syntax error.
Błąd składni w linii 199
Syntax errors are detected in generated GRUB config file.
Ensure that there are no errors in /etc/default/grub
and /etc/grub.d/* files or please file a bug report with
/boot/grub/grub.cfg.new file attached.

Please have a look at the following solution from @gohlip:

Change sda to adapt to your proper setup.

4 Likes

Thanks, i think it works. Its clear and i lost my settings but thats ok.

1 Like

Great! Good that it worked out!

All credit goes to @gohlip (非常谢谢)from whom I have been learning a lot (still am) when it comes to Grub, booting, installation etc.

What settings?

1 Like

Only things like custom theme, background. I was trying to save them but in that way i learned something new by doing this myself manually, so its not a big deal.

1 Like

If you're saying the 'grub theme' settings is lost, meaning you've lost the nicer grub menu, see this post and change in /etc/default/grub to

GRUB_TERMINAL_OUTPUT=gfxterm
GRUB_GFXMODE=1024x768x32
GRUB_GFXPAYLOAD_LINUX=1024x768x32
GRUB_THEME="/usr/share/grub/themes/manjaro/theme.txt"

As in that post, first check there is a directory in /usr/share/grub/themes/manjaro/
Don't forget to 'update-grub' after changes.

But yes, grub thingies should be in /boot/grub/~ not /usr/share/grub/~
We used Fedora way to make things hidden/complicated/messed up.
Luckily, we've not used initrdefi or linux16 in our grub commands.
Or /boot/efi/grub.cfg or /boot/efi/grub2/grub.cfg or... :face_with_thermometer:

1 Like

I looked into grub file on my pc and I figure out how to import theme by myself but thanks anyway. I will add the rest of this lines just to make it better.

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

Forum kindly sponsored by