Web lists-archives.com

Re: no boot - kinda

On Fri 24 Aug 2018 at 17:51:20 (+0000), Glenn English wrote:
> On Fri, Aug 24, 2018 at 6:57 AM <tomas@xxxxxxxxxx> wrote:
> > Indeed -- I had to do this a couple of days ago, and in my notes
> > (I do take notes when doing such things: age and that) I see
> >
> >   "Jeez. What a Rube Goldberg. Should I say Grube Goldberg?"
> >
> > It's one of those cases where each step towards building the tower
> > seems to make sense, and at the end you say "wait: how did we arrive
> > here?".
> A post of those notes (with an addition on whether they worked or not)
> might be very interesting to a fellow Debian user of the elderly
> persuasion :-)
> This thread on grub2 is getting really scary. I'm afraid to make
> changes in the grub2 configs because an error could easily brick my
> machine. And futzing with /etc/default doesn't seem to impress grub2 a
> whole lot. Not concerning what I want to do, anyway.
> I think that what I'm wanting to do is completely remove some kernels
> from grub2's consideration and go back to one that works for me --
> that seems to be a tricky job.
> The installer and the updater send magic incantations to grub2 that
> successfully add/delete kernels to the boot process. Anybody have any
> idea what those might be?
> How about just removing all references to the ones I don't want from
> /boot and running update-grub?

Look at the top of /etc/default/grub.

Cut and paste the line into a terminal:

$ info -f grub -n 'Simple configuration'

About 30 lines, down, read about GRUB_DEFAULT

To get started, note that you can type a number.
/etc/default/grub probably has 0 as that number.

Count down the "menuentry" items in your
/boot/grub/grub.cfg file and put the number of the
one you want booted (counting from 0) into

Run update-grub.

Reboot. Don't touch any keys while the grub menu is displayed.

If the wrong kernel starts, you can still reboot again and
use the menu selection as per normal.

That gets you on the road. Then you can start think about using
those long strings, which has the advantage that they're more
stable against upgrades/adding/removing other bootable partitions etc.

About 50 lines into the info file, there's the bit about "saved".
Later, if you use this, you can change the default just by typing

# grub-set-default 'gobble>de-gook'

or for one-shot

#grub-reboot 'gobble>de-gook'