Troubleshooting Wizard-Style - Multi-booting Problem and Solution 1 - Wizard Makes a Booboo

wizardfromoz

Administrator
Staff member
Gold Supporter
Joined
Apr 30, 2017
Messages
10,198
Reaction score
9,114
Credits
46,928
SUBJECT AREA - Multi-booting
LEVEL OF DIFFICULTY - Intermediate to Advanced
CAN OCCUR WHEN - following a significant number of updates including kernel and grub updates
READING TIME – 5 minutes
RESOLUTION/RECOVERY TIME – 10 minutes

BACKGROUND

I was working on my Linux Mint 20.0 ‘Ulyssa’ MATE, with a view to running updates and upgrades, and after rebooting successfully, performing a Timeshift snapshot exercise.

My /etc/default/grub typically has in it, amongst other lines and commands

GRUB_DEFAULT=saved
GRUB_SAVEDEFAULT=true
and
GRUB_DISABLE_OS_PROBER=false

My list of updates and upgrades (obtained from Linux Mint Update Manager, or in Terminal from

sudo apt update
apt list –upgradable

)

...includes the following:

grub-common
grub2-common
grub-pc
grub-pc-bin
grub-efi-amd64-bin
grub-efi-amd64-signed

and the latest of

linux-modules-generic
linux-headers-generic
linux-modules-extra-generic

and so on.
So I know from experience that following the updates and a reboot, Ulyssa is going to take the Primary Partition spot at the top of a reconfigured Grub Menu.

To that end, and before I run the updates, I

sudo nano -m /etc/default/grub

and edit the line

GRUB_DISABLE_OS_PROBER=false

to

GRUB_DISABLE_OS_PROBER=true

save and exit the file. This will save me maybe 45 minutes because when os-prober runs as a part of reconfiguring grub, it has to (for me) identify 84 Linux Distros, taking 35 to 45 minutes each time, and it will run 3 to 4 times with those files that are being updated. So we are talking 2 to 3 hours.

I do not run

sudo update-grub

because I know that that will occur as part of the updates.

I then run the updates but there is one thing that I forgot to do while I was editing /etc/default/grub and that is to change the line

GRUB_DEFAULT=saved

to

GRUB_DEFAULT=0

PROBLEM

When I reboot the laptop, I am confronted with the background to my customised grub menu for Ulyssa


bk6GYp2.jpg



which starts ticking down the 10 second countdown to boot.

Use of the Esc key here (UEFI computer) or Shift-Tab (Legacy) will not save me here, Grub has other instructions and won’t show a usable menu.

It boots, but not into Mint Ulyssa but into Manjaro Xfce, which must have been the last Distro I worked in last time Ulyssa was top of the leaderboard, and the default was saved.

I am still logged in to this Forum, in Ulyssa, so I want to get back there.

My solution follows in the next couple of Posts, and I give you a clue with my F12 Boot Menu.


m4sROpa.jpg


(that first entry is for USB drive)

Cheers

Wizard
 


^^^^ not bad for a beginner...! ^^^^^

b-Zo-Rud6-Imgur.gif
 
you're not the only one to end up going there, that's why i keep my Ubuntu grub recovery drive in the box above the computer
 
PRELIMINARY AND ASSESSMENT

With that boot order shot, you can see that I have a choice of
  • Ubuntu
  • Gecko Linux
  • Debian
  • Fedora
  • Debian and
  • my 3 hard drives

Each entry of the named Distros will be for the one that most recently held the Prime Partition spot, that is, top of my Grub Menu.

The Gecko will be one of Gecko Rolling Cinnamon or Gecko Rolling Xfce, in this case it is Xfce.

The Fedora is my Fedora Desktop 37.

The 2nd Debian is also LMDE (go figure).

The Ubuntu entry can cover an Ubuntu flavour, or a Linux Mint, or another Distro based on Ubuntu (for example Linux Lite, Peppermint, and so on).

There is no point in choosing Ubuntu, because it will lead me into my problem child Linux Mint ‘Ulyssa’ MATE, which will then boot into Manjaro.

So I set my sights on the Debian, for a reason, and choose the 3rd entry.

On this occasion, it boots me into LMDE (Linux Mint Debian Edition), which is always a Cinnamon, via a complete and current Grub Menu, and that’s handy if I wanted to work from another Distro.

Once I am at the Desktop in LMDE, I can begin to work on my solution.
 
MY SOLUTION

I am going to use the Terminal, and invoke a process known as chroot to get into the Linux Mint 20.1 ‘Ulyssa’ MATE environment and fix it.

For those unfamiliar with the term, chroot will allow you to assume Root in the Distro you are planning to fix, and allow you to work with it even if it is unable (to be booted into at the time.

For those who have only one Linux Distro on their machine, you will need to use it from a Live USB/DVD stick or disk that matches or is similar to your non-working Distro.

For multibooters, you can use it from another, similar Distro, and get quicker results and outcomes, and my LMDE is close enough to my Mint to do that.

STEPS

1. I need to identify my Mint root partition and (I am using UEFI) my ESP (EFI System Partition) so I can get that from
Code:
sudo parted -ls
2. I mount them to temporary mount points with
Code:
sudo mount /dev/sdxy /mnt and sudo mount /dev/sdxz /mnt/boot/efi
(substitute your own results for x, y, and z)
3. I have to also mount certain of my system partitions and here they are /dev /dev/pts /proc /sys and /run . I could mount them individually, but a commonly used practice is to place them in a string that includes variables. The / forward slash is generated with the part that follows mount -B . It reads as
Code:
for i in dev dev/pts proc sys run; do sudo mount -B /$i /mnt/$i; done
4. Now we are ready to enter the chroot environment, and watch your prompt change as we do it.
Code:
sudo chroot /mnt

The first part appears to be your usual prompt, but the end has changed. We are now Root in my problem child Distro. The screenshot below is taken showing a part of my Desktop in LMDE 5 ‘Elsie’ and the content of the Terminal window shows the change from my usual prompt there to that of the Mint MATE I have chrooted into.


QVv5FHA.png


Let’s start fixing things. I’ll fix my /etc/default/grub first.

5.
Code:
sudo nano -m /etc/default/grub
. There, I change one line.
GRUB_DISABLE_OS_PROBER=true I change to GRUB_DISABLE_OS_PROBER=false
6. I exit nano, saving along the way. I then run
7.
Code:
 update-grub
8. That generates a large amount of output for me, having 84 Distros, and when the process is complete, I can leave the chroot environment
9.
Code:
exit
10. This returns me to my usual prompt, and from there I can exit and reboot.

The result of these efforts is that on bootup I am rewarded with what I want to see, and that is


F9M7jPW.jpg



REVIEW / SUMMARY

I hope you will find that chroot can be a valuable tool, whether you use it from a Live medium, or from another Linux Distro.

I am retraining myself to change

GRUB_DEFAULT=saved

to

GRUB_DEFAULT=0

before such an exercise, and then change it back when I have a successful reboot. Who says you cannot teach an old dog new tricks?

Some of the astute and experienced among you may see alternative ways to produce the same fix, if so, please share with us, and I can share with you, why, if I know those methods, I did not use them here, or else learn in the process.

Cheers

Wizard
 

Members online


Latest posts

Top