bugGNU GRUB - Bugs: bug #58815, GRUB2 probe fails on MS Reserved...


You are not allowed to post comments on this tracker with your current authentication level.

bug #58815: GRUB2 probe fails on MS Reserved partition

Submitted by:  Vincent Yu <vincentyu1130>
Submitted on:  Fri 24 Jul 2020 02:16:24 AM UTC  
Category:  Disk & Partition Severity:  Major
Priority:  5 - Normal Item Group:  Software Error
Status:  None Privacy:  Public
Assigned to:  None Originator Name: 
Open/Closed:  Open Release: 
Release:  other Reproducibility:  Intermittent
Planned Release:  None

Fri 24 Jul 2020 02:16:24 AM UTC, original submission:  

In my grub.cfg script for recovery boot linux, the "for dev in (*) do" loop, probing filesystem type generates gobbles of "failed to load module because of uefi secure boot" messages for the MS Reserved partition. This partition is basically a reservation and contains nothing. It should fail gracefully and return a false.

I'm on GRUB 2.04 from debian sid repository, h/w x86-64, windows 8.1 pro.

On a side note, there should be ways to probe for gpt partition types, but this will be a new feature request.

insmod regexp
set gptdevs=""
for dev in (*); do
  if regexp "\(hd[0-9],gpt[0-9]\)" $dev; then
    set gptdevs="${gptdevs} ${dev}"
rmmod regexp

set debfound=0
set winfound=0
set windev=""
set debdev=""
for dev in ${gptdevs}; do
  if ! probe -s fstype -f $dev; then continue; fi #assume=MS Reserved
  if [ $winfound -eq 0]; then
    if [ "$fstype" = "fat" ]; then
      if test -f $dev/EFI/Boot/bootx64.efi; then
        set windev=$dev
        set winfound=1
        if [ $debfound -eq 1]; then break; fi
  if [ $debfound -eq 0 ]; then
    if [ "$fstype" = "ext2" ]; then
      if test -f $dev/boot/vmlinuz-4.19.0-9-amd64; then
        probe -s uuid -u $dev
        set debdev=$dev
        set debfound=1
        if [ $winfound -eq 1]; then break; fi

if [ $debfound -eq 1]; then
menuentry "Debian 10" $debdev $uuid {
set root=$2
linux /boot/vmlinuz-4.19.0-9-amd64 root=UUID=$3 ro
initrd /boot/initrd.img-4.19.0-9-amd64
menuentry "Debian 10 (Single)" $devdev $uuid {
set root=$2
linux /boot/vmlinuz-4.19.0-9-amd64 root=UUID=$3 ro single
initrd /boot/initrd.img-4.19.0-9-amd64

if [ $winfound -eq 1]; then
menuentry "Windows" $windev {
set root=$2
chainloader /EFI/Boot/bootx64.efi

menuentry "Reboot" { reboot }
menuentry "Shutdown" { halt }
menuentry "SuperGrub Disk" { configfile "${prefix}/sgdgrub.cfg" }



Vincent Yu <vincentyu1130>


No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by vincentyu1130 (Submitted the item)

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.




    No changes have been made to this item

    Back to the top

    Powered by Savane 3.5