GCE instances drop to a grub prompt when GRUB_DISTRIBUTOR=Debian is set
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
grub2-signed (Ubuntu) |
Invalid
|
Undecided
|
Unassigned | ||
Xenial |
Fix Released
|
Critical
|
Unassigned |
Bug Description
[Impact]
GCE cloud instances started with images released prior to 2020-11-11 will fail to reboot when the newest grub2 2.02~beta2-
Upon reboot, the instance drops down to a grub prompt, and ceases to boot any further.
The output displayed is:
BdsDxe: loading Boot0003 "debian" from HD(15,GPT,
BdsDxe: starting Boot0003 "debian" from HD(15,GPT,
UEFI: Attempting to start image.
Description: debian
FilePath: HD(15,GPT,
OptionNumber: 3.
GNU GRUB version 2.04
grub>
Now, on GCE cloud images prior to 2020-11-11, /etc/default/
GRUB_DISTRIBUTO
In images after 2020-11-11, this line was REMOVED from /etc/default/
GRUB_DISTRIBUTO
The above line always returns "Ubuntu".
The new grub2 version 2.04-1ubuntu44 now always looks for the grub.cfg in /EFI/ubuntu, with no fallback to look in the directory the EFI grub executable was booted from. Since GRUB_DISTRIBUTO
[Testcase]
You can start an instance up on Google Cloud with an affected image with the below command:
gcloud compute instances create test-xenial-1 --image=
From there:
$ sudo apt update
$ sudo apt install grub-common grub-efi-amd64 grub-efi-amd64-bin grub-efi-
$ sudo reboot
The instance will not come back up, and you will see a grub shell in the logs on GCP.
You can also reproduce in KVM. Simply add:
GRUB_DISTRIBUTO
to a file in /etc/default/
$ sudo update-grub
$ sudo reboot
Test packages are available in the following ppa:
https:/
If you install these test packages, you should be able to upgrade grub and reboot without issue.
[Where problems could occur]
We will be changing the grub configuration for every Google cloud instance started with an image produced before 2020-11-11, and there is risk that we could make a change which prevents instances from booting. We should proceed with caution and make sure to test older and newer images.
The fix will be targeted to the /etc/default/
[Other info]
A workaround is to remove the below line from /etc/default/
GRUB_DISTRIBUTO
Changed in grub2 (Ubuntu): | |
status: | New → Fix Released |
Changed in grub2 (Ubuntu Xenial): | |
importance: | Undecided → Critical |
status: | New → In Progress |
tags: | added: sts xenial |
description: | updated |
affects: | grub2 (Ubuntu) → grub2-signed (Ubuntu) |
Changed in grub2-signed (Ubuntu): | |
status: | Fix Released → Invalid |
description: | updated |
Attached is a debdiff for grub2-signed which issues a sed to remove the GRUB_DISTRIBUTO R=Debian line from /etc/default/ grub.d/ 50-cloudimg- settings. cfg