I should learn more about Grub2

July 25, 2016

I have a long-standing dislike of Grub2 (eg, and). Ever since I started having to deal with it I've felt that it's really overcomplicated, and this complexity makes it harder to deal with. There's a lot more to know and learn with Grub2 than there is with the original Grub, and I resent the added complexity for what I feel should be a relatively simple process.

You know what? The world doesn't care what I think. Grub2 is out there and it's what (almost) everyone uses, whether or not I like it. And recent events have shown me that I don't know enough about how it works to really troubleshoot problems with it. As a professional sysadmin, it behooves me to fix this sort of a gap in my knowledge for the same reason that I should fix my lack of knowledge about dpkg and apt.

I'm probably never going to learn enough to become an expert at Grub 2 (among other things, I don't think there's anything we do that requires that much expertise). Right now what I think I should learn is twofold. First, the basic operating principles, things like where Grub 2 stores various bits of itself, how it finds things, and how it boots. Second, a general broad view of the features and syntax it uses for grub.cfg files, to the point where I can read through one and understand generally how it works and what it's doing.

(I did a little bit of this at one point, but much of that knowledge has worn off.)

Unfortunately there's a third level I should also learn about. Grub2 configurations are so complex that they're actually mostly written and updated by scripts like grub2-mkconfig. This means that if I want to really control the contents of my grub.cfg on most systems, I need to understand broadly what those scripts do and what they get controlled by (and thus where they may go wrong). Since I don't think this area is well documented, I expect it to be annoying and thus probably the last bit that I tackle.

(If I cared about building custom grub2 configurations, it should be the first area. But I don't really; I care a lot more about understanding what Grub2 is doing when it boots our machines.)

Comments on this page:

By dozzie at 2016-07-25 04:46:36:

Grub2 configurations are so complex that they're actually mostly written and updated by scripts like grub2-mkconfig.

Not quite. It's the opposite: they're so complex because they are written and updated by such scripts. If you needed to write your own grub.cfg by hand, it would end up looking somewhat similar to old menu.lst.

By Anon at 2016-07-25 07:38:54:

I have to admit that it is easier to write grub2 configurations using scripts because everything has been broken up into smaller pieces and grub-mkconfig does the scanning and combining but it came with complexity.

If you are in position to go against the defaults and want something simpler then extlinux 4ever but if your system is complicated you'll be forced to grub2...

By skeeto at 2016-07-25 08:41:28:

IMHO, Grub2 configuration is so different that it should have been given a new name. When I was going through the transition a couple years ago, all the Grub and Grub2 search results were mixed together (and still mostly for old Grub). Though building on brand recognition was probably an important part of its adoption.

By Albert at 2016-07-26 05:09:49:

I found this article very good at the time when I was looking for info on grub2:


Written on 25 July 2016.
« My view on people who are assholes on the Internet
An irritating systemd behavior when you tell it to reboot the system »

Page tools: View Source, View Normal, Add Comment.
Login: Password:
Atom Syndication: Recent Comments.

Last modified: Mon Jul 25 00:55:21 2016
This dinky wiki is brought to you by the Insane Hackers Guild, Python sub-branch.