Grub 2 Madness

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.
Locked
viking777

Grub 2 Madness

Post by viking777 »

Ever wanted to alter the title of one of your grub entries?

Or perhaps remove one that isn't correct?

Well from now on this is how you are going to have to do it:
Building a Totally Customized Menu:

Ok, admit you are a control freak and you want to see only what you build yourself - customized titles, no "memtest86+" and no extra kernels. Here is how you do it:
Run sudo update-grub to get the current available kernels.
Copy the desired "menuentry" listings from /boot/grub/grub.cfg to /etc/grub.d/40_custom The entry begins with the line starting with "menuentry" and ends with a line containing "}".
Add any other "menuentry" items you wish to see on the boot menu.
Edit the titles of the "menuentry" line if desired (between the quotation symbols). Do not change the lines following the "menuentry" line. Each entry should start with a "menuentry" line and end with a "}" on the last line.
Remove the executable bit from /etc/grub.d/10_linux, /etc/grub.d/20_memtest86+ and /etc/grub.d/30_os-prober
Removing the executable bit from any file in /etc/grub.d will exclude the file from being included in grub updates.
Code:
sudo chmod -x /etc/grub.d/10_linux /etc/grub.d/20_memtest86+ /etc/grub.d/30_os-prober
Run "sudo update-grub"
The updated /boot/grub/grub.cfg file should now contain only sections for "00_header", "05_debian_theme" and "40_custom".
The grub.cfg file will not be updated with the addition of a new kernel. To add a new kernel, make "10_linux" executable, run "sudo update-grub" to refresh the available kernels, and repeat these instructions.
Note the proviso at the end there - every time you update a kernel you are going to have to do it all over again. It does work because I have done it. But my God what are they thinking of??

The 'Sheldon's' that write this stuff have a marvellous grasp of scripting languages, but no grasp whatsoever on reality.
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.
nukm

Re: Grub 2 Madness

Post by nukm »

Solution - refrain from installing new kernel! :lol:
viking777

Re: Grub 2 Madness

Post by viking777 »

Refrain from installing grub2 would be better - if only I could!
altair4
Level 20
Level 20
Posts: 11460
Joined: Tue Feb 03, 2009 10:27 am

Re: Grub 2 Madness

Post by altair4 »

viking777, This probably isn't applicable to you but do you know if the installer offers the option of using lilo?
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
MaddogF16

Re: Grub 2 Madness

Post by MaddogF16 »

You can switch back to legacy grub if you like, I haven't tried it yet, still trying to get the Grub2 way down better.

https://help.ubuntu.com/community/Grub2 ... 20GRUB%202
viking777

Re: Grub 2 Madness

Post by viking777 »

altair4 wrote:viking777, This probably isn't applicable to you but do you know if the installer offers the option of using lilo?
I don't think so altair, I certainly didn't see any such option at install, but then I wasn't really looking for it'
You can switch back to legacy grub if you like, I haven't tried it yet, still trying to get the Grub2 way down better.
I suppose that would be an option MaddogF16, but don't get me wrong, I am not at all against innovation in fact I actively seek it out and going back to 'legacy' would be a bit of an 'ostrich' reaction. What I am against is when innovation makes life more difficult instead of easier - and grub2 certainly does that. It hasn't really hit the mainstream yet, but when it does I am sure the people that coded it will be made well aware of its limitations and perhaps they will do something to make it more user friendly than it is now - we can only hope. Maybe even the Mint team could do something to 'tame' it - a bit of 'Minitification' on the startupmanager program would be all that is needed, that particular program is half way there already.
viking777

Re: Grub 2 Madness

Post by viking777 »

OK folks here is how to get round the madness.

1) Get yourself a root instance of Nautilus, right click on /boot/grub/grub.cfg, select properties and make it writeable.

2) Make any changes to grub.cfg that you need to with gedit (in my case about half of the entries were wrong or unwanted!). You need to be a bit careful here, but I have made scores of changes to mine and it still boots.

3) Save the file. Of course the problem here is that as soon as you get a kernel update, all your carefully crafted changes will be over written, including the write permissions. So let's get around it. NB if you choose to remove a kernel this will also regenerate grub.cfg and require the procedure below.

4) Make a backup of grub.cfg. When you get your kernel update simply copy the new kernel entry from the automatically generated grub.cfg to your backup (dont forget the final curly bracket on a new line at the end of the stanza or it wont work) Edit it as you prefer,save it, then delete the auto generated grub.cfg and rename your backup to 'grub.cfg' - you won't have to make it writeable again because it already will be (dont forget to make another backup for next time).

This may sound like a bit of a faff, but compared to the way grub2 works by design it is a breeze.

Of course we can only hope that in the fullness of time sanity will return and somebody will write a program to make changes to grub 2 a little bit more sensible. The startupmanager program is part way there but does not provide anything like the control that Linux users want.

Grub 2 is a disgrace imho, it is no wonder we have a reputation as a 'difficult' OS amongst outsiders when programs like grub 2 are considered 'improvements'.
Last edited by viking777 on Thu Dec 10, 2009 5:51 am, edited 3 times in total.
viking777

Re: Grub 2 Madness

Post by viking777 »

Having just received my first kernel update since I thought of the solution above, I am now able to report that it works perfectly and is vastly easier than the suggested method in the first post.

Of course if you are not a 'control freak' as the first post says you can just leave grub2 to do its own thing and put up with all the errors and annoyances it builds in. The choice is yours.
emorrp1

Re: Grub 2 Madness

Post by emorrp1 »

right, you've posted in a couple of grub2 threads I've posted in now and this time you linked to this thread, so what exactly is it you're trying to do? I'll bet there's a "proper" way to do it in grub2 that's just slightly different to grub legacy. I've seen many people explain how to make Windows boot by default by moving the Windows entry to near the top of menu.lst, which will work, but the "proper" way to do this had always been to change the "default" line. All you've actually done so far is complain about the situation and provide a workaround for your specific case. You admit that you're a control freak, then complain about grub2 in threads that mention it, whether or not the OP is also a control freak.
remoulder
Level 17
Level 17
Posts: 7621
Joined: Fri May 09, 2008 1:14 pm

Re: Grub 2 Madness

Post by remoulder »

viking777, came across a really useful page on grub 2 at http://members.iinet.net/~herman546/p20.html which might be worth looking at
[Edit] your original post and add [SOLVED] once your question is resolved.

“The people are my God” stressing the factor determining man’s destiny lies within man not in anything outside man, and thereby defining man as the dominator and remoulder of the world.
emorrp1

Re: Grub 2 Madness

Post by emorrp1 »

mikeyb: If you've only just discovered that link, you really need to read this topic: http://forums.linuxmint.com/viewtopic.php?f=46&t=30623
breaker

Re: Grub 2 Madness

Post by breaker »

I love grub2 now, the loop command is really cool, just like mounting iso images with mount, except you can use it to boot a Live CD iso. :wink:
Locked

Return to “Installation & Boot”