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

Steve McIntyre steve at einval.com
Wed Feb 1 15:12:49 UTC 2017


Hi Gregor,

On Sat, Jan 28, 2017 at 08:26:57PM +0100, Gregor Zattler wrote:
>* Steve McIntyre <steve at einval.com> [28. Jan. 2017]:
>> On Sun, Jan 17, 2016 at 09:47:20PM +0100, grfz wrote:
>>>
>>>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.

Right - that's a common setup on many PCs originally supplied with
Windows 7. It's a really bad default. :-(

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

Right.

>>>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.

To be honest, your problem is that you're using this stuff in a way that
it's just not designed for. Grub and the Debian automation around it
is designed to make *a* system bootable, not multiple different OS
versions on the same system with different configurations. That's why
grub-install is run automatically, etc,

You *could* maybe just stop the rescue system from installing at all,
but then it might not work when you need it. One thing I'm surprised
about - is os-prober not running on each installation, finding the
other and adding a reference to it in the grub menu? Or have you
disabled that?

-- 
Steve McIntyre, Cambridge, UK.                                steve at einval.com
"I suspect most samba developers are already technically insane... Of
 course, since many of them are Australians, you can't tell." -- Linus Torvalds



More information about the Pkg-grub-devel mailing list