Configuring/using grub with grub-install and grub-mkconfig

Colin Watson cjwatson at ubuntu.com
Mon Nov 18 18:35:25 UTC 2019


On Mon, Nov 18, 2019 at 07:08:24PM +0100, Liam Proven wrote:
> On Mon, 18 Nov 2019 at 19:04, Colin Watson <cjwatson at ubuntu.com> wrote:
> 
> > It doesn't matter.  Neither one depends on the output of the other one
> > (I mean, when running the tools; of course both outputs have to be there
> > at boot time if you want things to work).
> 
> Hmm. Most recently I've been fiddling with this on openSUSE and it
> doesn't have an ``upgdate-grub'' command, which is a PITA.
> 
> Not sure the statement above is universally true, is all I'm saying.

Right, the update-grub wrapper is specific to Debian and its
descendants.  The statement should be true with only minor alteration,
though: openSUSE would have to have done something quite odd to make
either grub-install or grub-mkconfig depend on the other.

> > > OK, so, if I understand it right, I run update-grub (which runs
> > > grub-mkconfig for me with some parameters pre-set) which creates
> > > /boot/grub/grub.cfg and then I should run grub-install to write the
> > > things the BIOS needs to start the system.
> >
> > Correct.
> 
> Stop me if I'm wrong, but I vaguely thought GRUB recorded where you'd
> installed it somewhere, so subsequent updates will just update
> wherever it was last installed to...?

Er, yes, that's a good point that I'd managed to forget, sorry (perhaps
blotting out the horror ...): on non-UEFI PC systems, rather than using
grub-install directly, it's better to use "dpkg-reconfigure grub-pc" to
record where you want the boot loader installed so that it can remember
it for the next time.  "grub-install" alone will work for the time being
but will probably eventually break with later upgrades.

I recognise that this situation is not ideal.

-- 
Colin Watson                                       [cjwatson at ubuntu.com]




More information about the ubuntu-users mailing list