Restoring The GRUB.cfg
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
- MoonJumper
- Level 2
- Posts: 78
- Joined: Mon Jan 28, 2019 1:05 pm
- Location: Aberdeen, Scotland
Restoring The GRUB.cfg
Hello Forum, What is the best way to make a back up copy of the, "GRUB.cfg"file and how would that copy be reinstated should the need arise? MoonJumper.
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Re: Restoring The GRUB.cfg
grub.cfg is a generated file. You can simply run
sudo update-grub
to re-generate it. You should generally not be editing grub.cfg manually but instead edit your /etc/default/grub and run the update-grub afterwards. What need do you have to manually edit it?- MoonJumper
- Level 2
- Posts: 78
- Joined: Mon Jan 28, 2019 1:05 pm
- Location: Aberdeen, Scotland
Re: Restoring The GRUB.cfg
Many thanks for your reply xenopeek, yes I know that the grub.cfg file is not meant to be edited directly. I have two separate drives, both dual boot, Mint 19.2 an XP, not connected at the same time. Both had the same broken links showing at boot up on the Grub menu. On the first drive I successfully deleted the broken link by editing out that link, by copying the menu entries from the grub.cfg file, omitting the entry for the broken link. Then pasting those menu entries into the etc/grub.d/40_custom, file, saving it and then updating grub. However on my second drive with the same broken link, doing the same procedure, the link still shows on the grub menu at boot up. All guidance appreciated as to solving this issue on my second drive set up. MoonJumper.
Re: Restoring The GRUB.cfg
No need to modify that /boot/grub/grub.cfg file as it is said. If broken links means GRUB menu entries that are not working (not for Mint installed on that drive but for other systems as Windows XP), you will need to create 40_custom file with right menu entries as you did and also avoid grub to create them again .
From terminal edit /etc/default/grub (
Do not forget to run sudo nano /etc/default/grub
) and add this lineSave grub file (press Ctrl+O and then Enter) and close editor (Ctrl+X).GRUB_DISABLE_OS_PROBER=true
sudo update-grub
. Maybe you just forgot it last time.
Also If errors on creating 40_custom entries, a new grub.cfg file would not be created and the old one preserved but you would see warnings/errors on terminal...
In that case, or if GRUB menu remains the same, post back following codes result and confirm you have not installed Grub Customizer
Also If errors on creating 40_custom entries, a new grub.cfg file would not be created and the old one preserved but you would see warnings/errors on terminal...
In that case, or if GRUB menu remains the same, post back following codes result and confirm you have not installed Grub Customizer
Code: Select all
cat /etc/default/grub
cat /etc/grub.d/40_custom
Arrieritos semos y en el camino nos encontraremos.
- MoonJumper
- Level 2
- Posts: 78
- Joined: Mon Jan 28, 2019 1:05 pm
- Location: Aberdeen, Scotland
Re: Restoring The GRUB.cfg
Hello Jo-con-Ël, Many thanks for your guidance. What will adding this line - GRUB_DISABLE_OS_PROBER=true - Do? I thought that OS_ PROBER detects Windows OS's such as XP and Win 7! No, I have not installed Grub Customizer. Best regards, MoonJumper.
Re: Restoring The GRUB.cfg
Yes, that line prevent scanning other systems, i.e. 30_os-prober wont be executed when running
40_custom will be executed in the same way, so once you have created custom menu entries with right "links" to Windows 7 and XP you don't need grub scan for those systems. In other case, without that line, update-grub would restore wrong "links" and duplicate right ones on menu.
sudo update-grub
.40_custom will be executed in the same way, so once you have created custom menu entries with right "links" to Windows 7 and XP you don't need grub scan for those systems. In other case, without that line, update-grub would restore wrong "links" and duplicate right ones on menu.
Last edited by Jo-con-Ël on Mon Jul 04, 2022 2:04 am, edited 1 time in total.
Arrieritos semos y en el camino nos encontraremos.
Re: Restoring The GRUB.cfg
timeshift will keep a backup of your system, provided you don't let timeshift do automated snapshot which will add up to less hard drive space.
other than that what i do is rightclick /boot folder as Root and then rightclick on /boot/grub/grub.cfg and Compress
when your system borks, you can boot live mint or any distro, and decompress it as Root again
other than that what i do is rightclick /boot folder as Root and then rightclick on /boot/grub/grub.cfg and Compress
when your system borks, you can boot live mint or any distro, and decompress it as Root again