GRUB Repair in Welcome?

Continuing discussion from: Search option for software boutique 1604 and up

While you are adding things to Welcome Luke, what about “grub repair” for the live CD, it would be very; very helpful!. :smiley:

GRUB Repair is already one click away on the live session, it’s under Installation Help → Dual Booting.

2 Likes

Is it?, I’ll have to check that out as I never noticed it!.

What I really meant was to have all the commands nicely set so someone only has to copy and paste them!. I will take a look, thanks Luke. :smiley:

Okay, I found it but it isn’t really what I meant, it is a great idea to offer “Boot Repair” but what I meant was the normal terminal command like the following:

sudo update-grub

The only problem there is when I have tried the above command, it cannot find the correct path like this thread here:

My question is, why hasn’t this been sorted as it is really old now? (I do realise that you are not responsible but someone at Ubuntu should fix this sort of thing!). :smiley:

Running:

sudo update-grub

I believe is the incorrect way to do it from a live session. Without mounting and using the configuration stored on the disk, updating GRUB would be pointless.

If you need to update GRUB, I’d do it from the booting OS then use the live session. It just needs the root file system (or dedicated boot partition /boot) to be mounted. Although a common scenario is “repairing” or fixing GRUB entries, in which case:

sudo grub-install --boot-directory=/mnt/boot/ /dev/sdXY

Does the job. Or as your provided link shows, you can chroot to the installed OS:

sudo mount /dev/sda1 /mnt
sudo chroot /mnt
sudo update-grub2

So, rather then Welcome taking the role of what could be dangerous (and scare users with a non functional booting system if it fails!), the Boot Repair tool is specialised for the job. It just requires an internet connection to download and install.

I bet boot-repair also performs these commands under the hood.

1 Like

Hi Luke,

I am asking mainly because of the “sudo” part of the Boot Repair options as I seem to recall this not working recently and I had to manually type all the commands you posted above but it ended up failing, this may be down to something I did but cannot remember exactly what happened to be honest!.

Would the following command do all that Boot Repair does without having to install Boot repair?. Sorry to be a nuisance but I just what to clarify the situation!.

sudo grub-install --boot-directory=/mnt/boot/ /dev/sdXY

Or is this better?:

sudo mount /dev/sdX# /mnt

sudo grub-install –boot-directory=/mnt/boot /dev/sdX

Info taken from here (old-ish) and there is also a difference if one has a separate boot partition or not!:

Respectfully from Mr Pain-in-the-butt. :smiley:

Umm, I’m not too sure. :confused: You’d have to check the log for boot-repair next time to see if this was the command or not. :slight_smile:

The command/procedure is slightly different again for UEFI systems.

When it comes to Welcome, especially new users who wish to dual boot but broke something, this tool is great for automating the task. Better dealt by a specialist then Welcome being a jack of all trades. :wink:

Alrighty thanks, I will make notes the next time I use BR and see if there are any problems which might cause problems for anyone new to Boot Repair (and me of course!). :smiley:

I will mark this as solved. :smiley:

EDIT:

I mucked around with my notebook and used BR, it worked okay although I think that a new user might get a little confused but it did the job!.

You can look at the report here if you want to @lah7. :smiley:

http://paste2.org/mf5gEPpX

Yet another EDIT (Son of Edit):

I edited the Ubuntu Update Guide to include info about Boot Repair in Welcome!. :smiley:

You will have to re-install Ubuntu Mate Grub theme after using Boot Repair as it reverts to the standard Grub menu, use the following terminal command (Ctrl + Alt + t):

sudo apt-get install grub2-themes-ubuntu-mate

1 Like