Confused about re-installation of grub bootloader

Sorry, a bit of confusion here - if one has a working UEFI system, can grub be reinstalled from terminal after a full system update?

Or is one required to chroot into that system with a live USB iso to reinstall and update grub?

Sure, why couldn’t it?

1 Like

the chroot wiki bit assumes you’ve got a unbootable system and are looking for a rescue, hence you’re reinstalling grub.

You can do so from your terminal at any time, which will install the current grub package:
sudo grub-install
followed by:
sudo grub-mkconfig

3 Likes

I am totally confused: I have only Manjaro on my drive (and a swap partition), installed normally with Calamares since the day I installed Manjaro (no UEFI).

My system works flawless. Because of this discussion I tried to “update” grub with
sudo grub-install

This is the terminal answer (it’s in german):

i386-pc wird für Ihre Plattform installiert.
grub-install: Fehler: Kein Installationsgerät angegeben.

So do I need to update? Is it possible for me to update? Or do I need this only if I have 2 OS installed for dual boot?

Sorry, I am totally confused now.

JimTom

You didn’t specify a device to install to. You need to identify it yourself. An example command is given here:

1 Like

aand this is why it’s better that users never update their GRUB :smiley:

2 Likes

JimTom

1 min

I did not dare to try around because I do not want to kill a running system… And I have no “boot partition”, only the main partition with Manjaro and in it an ordinary folder named “boot”.

So I am really not sure what to do: If I specify my only existing main partition in grub-install: what will happen?

  • Will this format the whole partition?
  • Or resize it and create a seperate boot-partition?
  • Or nothing and it will write the new grub code in the folder “boot” (but philm wrote, that there is s grub update with pamac and a seperate grub-install)
  • Or just … nothing

And: Why do I have no boot partition? Where is my grub? In the boot-folder (as I said, I have only this partition)?

As I wrote above: I am totally confused at the moment (and yes, I googled around, but I did not find very much about grub-install error codes).

Sorry, if these are stupid questions. I could solve many questions by myself and I am happy Manjaro-user since 4 months now, but this time I think it is better for me to do nothing with grub-install I could easily regret.

Don’t panic.
Since your system is ‘no Uefi’ a grub-install is super easy, all you will need to do is specify the drive, so eg on a system with only one drive, sda, the command would be:
sudo grub-install /dev/sda

Hi
First time poster I believe.

I have a chromebook that is/was broken, I broke it.

Linux Mint failed on about 20 tries to complete an install.

Manjaro took about 3 goes.

The install completed and did about 381 updates.
Re-boot failed with an error message the Manjaro was not a 64 bit OS.

So faffing about after a few goes I got manjaro to boot with the original USB as a boot device.
Reboot failed again/

More faff and a successful boot.
Up dated to a 6.2 kernel methinks.

DID the
sudo grub-install and the sudo grub-mkconfig.

Got a clean boot so thanks to the above posters.

Then why not do it the same way as another Arch distro and work around the problem with another bootloader, in this case systemd-boot? I thought here in the Manjaro world, the grub problem is already solved.

Following this guide (posted above)

GRUB/Restore_the_GRUB_Bootloader

updating grub on an UEFI system should work with this comands:

grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=manjaro --recheck

grub-mkconfig -o /boot/grub/grub.cfg

So it should be “super easy”, too?! Or am I missing something?

2 Likes

check with parted for flags boot & esp

sudo parted -l

Sorry, I do not know how your answer can help me.

To be clear:

I managed to update grub on my PC, which runs only Manjaro, one partition, no EFI, MBR.
It was really simple:
sudo grub-install /dev/sda
sudo grub-mkconfig

Thank you all for your help in this forum. :slight_smile:

My laptop is a different thing:
UEFI, dual boot (Win10 and Manjaro), GPT, EFI System Partition (flags boot, esp)

Before trying the same as above I want to be sure updating grub on this system is “super easy”, too.

So, please, your inputs! Just a
sudo grub-install
again ?

for UEFI ,
if possible

sudo grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=manjaro --recheck --verbose
sudo efibootmgr -v
sudo update-grub

or by chroot

  1. go in chroot ( for mount /boot/efi )
  2. apply
sudo manjaro-chroot -a ( type 1 if only one line 0 appears )
grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=manjaro --recheck --verbose
efibootmgr -v
update-grub
exit ( quit chroot )

see this

why chroot ? If user can log into Manjaro /boot/efi should be mounted. Or check with smth like mount | grep "/boot/efi"

Good question. It’s not normally necessary.

Sorry, what? Please see How to Post

Im pretty sure its a common shortening of ‘something’ … but confusion can be its own proof

1 Like

yes :slight_smile: - but let’s not confuse people any further, I agree

Hi!
Just wanted to tell you, that these comands worked fine on my Laptop (Dual Boot Win10/Manjaro, UEFI, GPT).

sudo grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=manjaro --recheck --verbose
sudo efibootmgr -v
sudo update-grub

Do I notice any difference now? No, not at all! But now I know how to update grub if I need to (for example if a new version is out because of a security issue).

Case closed :slightly_smiling_face:

update-grub is simply a script calling grub-mkconfig (another script) with default arguments covering as many scenarios as the script-maker could think of :slight_smile:

There is no unifying remedy or set of commands that will work for all cases on all machines. Sometimes not even on the same distribution, let alone with multiboot and different operation systems. The key here, is to specify where grub should go (/boot/EFI, /EFI/boot, etc.), and its current location could be found with fdisk, parted,
hwinfo --disk, lsblk, ls, mount, efibootmgr and probably other CLI tools that I can’t think of right now atop GUI tools like gparted, kde partitionmanager and others. That’s what @stephane and @dragan have both explained.

If you don’t have rw (read-write) access rights on it, then you aren’t the owner of the previous boot manager installation (if it was installed from another user, linux distro, Windows, etc.). Then the grub-install should be done via chroot-ing (most commonly when booting via a Live CD, because you wish to impersonate the root from outside its working environment). This is all simplified by Manjaro’s dev team (with manjaro-chroot), but the worst thing you can do to your boot record, is to assume updating it is as you say “super easy”, because it can go super wrong if you don’t understand what you’re doing while copying different commands and executing them as “Super user”. Super informative.

If you’re in doubt, and I can’t stress this enough, don’t update grub.

Case open (:

1 Like