can I replace grub2 with classic grub on CentOS 7 ?

General support questions
Post Reply
_ck_
Posts: 89
Joined: 2012/08/10 23:00:35

can I replace grub2 with classic grub on CentOS 7 ?

Post by _ck_ » 2014/07/12 23:11:47

I can get used to systemd, eventually, but wow I cannot stand grub2

Any chance it is possible to replace grub2 with classic grub somehow and still have things like yum update kernel work ?

Or is that technically impossible?

For non-gui servers with conventional bios, grub2 is massive overkill and the complexity and having to remember to run processing commands is a huge turnoff.

User avatar
TrevorH
Forum Moderator
Posts: 27127
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: can I replace grub2 with classic grub on CentOS 7 ?

Post by TrevorH » 2014/07/13 00:32:05

I do not believe it's possible.

What processing commands do you need to run? As far as I know it should all be automatic just as it was in grub legacy days.
CentOS 6 will die in November 2020 - migrate sooner rather than later!
CentOS 5 has been EOL for nearly 3 years and should no longer be used for anything!
Full time Geek, part time moderator. Use the FAQ Luke

_ck_
Posts: 89
Joined: 2012/08/10 23:00:35

Re: can I replace grub2 with classic grub on CentOS 7 ?

Post by _ck_ » 2014/07/13 00:39:13

I was under the impression if I edit /etc/default/grub that I have to run grub2-mkconfig -o /boot/grub2/grub.cfg to affect changes

Is that incorrect?

It is just really disturbing to me the complexity of grub2 and not being sure that some changes will put the system into an unbootable state.

With grub v1 it was really clear and you could easily set default and fallback and know what you were going to boot into.

I also noticed with grub v1, sometimes after a kernel update on some servers, it would "bump" the default setting so that the old previous kernel would still be the default, and I would manually edit grub.conf to ensure the new kernel is used.

With grub2 I am not even sure how to inspect that with the complexity it creates.

User avatar
TrevorH
Forum Moderator
Posts: 27127
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: can I replace grub2 with classic grub on CentOS 7 ?

Post by TrevorH » 2014/07/13 00:59:33

I think if you edit /etc/default/grub then you would need to rerun grub2-mkconfig to retrospectively change the current grub.cfg file. If you just want that change to take effect from the next kernel install then you don't need to. Or if you're confident, you can just hack /boot/grub2/grub.cfg and change the things that need changing yourself and change the default file so that future installs pick that change up.

With grub legacy, the thing that made it set the default wrongly was yum removing a kernel in the middle of the list and then reinstalling it. At least I think so, it is something slightly out of the ordinary but that people do sometimes that makes that change.

Otherwise...

Code: Select all

[root@centos7 ~]# grub2-editenv list
saved_entry=CentOS Linux (3.10.0-123.4.2.el7.x86_64) 7 (Core)
[root@centos7 ~]# grub2-set-default 'CentOS Linux (3.10.0-123.1.2.el7.x86_64) 7 (Core)'
[root@centos7 ~]# grub2-editenv list
saved_entry=CentOS Linux (3.10.0-123.1.2.el7.x86_64) 7 (Core)
[root@centos7 ~]# grub2-set-default 'CentOS Linux (3.10.0-123.4.2.el7.x86_64) 7 (Core)'
[root@centos7 ~]# grub2-editenv list
saved_entry=CentOS Linux (3.10.0-123.4.2.el7.x86_64) 7 (Core)
You can get the names to use from grep `^menuentry" /boot/grub2/grub.cfg`
CentOS 6 will die in November 2020 - migrate sooner rather than later!
CentOS 5 has been EOL for nearly 3 years and should no longer be used for anything!
Full time Geek, part time moderator. Use the FAQ Luke

_ck_
Posts: 89
Joined: 2012/08/10 23:00:35

Re: can I replace grub2 with classic grub on CentOS 7 ?

Post by _ck_ » 2014/07/13 01:14:10

I know it is human behavior to resist change but I really, really dislike the immense complexity added by grub2 and systemd.

And for what, there is very little benefit to a server environment which is where RHEL/CentOS is used 99% of the time.

Of course using 6.5 through 2020 is always an option but there are downsides to that too.

User avatar
TrevorH
Forum Moderator
Posts: 27127
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: can I replace grub2 with classic grub on CentOS 7 ?

Post by TrevorH » 2014/07/13 01:22:17

I'm sure there were similar discussions when grub-legacy replaced LILO... ;-)
CentOS 6 will die in November 2020 - migrate sooner rather than later!
CentOS 5 has been EOL for nearly 3 years and should no longer be used for anything!
Full time Geek, part time moderator. Use the FAQ Luke

scottro
Forum Moderator
Posts: 2431
Joined: 2007/09/03 21:18:09
Location: NYC
Contact:

Re: can I replace grub2 with classic grub on CentOS 7 ?

Post by scottro » 2014/07/13 01:29:41

Grub2 does have a few advantages, for example, I believe it can boot from an LVM partition, which legacy grub can't do.

On the other hand, one of the advantages of grub over lilo was that you could make changes, without having to run a command, and that's been lost.
Now you do, as you've stated, have to run grub2-mkconfig (on RH based systems, on Debian based systems, it would be grub-mkconfig.)

I have a page on it that I put together at some point.

http://srobb.net/grub2.html
New users should check the FAQ and Read Me First pages

_ck_
Posts: 89
Joined: 2012/08/10 23:00:35

Re: can I replace grub2 with classic grub on CentOS 7 ?

Post by _ck_ » 2014/07/13 01:50:02

I think debian also has the simple "update-grub" but that seems to be missing on rhel/centos.

Of course we can just make an alias.

What bothers me is that on a headless server, if I have to emergency boot and just attach the disk with grub2 to another os, I can no longer just edit grub.conf to fix or change things. I am not even sure how with just the disk attached and not centos7 running that you would even apply the grub2 changes to an offline system.

This is a very bad thing in a server environment.

Flat text files were best.

And I am not even going to start on systemd which obviously upsets a great many people.

User avatar
TrevorH
Forum Moderator
Posts: 27127
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: can I replace grub2 with classic grub on CentOS 7 ?

Post by TrevorH » 2014/07/13 02:36:02

Actually I think you are wrong. You can edit grub.cfg and it is read automatically. it's just that it gets overwritten next time the tools update it. And the kernel install that updates it, I don't think that uses grub2-* it still calls /sbin/grubby just as the el5 and el6 kernels used to.

Tested and confirmed: edit /boot/grub2/grub.cfg and removed rhgb quiet from my test VM and reboot and it boots in verbose mode.
CentOS 6 will die in November 2020 - migrate sooner rather than later!
CentOS 5 has been EOL for nearly 3 years and should no longer be used for anything!
Full time Geek, part time moderator. Use the FAQ Luke

Post Reply

Return to “CentOS 7 - General Support”