2

This question is migrated from SuperUser because I got no feedback there. I hope to have better luck here.

Most likely my problem is a bit deeper than what Subject says.

FOCUS:

My root problem seems to be GRUB2 doesn't install cleanly, even booting from a "live" install media. All other problems seem to be consequences. Some details in UPDATE 3; I will leave all history for reference.

A bit of history:

  • This workstation was born as a Debian SID machine with root on SSD (sda2, partition now gone) and a separate /home disk (now gone).
  • I added a Linux Mint 20 installation (sda5, current) reusing swap area (sda4).
  • Home disk started to fail (so S.M.A.R.T. said) and I replaced it with a ZFS array in raidz2 (sdc..sdf, current).
  • I converted sda DOS Partition Table to GPT.
  • In this situation I still had a "debian" boot menu displayed by GRUB.
  • I installed a brand new disk (sdb) and I installed Windows10 on it. Note that:
    • I removed (disconnected physically) all disks while installing to prevent "unintended update" of other partitions.
    • This disk is actually in a removable bay, so it might happen it's "missing" and thus all other drive names get shifted to sdb..sde.
    • This disk is actually in a removable bay, so it can be changed (I actually use this for backups).
  • Later on I disposed of Debian partition as it was unused.

Current situation is a bit strange:

  • BIOS "boot override menu" displays:
    • Debian boot menu (non-functional, if selected a blinking cursor on top left is all that I can see).
    • Windows Boot manager (functional, correctly starts Win10)
    • Disk0 (sda, functional, boots Linux Mint)
    • all other disks (not tried)
  • BIOS default boot is set to Disk0, but it will not start automatically, I need to "boot override" each time.
  • Linux Mint reboot command does not seem to go through BIOS and I cannot (i.e.: I did not find a way to) override boot, so it will hang.
  • update-grub does not change anything and does not see Win even if win partition is mounted (see below).
  • install-grub /dev/sda refuses to work because I have a UEFI BIOS.
  • grub-install --target=x86_64-efi --efi-directory=/tmp/esp --bootloader-id=GRUB fails (see below).
  • grub-install --target=i386-pc --efi-directory=/tmp/esp --bootloader-id=GRUB still fails (with a different messsage).

How can I correct this situation?

mcon@cinderella:~$ sudo -i
root@cinderella:~# mount /dev/sdb4 /mnt
root@cinderella:~# lsblk
NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda      8:0    0 931,5G  0 disk 
├─sda1   8:1    0   476M  0 part 
├─sda4   8:4    0   3,7G  0 part [SWAP]
└─sda5   8:5    0 143,1G  0 part /
sdb      8:16   0 698,7G  0 disk 
├─sdb1   8:17   0   499M  0 part 
├─sdb2   8:18   0   100M  0 part 
├─sdb3   8:19   0    16M  0 part 
└─sdb4   8:20   0   698G  0 part /mnt
sdc      8:32   0   2,7T  0 disk 
├─sdc1   8:33   0   2,7T  0 part 
└─sdc9   8:41   0     8M  0 part 
sdd      8:48   0   2,7T  0 disk 
├─sdd1   8:49   0   2,7T  0 part 
└─sdd9   8:57   0     8M  0 part 
sde      8:64   0   2,7T  0 disk 
├─sde1   8:65   0   2,7T  0 part 
└─sde9   8:73   0     8M  0 part 
sdf      8:80   0   2,7T  0 disk 
├─sdf1   8:81   0   2,7T  0 part 
└─sdf9   8:89   0     8M  0 part 
root@cinderella:~# update-grub
Sourcing file `/etc/default/grub'
Sourcing file `/etc/default/grub.d/50_linuxmint.cfg'
Sourcing file `/etc/default/grub.d/init-select.cfg'
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-5.4.0-53-generic
Found initrd image: /boot/initrd.img-5.4.0-53-generic
Found linux image: /boot/vmlinuz-5.4.0-52-generic
Found initrd image: /boot/initrd.img-5.4.0-52-generic
Found linux image: /boot/vmlinuz-5.4.0-51-generic
Found initrd image: /boot/initrd.img-5.4.0-51-generic
Found linux image: /boot/vmlinuz-5.4.0-40-generic
Found initrd image: /boot/initrd.img-5.4.0-40-generic
Found linux image: /boot/vmlinuz-5.4.0-26-generic
Found initrd image: /boot/initrd.img-5.4.0-26-generic
device-mapper: reload ioctl on osprober-linux-sdc1  failed: Device or resource busy
Command failed.
device-mapper: reload ioctl on osprober-linux-sdd1  failed: Device or resource busy
Command failed.
device-mapper: reload ioctl on osprober-linux-sde1  failed: Device or resource busy
Command failed.
device-mapper: reload ioctl on osprober-linux-sdf1  failed: Device or resource busy
Command failed.
done
root@cinderella:~# mkdir /tmp/esp
root@cinderella:~# mount /dev/sda1 /tmp/esp
root@cinderella:~# grub-install --target=x86_64-efi --efi-directory=/tmp/esp --bootloader-id=GRUB
grub-install: error: /usr/lib/grub/x86_64-efi/modinfo.sh doesn't exist. Please specify --target or --directory.
root@cinderella:~# grub-install --target=i386-pc --efi-directory=/tmp/esp --bootloader-id=GRUB
Installing for i386-pc platform.
grub-install: error: install device isn't specified.

UPDATE 1:

Note: I seem to ask multiple questions here because I strongly suspect my root problem is one and it causes all (or most of) symptoms I report. I do not believe they are unrelated questions.

Following advice I ran grub-mkconfig (see listing below) which actually does run os-probe, but apparently it does not see win10 installation on /dev/sdb4, mounted on /mnt.

I see errors on sdc1..sdf1 (my zfs array; I assume this is normal) but I se no mention of sdb at all.

Any further advice?

mcon@cinderella:~$ sudo -i
root@cinderella:~# mount /dev/sdb4 /mnt
root@cinderella:~# apt install os-prober
Reading package lists... Done
Building dependency tree       
Reading state information... Done
os-prober is already the newest version (1.74ubuntu2).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
root@cinderella:~# grub-mkconfig
Sourcing file `/etc/default/grub'
Sourcing file `/etc/default/grub.d/50_linuxmint.cfg'
Sourcing file `/etc/default/grub.d/init-select.cfg'
Generating grub configuration file ...
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

### BEGIN /etc/grub.d/00_header ###
if [ -s $prefix/grubenv ]; then
  set have_grubenv=true
  load_env
fi
if [ "${initrdfail}" = 2 ]; then
   set initrdfail=
elif [ "${initrdfail}" = 1 ]; then
   set next_entry="${prev_entry}"
   set prev_entry=
   save_env prev_entry
   if [ "${next_entry}" ]; then
      set initrdfail=2
   fi
fi
if [ "${next_entry}" ] ; then
   set default="${next_entry}"
   set next_entry=
   save_env next_entry
   set boot_once=true
else
   set default="0"
fi

if [ x"${feature_menuentry_id}" = xy ]; then
  menuentry_id_option="--id"
else
  menuentry_id_option=""
fi

export menuentry_id_option

if [ "${prev_saved_entry}" ]; then
  set saved_entry="${prev_saved_entry}"
  save_env saved_entry
  set prev_saved_entry=
  save_env prev_saved_entry
  set boot_once=true
fi

function savedefault {
  if [ -z "${boot_once}" ]; then
    saved_entry="${chosen}"
    save_env saved_entry
  fi
}
function initrdfail {
    if [ -n "${have_grubenv}" ]; then if [ -n "${partuuid}" ]; then
      if [ -z "${initrdfail}" ]; then
        set initrdfail=1
        if [ -n "${boot_once}" ]; then
          set prev_entry="${default}"
          save_env prev_entry
        fi
      fi
      save_env initrdfail
    fi; fi
}
function recordfail {
  set recordfail=1
  if [ -n "${have_grubenv}" ]; then if [ -z "${boot_once}" ]; then save_env recordfail; fi; fi
}
function load_video {
  if [ x$feature_all_video_module = xy ]; then
    insmod all_video
  else
    insmod efi_gop
    insmod efi_uga
    insmod ieee1275_fb
    insmod vbe
    insmod vga
    insmod video_bochs
    insmod video_cirrus
  fi
}

if [ x$feature_default_font_path = xy ] ; then
   font=unicode
else
insmod part_gpt
insmod ext2
set root='hd0,gpt5'
if [ x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt5 --hint-efi=hd0,gpt5 --hint-baremetal=ahci0,gpt5  cb358c7d-8b36-47d5-b59d-fd66e2b1ef74
else
  search --no-floppy --fs-uuid --set=root cb358c7d-8b36-47d5-b59d-fd66e2b1ef74
fi
    font="/usr/share/grub/unicode.pf2"
fi

if loadfont $font ; then
  set gfxmode=auto
  load_video
  insmod gfxterm
  set locale_dir=$prefix/locale
  set lang=en_US
  insmod gettext
fi
terminal_output gfxterm
if [ "${recordfail}" = 1 ] ; then
  set timeout=30
else
  if [ x$feature_timeout_style = xy ] ; then
    set timeout_style=hidden
    set timeout=10
  # Fallback hidden-timeout code in case the timeout_style feature is
  # unavailable.
  elif sleep --interruptible 10 ; then
    set timeout=0
  fi
fi
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/05_debian_theme ###
set menu_color_normal=white/black
set menu_color_highlight=black/light-gray
### END /etc/grub.d/05_debian_theme ###

### BEGIN /etc/grub.d/10_linux ###
function gfxmode {
    set gfxpayload="${1}"
    if [ "${1}" = "keep" ]; then
        set vt_handoff=vt.handoff=7
    else
        set vt_handoff=
    fi
}
if [ "${recordfail}" != 1 ]; then
  if [ -e ${prefix}/gfxblacklist.txt ]; then
    if hwmatch ${prefix}/gfxblacklist.txt 3; then
      if [ ${match} = 0 ]; then
        set linux_gfx_mode=keep
      else
        set linux_gfx_mode=text
      fi
    else
      set linux_gfx_mode=text
    fi
  else
    set linux_gfx_mode=keep
  fi
else
  set linux_gfx_mode=text
fi
export linux_gfx_mode
Found linux image: /boot/vmlinuz-5.4.0-54-generic
Found initrd image: /boot/initrd.img-5.4.0-54-generic
menuentry 'Ubuntu' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-cb358c7d-8b36-47d5-b59d-fd66e2b1ef74' {
    recordfail
    load_video
    gfxmode $linux_gfx_mode
    insmod gzio
    if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
    insmod part_gpt
    insmod ext2
    set root='hd0,gpt5'
    if [ x$feature_platform_search_hint = xy ]; then
      search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt5 --hint-efi=hd0,gpt5 --hint-baremetal=ahci0,gpt5  cb358c7d-8b36-47d5-b59d-fd66e2b1ef74
    else
      search --no-floppy --fs-uuid --set=root cb358c7d-8b36-47d5-b59d-fd66e2b1ef74
    fi
    linux   /boot/vmlinuz-5.4.0-54-generic root=UUID=cb358c7d-8b36-47d5-b59d-fd66e2b1ef74 ro  quiet splash $vt_handoff
    initrd  /boot/initrd.img-5.4.0-54-generic
}
submenu 'Advanced options for Ubuntu' $menuentry_id_option 'gnulinux-advanced-cb358c7d-8b36-47d5-b59d-fd66e2b1ef74' {
    menuentry 'Ubuntu, with Linux 5.4.0-54-generic' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-5.4.0-54-generic-advanced-cb358c7d-8b36-47d5-b59d-fd66e2b1ef74' {
        recordfail
        load_video
        gfxmode $linux_gfx_mode
        insmod gzio
        if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
        insmod part_gpt
        insmod ext2
        set root='hd0,gpt5'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt5 --hint-efi=hd0,gpt5 --hint-baremetal=ahci0,gpt5  cb358c7d-8b36-47d5-b59d-fd66e2b1ef74
        else
          search --no-floppy --fs-uuid --set=root cb358c7d-8b36-47d5-b59d-fd66e2b1ef74
        fi
        echo    'Loading Linux 5.4.0-54-generic ...'
        linux   /boot/vmlinuz-5.4.0-54-generic root=UUID=cb358c7d-8b36-47d5-b59d-fd66e2b1ef74 ro  quiet splash $vt_handoff
        echo    'Loading initial ramdisk ...'
        initrd  /boot/initrd.img-5.4.0-54-generic
    }
    menuentry 'Ubuntu, with Linux 5.4.0-54-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-5.4.0-54-generic-recovery-cb358c7d-8b36-47d5-b59d-fd66e2b1ef74' {
        recordfail
        load_video
        insmod gzio
        if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
        insmod part_gpt
        insmod ext2
        set root='hd0,gpt5'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt5 --hint-efi=hd0,gpt5 --hint-baremetal=ahci0,gpt5  cb358c7d-8b36-47d5-b59d-fd66e2b1ef74
        else
          search --no-floppy --fs-uuid --set=root cb358c7d-8b36-47d5-b59d-fd66e2b1ef74
        fi
        echo    'Loading Linux 5.4.0-54-generic ...'
        linux   /boot/vmlinuz-5.4.0-54-generic root=UUID=cb358c7d-8b36-47d5-b59d-fd66e2b1ef74 ro recovery nomodeset dis_ucode_ldr 
        echo    'Loading initial ramdisk ...'
        initrd  /boot/initrd.img-5.4.0-54-generic
    }
Found linux image: /boot/vmlinuz-5.4.0-53-generic
Found initrd image: /boot/initrd.img-5.4.0-53-generic
    menuentry 'Ubuntu, with Linux 5.4.0-53-generic' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-5.4.0-53-generic-advanced-cb358c7d-8b36-47d5-b59d-fd66e2b1ef74' {
        recordfail
        load_video
        gfxmode $linux_gfx_mode
        insmod gzio
        if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
        insmod part_gpt
        insmod ext2
        set root='hd0,gpt5'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt5 --hint-efi=hd0,gpt5 --hint-baremetal=ahci0,gpt5  cb358c7d-8b36-47d5-b59d-fd66e2b1ef74
        else
          search --no-floppy --fs-uuid --set=root cb358c7d-8b36-47d5-b59d-fd66e2b1ef74
        fi
        echo    'Loading Linux 5.4.0-53-generic ...'
        linux   /boot/vmlinuz-5.4.0-53-generic root=UUID=cb358c7d-8b36-47d5-b59d-fd66e2b1ef74 ro  quiet splash $vt_handoff
        echo    'Loading initial ramdisk ...'
        initrd  /boot/initrd.img-5.4.0-53-generic
    }
    menuentry 'Ubuntu, with Linux 5.4.0-53-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-5.4.0-53-generic-recovery-cb358c7d-8b36-47d5-b59d-fd66e2b1ef74' {
        recordfail
        load_video
        insmod gzio
        if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
        insmod part_gpt
        insmod ext2
        set root='hd0,gpt5'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt5 --hint-efi=hd0,gpt5 --hint-baremetal=ahci0,gpt5  cb358c7d-8b36-47d5-b59d-fd66e2b1ef74
        else
          search --no-floppy --fs-uuid --set=root cb358c7d-8b36-47d5-b59d-fd66e2b1ef74
        fi
        echo    'Loading Linux 5.4.0-53-generic ...'
        linux   /boot/vmlinuz-5.4.0-53-generic root=UUID=cb358c7d-8b36-47d5-b59d-fd66e2b1ef74 ro recovery nomodeset dis_ucode_ldr 
        echo    'Loading initial ramdisk ...'
        initrd  /boot/initrd.img-5.4.0-53-generic
    }
Found linux image: /boot/vmlinuz-5.4.0-26-generic
Found initrd image: /boot/initrd.img-5.4.0-26-generic
    menuentry 'Ubuntu, with Linux 5.4.0-26-generic' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-5.4.0-26-generic-advanced-cb358c7d-8b36-47d5-b59d-fd66e2b1ef74' {
        recordfail
        load_video
        gfxmode $linux_gfx_mode
        insmod gzio
        if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
        insmod part_gpt
        insmod ext2
        set root='hd0,gpt5'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt5 --hint-efi=hd0,gpt5 --hint-baremetal=ahci0,gpt5  cb358c7d-8b36-47d5-b59d-fd66e2b1ef74
        else
          search --no-floppy --fs-uuid --set=root cb358c7d-8b36-47d5-b59d-fd66e2b1ef74
        fi
        echo    'Loading Linux 5.4.0-26-generic ...'
        linux   /boot/vmlinuz-5.4.0-26-generic root=UUID=cb358c7d-8b36-47d5-b59d-fd66e2b1ef74 ro  quiet splash $vt_handoff
        echo    'Loading initial ramdisk ...'
        initrd  /boot/initrd.img-5.4.0-26-generic
    }
    menuentry 'Ubuntu, with Linux 5.4.0-26-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-5.4.0-26-generic-recovery-cb358c7d-8b36-47d5-b59d-fd66e2b1ef74' {
        recordfail
        load_video
        insmod gzio
        if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
        insmod part_gpt
        insmod ext2
        set root='hd0,gpt5'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt5 --hint-efi=hd0,gpt5 --hint-baremetal=ahci0,gpt5  cb358c7d-8b36-47d5-b59d-fd66e2b1ef74
        else
          search --no-floppy --fs-uuid --set=root cb358c7d-8b36-47d5-b59d-fd66e2b1ef74
        fi
        echo    'Loading Linux 5.4.0-26-generic ...'
        linux   /boot/vmlinuz-5.4.0-26-generic root=UUID=cb358c7d-8b36-47d5-b59d-fd66e2b1ef74 ro recovery nomodeset dis_ucode_ldr 
        echo    'Loading initial ramdisk ...'
        initrd  /boot/initrd.img-5.4.0-26-generic
    }
}

### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/10_linux_zfs ###
### END /etc/grub.d/10_linux_zfs ###

### BEGIN /etc/grub.d/20_linux_xen ###

### END /etc/grub.d/20_linux_xen ###

### BEGIN /etc/grub.d/30_os-prober ###
device-mapper: reload ioctl on osprober-linux-sdc1  failed: Device or resource busy
Command failed.
device-mapper: reload ioctl on osprober-linux-sdd1  failed: Device or resource busy
Command failed.
device-mapper: reload ioctl on osprober-linux-sde1  failed: Device or resource busy
Command failed.
device-mapper: reload ioctl on osprober-linux-sdf1  failed: Device or resource busy
Command failed.
### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/30_uefi-firmware ###
### END /etc/grub.d/30_uefi-firmware ###

### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.
### END /etc/grub.d/40_custom ###

### BEGIN /etc/grub.d/41_custom ###
if [ -f  ${config_directory}/custom.cfg ]; then
  source ${config_directory}/custom.cfg
elif [ -z "${config_directory}" -a -f  $prefix/custom.cfg ]; then
  source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ###
done

UPDATE 2:

Following advice here I reinstalled GRUB completely; in a few moments I will see if situation changed somehow (win10 seems still missing though).

root@cinderella:~# apt-get install --reinstall grub-efi-amd64
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  grub-efi-amd64-bin grub-efi-amd64-signed
The following packages will be REMOVED:
  grub-gfxpayload-lists grub-pc
The following NEW packages will be installed:
  grub-efi-amd64 grub-efi-amd64-bin grub-efi-amd64-signed
0 upgraded, 3 newly installed, 2 to remove and 0 not upgraded.
Need to get 1.219 kB of archives.
After this operation, 11,6 MB of additional disk space will be used.
Do you want to continue? [Y/n] 
Get:1 http://es-mirrors.evowise.com/ubuntu focal-updates/main amd64 grub-efi-amd64-bin amd64 2.04-1ubuntu26.6 [703 kB]
Get:2 http://es-mirrors.evowise.com/ubuntu focal-updates/main amd64 grub-efi-amd64 amd64 2.04-1ubuntu26.6 [46,7 kB]
Get:3 http://es-mirrors.evowise.com/ubuntu focal-updates/main amd64 grub-efi-amd64-signed amd64 1.142.8+2.04-1ubuntu26.6 [469 kB]
Fetched 1.219 kB in 1s (1.030 kB/s)            
Preconfiguring packages ...
(Reading database ... 466657 files and directories currently installed.)
Removing grub-pc (2.04-1ubuntu26.6) ...
Removing grub-gfxpayload-lists (0.7) ...
Selecting previously unselected package grub-efi-amd64-bin.
(Reading database ... 466635 files and directories currently installed.)
Preparing to unpack .../grub-efi-amd64-bin_2.04-1ubuntu26.6_amd64.deb ...
Unpacking grub-efi-amd64-bin (2.04-1ubuntu26.6) ...
Selecting previously unselected package grub-efi-amd64.
Preparing to unpack .../grub-efi-amd64_2.04-1ubuntu26.6_amd64.deb ...
Unpacking grub-efi-amd64 (2.04-1ubuntu26.6) ...
Selecting previously unselected package grub-efi-amd64-signed.
Preparing to unpack .../grub-efi-amd64-signed_1.142.8+2.04-1ubuntu26.6_amd64.deb ...
Unpacking grub-efi-amd64-signed (1.142.8+2.04-1ubuntu26.6) ...
Setting up grub-efi-amd64-bin (2.04-1ubuntu26.6) ...
Setting up grub-efi-amd64 (2.04-1ubuntu26.6) ...
Sourcing file `/etc/default/grub'
Sourcing file `/etc/default/grub.d/50_linuxmint.cfg'
Sourcing file `/etc/default/grub.d/init-select.cfg'
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-5.4.0-54-generic
Found initrd image: /boot/initrd.img-5.4.0-54-generic
Found linux image: /boot/vmlinuz-5.4.0-53-generic
Found initrd image: /boot/initrd.img-5.4.0-53-generic
Found linux image: /boot/vmlinuz-5.4.0-26-generic
Found initrd image: /boot/initrd.img-5.4.0-26-generic
device-mapper: reload ioctl on osprober-linux-sdc1  failed: Device or resource busy
Command failed.
device-mapper: reload ioctl on osprober-linux-sdd1  failed: Device or resource busy
Command failed.
device-mapper: reload ioctl on osprober-linux-sde1  failed: Device or resource busy
Command failed.
device-mapper: reload ioctl on osprober-linux-sdf1  failed: Device or resource busy
Command failed.
done
Setting up grub-efi-amd64-signed (1.142.8+2.04-1ubuntu26.6) ...
Processing triggers for man-db (2.9.1-1) ...

UPDATE 2 Report:

No change after reinstall. I still see the (not working) "debian" boot item in BIOS and can still boot Linux Mint by selecting the first physical drive.

UPDATE 3

As advised by @oldfred I tried running boot-repair after:

  • fixing /etc/fstab deleting obsolete reference to /dev/sda2 (old debian install, now removed).
  • booting from Linux Mint install media (USB key).

Boot-repair suggested some fixes and, after a review, I let it do his things without any changes.

It ended in error.

An error occurred during the repair.

Locked-ESP detected. You may want to retry after creating a /boot/efi partition (FAT32, 100MB~250MB, start of the disk, boot flag). This can be performed via tools such as gParted. Then select this partition via the [Separate /boot/efi partition:] option of [Boot Repair].

After a bit of internet search I complied and:

  • ran gparted
  • deleted /dev/sda1 (UEFI) partition
  • re-created a 128MiB partition (again /dev/sda1, different size) formatted as FAT32
  • set boot flag on partition
  • re-ran boot-repair
  • checked Separate /boot/efi partition: was actually pointing to /dev/sda1
  • allowed it to run.
  • got the same, identical, error.

Logs for both run are available if deemed useful (just ask, I'll upload to some pastebin site).

UPDATE 4:

After complete delete/recreate of the UEFI partition on boot disk (/dev/sda1) and several GRUB2 reinstall attempts I now have the following "stable" situation:

  • if I boot without manual intervention I get into Linux Mint (/dev/sda4).
  • if I stop BIOS and ask for "alternate boot" I get a menu (from BIOS) containing:
    [                    empty line                     ]
    [ Windows Boot Manager (P1: ST750LM022 HN-M750MB B) ]
    [           UEFI OS (P0: CT1000MX500SSD4)           ]
    [                P0: CT1000MX500SSD4                ]
    [                P3: TOSHIBA HDWD130                ]
    [                P4: TOSHIBA HDWD130                ]
    [                P5: TOSHIBA HDWD130                ]
    [                P2: TOSHIBA HDWD130                ]
    [             P1: ST750LM022 HN-M750MB B            ]
    [                   Enter Setup                     ]
  • Windows Boot... correctly boots Win10.
  • UEFI OS will display GRUB menu.
  • GRUB menu will have two "Windows entries", but selecting them will just display an "Invalid signature" message; only the Linux-related entries appear functional.

Please advise.

  • 1
    I think the reason you got no response was that you've asked too many questions. Break down your problem into smaller chunks and ask several smaller questions. I see comments about missing windows 10 in the grub menu, bios default disk selections, reboot not working, cannot re-install grub, – Stewart Nov 20 '20 at 9:37
0

There are lots of questions here. I'm just going to answer the question about the missing windows 10 indicated by the title.

Ensure you have the package os-prober installed. apt install os-prober should do it. This application is used by grub to detect other operating systems.

Next run sudo grub-mkconfig. The output is printed to stdout. You should see something like this in the log:

### BEGIN /etc/grub.d/30_os-prober ###
Found Windows 10 on /dev/sda1
menuentry 'Windows 10 (on /dev/sda1)' --class windows --class os $menuentry_id_option 'osprober-chain-967C12CC7C12A6D1' {
        insmod part_msdos
        insmod ntfs
        set root='hd0,msdos1'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1  967C12CC7C12A6D1
        else
          search --no-floppy --fs-uuid --set=root 967C12CC7C12A6D1
        fi
        parttool ${root} hidden-
        drivemap -s (hd0) ${root}
        chainloader +1
}
### END /etc/grub.d/30_os-prober ###

If so, then you can really see that os-prober was called. If you're happy with the output, then run the command again and pipe it to /boot/ like so: sudo grub-mkconfig > /boot/grub/grub.cfg

Here's how it works:

grub-common deploys /etc/grub.d/30_os-prober which is read and run by grub-mkconfig. This will run os-prober if:

  1. it exists (package is installed), and
  2. GRUB_DISABLE_OS_PROBER is not "true"
  • Thanks. I updated OP to reflect tests. Quick summary: os-probe is run but it does not seem to touch won10 partition (/dev/sdb4) at all. – ZioByte Nov 20 '20 at 11:03
  • Grub can only boot other installs in same boot mode, or both installs must be UEFI or both installs the now very old BIOS. UEFI & BIOS are not compatible, they write data for operating system differently onto drive. Some systems will reboot into the other mode to allow both BIOS & UEFI, but grub does not do that. – oldfred Nov 20 '20 at 14:42
  • @oldfred: Both systems are UEFI (bios is in UEFI mode, at the very least); problem might be they have two, completely unrelated, "EFI System partitions" one is on sda1 and the other in sdb2. Might that be a problem? if so how can I bring them together? (possibly without a full reinstall) – ZioByte Nov 21 '20 at 0:12
  • I have ESP on every drive and that is not the issue. I have to turn os-prober off to prevent it from finding my obsolete installs as I use a new 30GB partition for every new install. Lets see details, use ppa version with your live installer (2nd option) or any working install, not Boot-Repair ISO: Please copy & paste the pastebin link to the Boot-info summary report ( do not post report), do not run the auto fix till reviewed. help.ubuntu.com/community/Boot-Repair – oldfred Nov 21 '20 at 3:29
  • @oldfred: Thanks. boot-repair summary is at paste2.org/vND7w2nA It was created using stock Linux Mint boot-repair, I did not boot any kind of "live distribution" (sdg is an old linux Mint installation USB-drive I happened to have inserted, disregard it). Please let me know how I should proceed. – ZioByte Nov 21 '20 at 11:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.