update-grub command has no effect
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
.
Related videos on Youtube
uben
Updated on September 18, 2022Comments
-
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 withupdate-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 isboot/efi
.I thought it was due to
write
permission, but I checked,root
haswrite
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 over 5 years
-
oldfred over 5 yearsYou 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 over 5 yearsWelcome to Ask Ubuntu! I recommend to edit your answer to expand it with specific details about what you did.
-
Steven Lu about 4 yearsI'm just getting this:
grub-install: error: install device isn't specified.
-
uben about 4 years
grub-install
requires the device path, uselsblk
to find your installation disk, the one with the/
mount point.