update-grub command has no effect

6,758

I solved it by executing the grub-install command, explanations:

As said before, the GRUB is only affected by configuration at booting time by reading the configuration file. The GRUB binaries store the path to this configuration file. In order to set the correct path to the desired configuration file, it is required to update these binaries.

I managed to do it very easily by executing the sudo grub-install command from the OS where the desired configuration is stored (the command does not required any additional parameters).

Now, the GRUB is affected by any change at /boot/grub/grub.cfg.

Share:
6,758

Related videos on Youtube

uben
Author by

uben

Updated on September 18, 2022

Comments

  • uben
    uben over 1 year

    After installing a Kubuntu on a second hard drive, it changed the boot order of my main hard drive GRUB and I can't change it back since.

    Any change to the grub configuration file (/etc/default/grub) applied with update-grub has no effect.

    The update-grub change the /boot/grub/grub.cfg file correctly, but does not modify any file in the /boot/efi/ directory, while this should happen since the mounting point of my GRUB is boot/efi.

    I thought it was due to write permission, but I checked, root has write permission over these files.

    The output of the sudo update-grub command:

    Generating grub configuration file ...
    Found linux image: /boot/vmlinuz-4.15.0-33-generic
    Found initrd image: /boot/initrd.img-4.15.0-33-generic
    Found linux image: /boot/vmlinuz-4.15.0-32-generic
    Found initrd image: /boot/initrd.img-4.15.0-32-generic
    Found Ubuntu 18.04.1 LTS (18.04) on /dev/sdb2
    Adding boot menu entry for EFI firmware configuration
    done
    

    Content of the /etc/default/grub file:

    GRUB_SAVEDEFAULT=true
    GRUB_DEFAULT=saved
    GRUB_TIMEOUT_STYLE=hidden
    GRUB_TIMEOUT=10
    GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
    GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
    GRUB_CMDLINE_LINUX=""
    

    EDIT, IMPORTANT:

    It seems like the GRUB is only affected by configuration at booting time by reading the configuration file. So, if I understand, mine is loading its configuration on the Kubuntu partition. But how can I change this behavior? This question has already been asked but not correctly answered.

    • Melebius
      Melebius over 5 years
    • oldfred
      oldfred over 5 years
      You do not have to chroot, but just boot into the install you want to be default and reinstall grub from there. The actual control file is /EFI/ubuntu/grub.cfg which is just 3 lines and a configfile entry to full grub.cfg in your install. You can edit that with correct UUID. See this for details: askubuntu.com/questions/957914/…
  • abu_bua
    abu_bua over 5 years
    Welcome to Ask Ubuntu! I recommend to edit your answer to expand it with specific details about what you did.
  • Steven Lu
    Steven Lu about 4 years
    I'm just getting this: grub-install: error: install device isn't specified.
  • uben
    uben about 4 years
    grub-install requires the device path, use lsblk to find your installation disk, the one with the / mount point.