Bug#811311: grub2-common: after grub-install grub reads wrong grub.cfg

Gregor Zattler telegraph at gmx.net
Sat Jan 28 19:26:57 UTC 2017


Hi Steve,
* Steve McIntyre <steve at einval.com> [28. Jan. 2017]:
> On Sun, Jan 17, 2016 at 09:47:20PM +0100, grfz wrote:
>>
>>on my laptop there are two debian/testing installations:
>>
>>- rescue: one file system on sda2 contains everything, also /boot
>>
>>- main: cryptsetup/lvm with separate boot partition on sda4
>>
>>Today I dist-upgraded 'rescue', this installed a newer kernel image
>>and installed grub without asking.  Since then when booting grub
>>loads 'rescue's grub.cfg.  With grub's "configfile" I'm able to
>>boot 'main' and did a grub-install to automate booting:
>>
>>   * What exactly did you do (or not do) that was effective (or
>>     ineffective)?
>>
>>While running 'main' with sda4 mounted on /boot and sda1 mounted on
>>/boot/efi I did
>>
>>$ sudo grub-install
>>grub-install: error: /usr/lib/grub/i386-pc/modinfo.sh doesn't
>>exist. Please specify --target or --directory.
>>
>>which astonished me, but
>>
>>$ sudo grub-install  --target=x86_64-efi  /dev/sda
>>Installing for x86_64-efi platform.
>>efibootmgr: EFI variables are not supported on this system.
>>efibootmgr: EFI variables are not supported on this system.
>>Installation finished. No error reported.
> 
> OK so you have a system installed expecting to use UEFI, but then
> booted in BIOS mode. grub-install checks if you have UEFI support and
> will install in that mode if it's available, otherwise it will fall
> back to BIOS mode (hence the i386-pc error).

Ah, I did'n't know this was possible.  I checked the BIOS and it
said enable UEFI but try legacy boot first.

I changed this to "try UEFI frist".  This chages nothing with
respect to this bug report.

>>seemed to work.  
>>
>>   * What was the outcome of this action?
>>
>>But actually after a reboot 'rescue's grub.cfg came up.  I tried
>>several combinations of --target --boot-directory --recheck
>>--efi-directory but with no luck.
>>
>>   * What outcome did you expect instead?
>>
>>I expected grub to use 'main's grub.cfg instead of 'rescue's.
> 
> How exactly are you booting each of the systems?

I simply copy the grub.cfg from the main system to the rescues
one.  Computer starts, finds grub, grub loads this grub.cfg.  The
main system is the default boot entry.  The boot entry for the
rescue system is configured via /etc/grub.d/40_custom.

Copying the grub.cfg is OK as a workaround, but sometimes I
forget to do this.  This is especially annoying when uprading the
rescue system results in a update-grub of the rescue system
overwriting the grub.cfg which was produced by the main system.
I then am not able to boot the main system without the grub
commandline.  But this is doable too.


Ciao, Gregor
-- 
 -... --- .-. . -.. ..--.. ...-.-



More information about the Pkg-grub-devel mailing list