grub-multi-install offers wrong devices as ESP

Bug #1997795 reported by Julian Andres Klode
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
grub2 (Ubuntu)
Fix Released
Undecided
Unassigned
Focal
Fix Released
Undecided
Unassigned
Jammy
Fix Released
Undecided
Unassigned
Kinetic
Fix Released
Undecided
Unassigned

Bug Description

[Impact]
grub-multi-install offers the wrong device as ESP if a previous partition was recognized, because it does not correctly reset state between loop iterations, causing people to be offered e.g. the entire disk device as an ESP, and then install to obviously fail.

[Test plan]
Launch a lxd VM, run
 dpkg-reconfigure shim-signed

check that only the ESP appears.

Before the update, /dev/sda itself would appear as well.

[Where problems could occur]
Most importantly, some firmware are less restrictive about ESPs than grub-multi-install is, and if we previously accidentally "recognized" the partition as an ESP and now no longer do, grub does not get updated.

description: updated
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package grub2 - 2.06-2ubuntu15

---------------
grub2 (2.06-2ubuntu15) lunar; urgency=medium

  * grub-multi-install: Reset partition type between partitions (LP: #1997795)

 -- Julian Andres Klode <email address hidden> Thu, 01 Dec 2022 16:30:53 +0100

Changed in grub2 (Ubuntu):
status: New → Fix Released
Revision history for this message
Steve Langasek (vorlon) wrote : Please test proposed package

Hello Julian, or anyone else affected,

Accepted grub2 into focal-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/grub2/2.04-1ubuntu26.16 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-focal to verification-done-focal. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-focal. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in grub2 (Ubuntu Focal):
status: New → Fix Committed
tags: added: verification-needed verification-needed-focal
Revision history for this message
Timo Aaltonen (tjaalton) wrote :

Hello Julian, or anyone else affected,

Accepted grub2 into kinetic-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/grub2/2.06-2ubuntu12.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-kinetic to verification-done-kinetic. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-kinetic. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in grub2 (Ubuntu Kinetic):
status: New → Fix Committed
tags: added: verification-needed-kinetic
Changed in grub2 (Ubuntu Jammy):
status: New → Fix Committed
tags: added: verification-needed-jammy
Revision history for this message
Timo Aaltonen (tjaalton) wrote :

Hello Julian, or anyone else affected,

Accepted grub2 into jammy-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/grub2/2.06-2ubuntu7.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-jammy to verification-done-jammy. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-jammy. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Revision history for this message
Mauricio Faria de Oliveira (mfo) wrote :

Verification done on kinetic-proposed.
---

$ lxc launch --vm ubuntu:kinetic grub2-k
$ lxc shell grub2-k

Before: /dev/sda15 (esp) AND /dev/sda

 # dpkg -S /usr/lib/grub/grub-multi-install
 grub-common: /usr/lib/grub/grub-multi-install

 # apt-cache policy grub-common
 grub-common:
   Installed: 2.06-2ubuntu12
   Candidate: 2.06-2ubuntu12
   Version table:
  *** 2.06-2ubuntu12 500
  500 http://archive.ubuntu.com/ubuntu kinetic/main amd64 Packages
  100 /var/lib/dpkg/status

 # DEBIAN_FRONTEND=readline dpkg-reconfigure shim-signed
 Configuring shim-signed
 -----------------------

 The grub-efi package is being upgraded. This menu allows you to select which EFI system
 partions you'd like grub-install to be automatically run for, if any.

 Running grub-install automatically is recommended in most situations, to prevent the installed
 GRUB core image from getting out of sync with GRUB modules or grub.cfg.

   1. /dev/sda (10737 MB; ) on 10737 MB QEMU_HARDDISK 3. none of the above
   2. /dev/sda15 (111 MB; /boot/efi) on 10737 MB QEMU_HARDDISK

 (Enter the items or ranges you want to select, separated by spaces.)

 GRUB EFI system partitions: ^C

After: /dev/sda15 (esp) ONLY

 # add-apt-repository -yp proposed
 # apt install -y grub-common
 # apt-cache policy grub-common
 grub-common:
   Installed: 2.06-2ubuntu12.1
   Candidate: 2.06-2ubuntu12.1
   Version table:
  *** 2.06-2ubuntu12.1 500
  500 http://archive.ubuntu.com/ubuntu kinetic-proposed/main amd64 Packages
  500 http://security.ubuntu.com/ubuntu kinetic-proposed/main amd64 Packages
  100 /var/lib/dpkg/status
      2.06-2ubuntu12 500
  500 http://archive.ubuntu.com/ubuntu kinetic/main amd64 Packages

 # DEBIAN_FRONTEND=readline dpkg-reconfigure shim-signed
 Configuring shim-signed
 -----------------------

 The grub-efi package is being upgraded. This menu allows you to select which EFI system
 partions you'd like grub-install to be automatically run for, if any.

 Running grub-install automatically is recommended in most situations, to prevent the installed
 GRUB core image from getting out of sync with GRUB modules or grub.cfg.

   1. /dev/sda15 (111 MB; /boot/efi) on 10737 MB QEMU_HARDDISK 2. none of the above

 (Enter the items or ranges you want to select, separated by spaces.)

 GRUB EFI system partitions: ^C

Revision history for this message
Mauricio Faria de Oliveira (mfo) wrote :

Verification done on jammy-proposed.
---

$ lxc launch --vm ubuntu:jammy grub2-j
$ lxc shell grub2-j

Before: /dev/sda15 (esp) AND /dev/sda

 # dpkg -S /usr/lib/grub/grub-multi-install
 grub-common: /usr/lib/grub/grub-multi-install

 # apt-cache policy grub-common
 grub-common:
   Installed: 2.06-2ubuntu7
   Candidate: 2.06-2ubuntu7
   Version table:
  *** 2.06-2ubuntu7 500
  500 http://archive.ubuntu.com/ubuntu jammy/main amd64 Packages
  100 /var/lib/dpkg/status

 # DEBIAN_FRONTEND=readline dpkg-reconfigure shim-signed
 Trying to migrate /boot/efi into esp config
 Configuring shim-signed
 -----------------------

 The grub-efi package is being upgraded. This menu allows you to select which EFI system
 partions you'd like grub-install to be automatically run for, if any.

 Running grub-install automatically is recommended in most situations, to prevent the installed
 GRUB core image from getting out of sync with GRUB modules or grub.cfg.

   1. /dev/sda (10737 MB; ) on 10737 MB QEMU_HARDDISK 3. none of the above
   2. /dev/sda15 (111 MB; /boot/efi) on 10737 MB QEMU_HARDDISK

 (Enter the items or ranges you want to select, separated by spaces.)

 GRUB EFI system partitions: ^C

After: /dev/sda15 (esp) ONLY

 # add-apt-repository -yp proposed
 # apt install -y grub-common
 # apt-cache policy grub-common
 grub-common:
   Installed: 2.06-2ubuntu7.1
   Candidate: 2.06-2ubuntu7.1
   Version table:
  *** 2.06-2ubuntu7.1 500
  500 http://security.ubuntu.com/ubuntu jammy-proposed/main amd64 Packages
  500 http://archive.ubuntu.com/ubuntu jammy-proposed/main amd64 Packages
  100 /var/lib/dpkg/status
      2.06-2ubuntu7 500
  500 http://archive.ubuntu.com/ubuntu jammy/main amd64 Packages

 # DEBIAN_FRONTEND=readline dpkg-reconfigure shim-signed
 Trying to migrate /boot/efi into esp config
 Configuring shim-signed
 -----------------------

 The grub-efi package is being upgraded. This menu allows you to select which EFI system
 partions you'd like grub-install to be automatically run for, if any.

 Running grub-install automatically is recommended in most situations, to prevent the installed
 GRUB core image from getting out of sync with GRUB modules or grub.cfg.

   1. /dev/sda15 (111 MB; /boot/efi) on 10737 MB QEMU_HARDDISK 2. none of the above

 (Enter the items or ranges you want to select, separated by spaces.)

 GRUB EFI system partitions: ^C

Revision history for this message
Mauricio Faria de Oliveira (mfo) wrote :

Verification done on focal-proposed.
---

$ lxc launch --vm ubuntu:focal grub2-f
$ lxc shell grub2-f

Before: /dev/sda15 (esp) AND /dev/sda

 # dpkg -S /usr/lib/grub/grub-multi-install
 grub-common: /usr/lib/grub/grub-multi-install

 # apt-cache policy grub-common
 grub-common:
   Installed: 2.04-1ubuntu26.15
   Candidate: 2.04-1ubuntu26.15
   Version table:
  *** 2.04-1ubuntu26.15 500
  500 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages
  100 /var/lib/dpkg/status
      2.04-1ubuntu26.12 500
  500 http://security.ubuntu.com/ubuntu focal-security/main amd64 Packages
      2.04-1ubuntu26 500
  500 http://archive.ubuntu.com/ubuntu focal/main amd64 Packages

 # DEBIAN_FRONTEND=readline dpkg-reconfigure shim-signed
 Trying to migrate /boot/efi into esp config
 Configuring shim-signed
 -----------------------

 The grub-efi package is being upgraded. This menu allows you to select which EFI system partions you'd like grub-install to be automatically
 run for, if any.

 Running grub-install automatically is recommended in most situations, to prevent the installed GRUB core image from getting out of sync with
 GRUB modules or grub.cfg.

   1. /dev/sda (10737 MB; ) on 10737 MB QEMU_HARDDISK 2. /dev/sda15 (111 MB; /boot/efi) on 10737 MB QEMU_HARDDISK 3. none of the above

 (Enter the items you want to select, separated by spaces.)

 GRUB EFI system partitions: ^C

After: /dev/sda15 (esp) ONLY

 # add-apt-repository -y 'deb http://archive.ubuntu.com/ubuntu focal-proposed main'
 # apt install -y grub-common
 # apt-cache policy grub-common
 grub-common:
   Installed: 2.04-1ubuntu26.16
   Candidate: 2.04-1ubuntu26.16
   Version table:
  *** 2.04-1ubuntu26.16 500
  500 http://archive.ubuntu.com/ubuntu focal-proposed/main amd64 Packages
  100 /var/lib/dpkg/status
      2.04-1ubuntu26.15 500
  500 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages
      2.04-1ubuntu26.12 500
  500 http://security.ubuntu.com/ubuntu focal-security/main amd64 Packages
      2.04-1ubuntu26 500
  500 http://archive.ubuntu.com/ubuntu focal/main amd64 Packages

 # DEBIAN_FRONTEND=readline dpkg-reconfigure shim-signed
 Trying to migrate /boot/efi into esp config
 Configuring shim-signed
 -----------------------

 The grub-efi package is being upgraded. This menu allows you to select which EFI system partions you'd like grub-install to be automatically
 run for, if any.

 Running grub-install automatically is recommended in most situations, to prevent the installed GRUB core image from getting out of sync with
 GRUB modules or grub.cfg.

   1. /dev/sda15 (111 MB; /boot/efi) on 10737 MB QEMU_HARDDISK 2. none of the above

 (Enter the items you want to select, separated by spaces.)

 GRUB EFI system partitions: ^C

Revision history for this message
Mauricio Faria de Oliveira (mfo) wrote :

Verification for SRUs performed as per SRU template.
Hope this helps! Otherwise, please just revert tags.

tags: added: verification-done verification-done-focal verification-done-jammy verification-done-kinetic
removed: verification-needed verification-needed-focal verification-needed-jammy verification-needed-kinetic
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package grub2 - 2.06-2ubuntu7.1

---------------
grub2 (2.06-2ubuntu7.1) jammy; urgency=medium

  * grub-multi-install: Reset partition type between partitions (LP: #1997795)

 -- Julian Andres Klode <email address hidden> Fri, 02 Dec 2022 16:18:47 +0100

Changed in grub2 (Ubuntu Jammy):
status: Fix Committed → Fix Released
Revision history for this message
Brian Murray (brian-murray) wrote : Update Released

The verification of the Stable Release Update for grub2 has completed successfully and the package is now being released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package grub2 - 2.06-2ubuntu12.1

---------------
grub2 (2.06-2ubuntu12.1) kinetic; urgency=medium

  * grub-multi-install: Reset partition type between partitions (LP: #1997795)

 -- Julian Andres Klode <email address hidden> Fri, 02 Dec 2022 15:54:08 +0100

Changed in grub2 (Ubuntu Kinetic):
status: Fix Committed → Fix Released
Revision history for this message
Julian Andres Klode (juliank) wrote :

Thanks Mauricio!

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package grub2 - 2.04-1ubuntu26.16

---------------
grub2 (2.04-1ubuntu26.16) focal; urgency=medium

  * grub-multi-install: Reset partition type between partitions (LP: #1997795)

 -- Julian Andres Klode <email address hidden> Fri, 02 Dec 2022 16:20:54 +0100

Changed in grub2 (Ubuntu Focal):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.