How does one recover from having used Grub Customizer?

Questions about Grub, UEFI,the liveCD and the installer
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
User avatar
jimallyn
Level 19
Level 19
Posts: 9075
Joined: Thu Jun 05, 2014 7:34 pm
Location: Wenatchee, WA USA

How does one recover from having used Grub Customizer?

Post by jimallyn »

When I first installed MInt on this machine, I installed Grub Customizer and made a few changes. Since then, I have learned (from others here on the forums) that it's not a good idea to use Grub Customizer, that it puts all kinds of extraneous junk in the Grub configuration files. Now I would like to add PLOP to my Grub menu, and following the instructions on the PLOP website doesn't seem to work for me. I'm assuming that's because of using Grub Customizer in the past. So, how do I undo all that Grub Customizer did? Should I uninstall/purge Grub, then reinstall and run grub-update?
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.
“If the government were coming for your TVs and cars, then you'd be upset. But, as it is, they're only coming for your sons.” - Daniel Berrigan
User avatar
Pierre
Level 21
Level 21
Posts: 13224
Joined: Fri Sep 05, 2008 5:33 am
Location: Perth, AU.

Re: How does one recover from having used Grub Customizer?

Post by Pierre »

that's probably the best way forward, - - remove the customizer & re-run Grub.

of of my PCs still has that thing installed, and I've yet to decide, to remove / keep it.
:mrgreen:
Image
Please edit your original post title to include [SOLVED] - when your problem is solved!
and DO LOOK at those Unanswered Topics - - you may be able to answer some!.
Faust

Re: How does one recover from having used Grub Customizer?

Post by Faust »

jimallyn wrote: So, how do I undo all that Grub Customizer did? Should I uninstall/purge Grub, then reinstall and run grub-update?
When I need to recover from boo-boos , I don't bother with purge ..... I just install Grub ( over-the-top , as it were ) then update
The config file gets written again ... works like Fairy Dust , but probably not " best practice " :)

Like BleachBit , GRUB customizer has a bit of a bad rep around here ( or a mixed one , to say the least )

On one aspect there is no disagreement , they are both easily capable of borking your system !
and they do not forgive mistakes .
I use both , and I like them ( and yes , I can achieve the same things from command line )
but I never recommend them to GNU/Linux newcomers .

As always back-ups are essential .
In addition to system backups ( which all users should be doing regularly anyway ) it's wise to backup the GRUB config file
before any attempt at editing it .

I think it's worth spending a while looking at that file , and the back-up copy .....
it doesn't take long to see exactly what has changed after using GRUB customizer .
chrisuk

Re: How does one recover from having used Grub Customizer?

Post by chrisuk »

Grub Customizer backs up the original config files when it's installed... have a look in /etc/grub.d/backup/ - especially have a read of RESTORE-INSTRUCTIONS there
Cosmo.
Level 24
Level 24
Posts: 22968
Joined: Sat Dec 06, 2014 7:34 am

Re: How does one recover from having used Grub Customizer?

Post by Cosmo. »

Interesting topic. For me not of practical meaning, but with academic interest.

What I would do is the following (besides removing Grub Customizer obviously):

1. Have a Super Grub 2 Disc ready, so that you can get back into your system if everything breaks.

2. Make backups of the following objects, so that you can easily restore at least to the current state:
/etc/grub.d
/etc/default/grub.d
/etc/default/grub

3. As far as I remember from experiments I did several years ago the critical changes that GC does are in the first mentioned folder. Also following my remembrance GC creates a copy of the original files in a subfolder on this place. Copy those backups back to their original places (overwriting their older instances as set b GC).

4. run sudo update-grub

Note: This should work from theory; I never did this myself. A common word says, that the devil lives in the details, so preparation against surprises is strongly recommended, at least step #1, #2 and at best also #5.

5. If I would be in the situation, I would do an additional step in preparation:
Create a virtual machine (same version of Mint) in VirtualBox. Install there GC. Do the above described step #3 and see what happens.
If you create in VB after each step (installation of Mint, installation of GC) a restore point you can revert every step at 100 %. This allows you to experiment without much work and - important - with the least risk for your physical install. You can further more compare the file /etc/default/grub in the several states and see, if you have to do manual changes inside after the reverting steps.

Additional tip: Install in your main system a tool like meld or diffuse, which allow to do file comparisons far more secure and comfortable. These tools may come handy also in other circumstances.
Faust

Re: How does one recover from having used Grub Customizer?

Post by Faust »

Cosmo. wrote:..... Have a Super Grub 2 Disc ready, so that you can get back into your system if everything breaks.....
Oh yes .
It's been living in my work tool-case for a long time now ..... and I never leave home without it 8)

And many thanks for the pointer to Meld !
Great stuff .... I've been after a good one of those doo-dads for a while .
I'm most grateful - :D
User avatar
Pjotr
Level 24
Level 24
Posts: 20126
Joined: Mon Mar 07, 2011 10:18 am
Location: The Netherlands (Holland) 🇳🇱
Contact:

Re: How does one recover from having used Grub Customizer?

Post by Pjotr »

Cosmo. wrote:Interesting topic. For me not of practical meaning, but with academic interest.
Good to see you back! :)

On topic: it would perhaps be useful to have a clear, easy and tested tutorial for removing Grub Customizer and re-creating the clean original situation. I have a rough, untested idea which might work:

1. Purge Grub Customizer (sudo apt-get purge);

2. Remove *all* folders and files to which GC has made changes (obviously, it would have to be researched carefully which files and folders those are);

3. Launch Synaptic Package Manager, search for Grub, and mark all installed packages for re-installation. Then perform the re-installation of those Grub packages.

But as said: untested, don't try this at home. It's just an expectation of an approach that might, hopefully, work.
Tip: 10 things to do after installing Linux Mint 21.3 Virginia
Keep your Linux Mint healthy: Avoid these 10 fatal mistakes
Twitter: twitter.com/easylinuxtips
All in all, horse sense simply makes sense.
User avatar
jimallyn
Level 19
Level 19
Posts: 9075
Joined: Thu Jun 05, 2014 7:34 pm
Location: Wenatchee, WA USA

Re: How does one recover from having used Grub Customizer?

Post by jimallyn »

Pjotr wrote:I have a rough, untested idea which might work: ...
That's approximately what I did, except I couldn't do step 2, as I have no idea what files GC modifies. There are still remnants of GC's work in there, but I have no idea where. There must be some command you can run to tell you what files have been changed? I could do another install on a bit of the free space in my hard drive, make a list of all files, install and run GC and make a few changes, then run the list files program again to see what has been changed. Hmmm, I have a computer here with a dead hard drive in it. Maybe I'll look through the junk box for another hard drive and do some experiments on that computer.
“If the government were coming for your TVs and cars, then you'd be upset. But, as it is, they're only coming for your sons.” - Daniel Berrigan
chrisuk

Re: How does one recover from having used Grub Customizer?

Post by chrisuk »

Maybe have a read here for a description from the developer, rather than guesses from others ;)

The info of interest to you:
The /etc/grub.d/proxifiedScripts and /etc/grub.d/bin folders, and any *_proxy files are only created if a Grub 2 script has to be modified. If only changes normally made to /etc/default/grub are invoked by Grub Customizer, the following won't be necessary.

To restore the normal Grub 2 control of the boot menu:

Remove the /etc/grub.d/bin folder
Move the contents of /etc/grub.d/proxifiedScritps back to the /etc/grub.d folder.
Any files moved back need to be renamed to the original name.
linux back to 10_linux, os-prober back to 30_os-prober, etc.
Remove the /etc/grub.d/proxifiedScipts folder once it is empty.
Check the settings in /etc/default/grub and make any desired changes (default kernel, timeout, etc).
Run "sudo update-grub".
User avatar
jimallyn
Level 19
Level 19
Posts: 9075
Joined: Thu Jun 05, 2014 7:34 pm
Location: Wenatchee, WA USA

Re: How does one recover from having used Grub Customizer?

Post by jimallyn »

I think my problem is somewhat complicated by the fact that I have used Grub Customizer more than once. So I can't restore to the original, I could only restore to the previous revision. (I think.) There must be some way to get back to a start-from-scratch grub, as if I had never used GC. I guess I will go read that FAQ again and think on it for a while.
“If the government were coming for your TVs and cars, then you'd be upset. But, as it is, they're only coming for your sons.” - Daniel Berrigan
User avatar
Pjotr
Level 24
Level 24
Posts: 20126
Joined: Mon Mar 07, 2011 10:18 am
Location: The Netherlands (Holland) 🇳🇱
Contact:

Re: How does one recover from having used Grub Customizer?

Post by Pjotr »

I just did a test, on my test machine (Linux Mint 18.3 Cinnamon) which hasn't been polluted by Grub Customizer:

1. First I backupped the existing Grub folders and files:

Code: Select all

sudo cp -v -R /etc/grub.d /etc/grub.d2

Code: Select all

sudo cp -v -R /etc/default/grub.d /etc/default/grub.d2

Code: Select all

sudo cp -v -R /etc/default/grub /etc/default/grub2
2. Then I deleted the Grub folders and files:

Code: Select all

sudo rm -v -R /etc/grub.d

Code: Select all

sudo rm -v -R /etc/default/grub.d

Code: Select all

sudo rm -v -R /etc/default/grub
3. Then I launched Synaptic, and let it search for "grub". In order to view the installed Grub packages on top, I clicked the "S" button. See the screenshot below (click on it to enlarge it):
Image

4. Then I marked each individual package for re-installation and applied that re-installation.

5. Then I checked in my file manager: all deleted Grub folders and files had been re-created automatically, and their contents seemed normal.

6. Then I rebooted. Reboot was completely normal.

It would seem, that my rough idea might work indeed on a system that has been tainted by Grub Customizer.
Tip: 10 things to do after installing Linux Mint 21.3 Virginia
Keep your Linux Mint healthy: Avoid these 10 fatal mistakes
Twitter: twitter.com/easylinuxtips
All in all, horse sense simply makes sense.
User avatar
jimallyn
Level 19
Level 19
Posts: 9075
Joined: Thu Jun 05, 2014 7:34 pm
Location: Wenatchee, WA USA

Re: How does one recover from having used Grub Customizer?

Post by jimallyn »

I did approximately what you suggested, Pjotr. But I still had some GC stuff in /boot/grub, and something else, I think. So, I looked around and decided what else I needed to do, did it and rebooted. Oops! It doesn't show the grub menu anymore, just boots straight to Mint using the 3.13 kernel. And when the desktop comes up, it looks like 640X480 resolution, and after a short period of time it freezes and I have to go to a virtual terminal to shutdown. I did take some notes, so I might be able to undo what I did. But while I was thinking about that, I decided to boot to the SuperGrub2 disc, and I was able to boot Mint up with the 4.4 kernel from there. And that's what I'm using at this moment. I'll probably just use it like this for a few days and decide what to do next. I have been thinking about moving from 17.3 Cinnamon to 18.2 XFCE anyway, so maybe now would be a good time to do that.

I was trying to figure out how to add PLOP to the grub menu for my brother, whose computer won't boot from USB. So I figured I'd work it out on my computer, then tell him how to do it. Another case of "no good deed goes unpunished!" It's a pretty safe bet that I won't be using Grub Customizer again any time soon.

I did some reading on what GC does and how it does it, and it seems to me they made it overly complicated, what with the proxy files and such.
“If the government were coming for your TVs and cars, then you'd be upset. But, as it is, they're only coming for your sons.” - Daniel Berrigan
User avatar
Moem
Level 22
Level 22
Posts: 16233
Joined: Tue Nov 17, 2015 9:14 am
Location: The Netherlands
Contact:

Re: How does one recover from having used Grub Customizer?

Post by Moem »

polluted
tainted
And then some people say that computer hobbyists are all rational, not emotional... :wink:
Image

If your issue is solved, kindly indicate that by editing the first post in the topic, and adding [SOLVED] to the title. Thanks!
User avatar
jimallyn
Level 19
Level 19
Posts: 9075
Joined: Thu Jun 05, 2014 7:34 pm
Location: Wenatchee, WA USA

Re: How does one recover from having used Grub Customizer?

Post by jimallyn »

Moem wrote:And then some people say that computer hobbyists are all rational, not emotional... :wink:
Clearly you don't fully understand the situation here. Considering the troubles I am having, and what I have read about how Grub Customizer works, I think that words like "polluted" and "tainted" are quite appropriate.
“If the government were coming for your TVs and cars, then you'd be upset. But, as it is, they're only coming for your sons.” - Daniel Berrigan
User avatar
Pjotr
Level 24
Level 24
Posts: 20126
Joined: Mon Mar 07, 2011 10:18 am
Location: The Netherlands (Holland) 🇳🇱
Contact:

Re: How does one recover from having used Grub Customizer?

Post by Pjotr »

Moem wrote:
polluted
tainted
And then some people say that computer hobbyists are all rational, not emotional... :wink:
As jimallyn says. Furthermore, I fail to see what this off-topic comment contributes to solving the problem of the OP.

Back on topic: I've tried to test my idea on my test rig (Linux Mint 18.3 Cinnamon), and it was a complete trainwreck. After installing Grub Customizer and applying some changes with it, my system became totally unbootable. :shock:

So I wasn't even able to start testing my idea. I was only able to make my system bootable again, by booting from the DVD, manually removing all the GC files I could find and re-installing Grub to the MBR.

Needless to say, this experience hasn't exactly changed my already low estimate of GC for the better.
Last edited by Pjotr on Sat Nov 25, 2017 6:35 am, edited 2 times in total.
Tip: 10 things to do after installing Linux Mint 21.3 Virginia
Keep your Linux Mint healthy: Avoid these 10 fatal mistakes
Twitter: twitter.com/easylinuxtips
All in all, horse sense simply makes sense.
User avatar
Moem
Level 22
Level 22
Posts: 16233
Joined: Tue Nov 17, 2015 9:14 am
Location: The Netherlands
Contact:

Re: How does one recover from having used Grub Customizer?

Post by Moem »

jimallyn wrote: I think that words like "polluted" and "tainted" are quite appropriate.
I'm not saying they're inaccurate. I'm just saying that they strike me as being pretty emotional in nature.
Image

If your issue is solved, kindly indicate that by editing the first post in the topic, and adding [SOLVED] to the title. Thanks!
User avatar
Pjotr
Level 24
Level 24
Posts: 20126
Joined: Mon Mar 07, 2011 10:18 am
Location: The Netherlands (Holland) 🇳🇱
Contact:

Re: How does one recover from having used Grub Customizer?

Post by Pjotr »

Moem wrote:I'm not saying they're inaccurate. I'm just saying that they strike me as being pretty emotional in nature.
Back on topic please? We're trying to solve a technical problem here.
Tip: 10 things to do after installing Linux Mint 21.3 Virginia
Keep your Linux Mint healthy: Avoid these 10 fatal mistakes
Twitter: twitter.com/easylinuxtips
All in all, horse sense simply makes sense.
Faust

Re: How does one recover from having used Grub Customizer?

Post by Faust »

@pjotr I was writing this when you replied the other day , but I'll post it now anyway -
pjotr wrote:Remove *all* folders and files to which GC has made changes
*all* ..... Yes , that's the big unknown as I see it .

@chrisuk - that list looks pretty comprehensive .... are you satisfied that no other files are involved ?

It appears to me that we need some reliable baselines here , to make any sort of progress on this .
So , on a system that has never been "tainted " by Grub Customizer , what files are created by Grub alone ?
and what do those files contain ?

This would be an interesting little project :-

Create a fresh install of the chosen Mint OS version ( in a VM or on a USB )
Install Grub Customizer and note which files are " touched " or created ( search by date/time created , or modified )
Run Grub Customizer and dick around with some settings ; save and exit .
Then run that same file search again .
It should be easy to pick up all of the changes using one of the various file comparison tools ( or not ? )

If you can see a flaw in this plan , then please say so
.... it's possible that different Mint versions handle this issue in different ways , but I seriously doubt it .

I'll try to get this done over the weekend , but don't anybody hold their breath :)
The weather decides everything !
:P
Minterator

Re: How does one recover from having used Grub Customizer?

Post by Minterator »

jimallyn wrote:I did approximately what you suggested, Pjotr. But I still had some GC stuff in /boot/grub, and something else, I think. So, I looked around and decided what else I needed to do, did it and rebooted. Oops! It doesn't show the grub menu anymore, just boots straight to Mint using the 3.13 kernel. And when the desktop comes up, it looks like 640X480 resolution, and after a short period of time it freezes and I have to go to a virtual terminal to shutdown. I did take some notes, so I might be able to undo what I did. But while I was thinking about that, I decided to boot to the SuperGrub2 disc, and I was able to boot Mint up with the 4.4 kernel from there. And that's what I'm using at this moment. I'll probably just use it like this for a few days and decide what to do next. I have been thinking about moving from 17.3 Cinnamon to 18.2 XFCE anyway, so maybe now would be a good time to do that.

I was trying to figure out how to add PLOP to the grub menu for my brother, whose computer won't boot from USB. So I figured I'd work it out on my computer, then tell him how to do it. Another case of "no good deed goes unpunished!" It's a pretty safe bet that I won't be using Grub Customizer again any time soon.

I did some reading on what GC does and how it does it, and it seems to me they made it overly complicated, what with the proxy files and such.

I've used grub-customizer countless times without any problem, what makes you think it is causing a problem? Did you use the "Edit" feature? If you have more than one bootable partition you should use the "Change Environment" command.
User avatar
jimallyn
Level 19
Level 19
Posts: 9075
Joined: Thu Jun 05, 2014 7:34 pm
Location: Wenatchee, WA USA

Re: How does one recover from having used Grub Customizer?

Post by jimallyn »

Minterator wrote:what makes you think it is causing a problem?
Go back and read the rest of this thread. When you are done with that, then search the forums for 'grub customizer.'
“If the government were coming for your TVs and cars, then you'd be upset. But, as it is, they're only coming for your sons.” - Daniel Berrigan
Locked

Return to “Installation & Boot”