update-grub 不起作用 -- 找不到介质

cha*_*nya 8 boot grub2 lvm 20.04

我在 Thinkpad T480 上运行带有 LVM 和 UEFI 的 Ubuntu 20.04 LTS。

每当我运行时sudo update-grub,我都会得到以下输出:

Sourcing file `/etc/default/grub'
Sourcing file `/etc/default/grub.d/init-select.cfg'
Generating grub configuration file ...
  /dev/sdb: open failed: No medium found
  /dev/sdb: open failed: No medium found
  /dev/sdb: open failed: No medium found
  /dev/sdb: open failed: No medium found
  /dev/sdb: open failed: No medium found
  /dev/sdb: open failed: No medium found
  /dev/sdb: open failed: No medium found
  /dev/sdb: open failed: No medium found
  /dev/sdb: open failed: No medium found
  /dev/sdb: open failed: No medium found
  /dev/sdb: open failed: No medium found
  /dev/sdb: open failed: No medium found
  /dev/sdb: open failed: No medium found
  /dev/sdb: open failed: No medium found
  /dev/sdb: open failed: No medium found
  /dev/sdb: open failed: No medium found
  /dev/sdb: open failed: No medium found
  /dev/sdb: open failed: No medium found
  /dev/sdb: open failed: No medium found
  /dev/sdb: open failed: No medium found
  /dev/sdb: open failed: No medium found
  /dev/sdb: open failed: No medium found
  /dev/sdb: open failed: No medium found
  /dev/sdb: open failed: No medium found
Found linux image: /boot/vmlinuz-5.4.0-29-generic
Found initrd image: /boot/initrd.img-5.4.0-29-generic
  /dev/sdb: open failed: No medium found
  /dev/sdb: open failed: No medium found
  /dev/sdb: open failed: No medium found
  /dev/sdb: open failed: No medium found
  /dev/sdb: open failed: No medium found
  /dev/sdb: open failed: No medium found
  /dev/sdb: open failed: No medium found
  /dev/sdb: open failed: No medium found
  /dev/sdb: open failed: No medium found
  /dev/sdb: open failed: No medium found
  /dev/sdb: open failed: No medium found
  /dev/sdb: open failed: No medium found
  /dev/sdb: open failed: No medium found
  /dev/sdb: open failed: No medium found
  /dev/sdb: open failed: No medium found
  /dev/sdb: open failed: No medium found
Found linux image: /boot/vmlinuz-5.4.0-28-generic
Found initrd image: /boot/initrd.img-5.4.0-28-generic
Found linux image: /boot/vmlinuz-5.4.0-21-generic
Found initrd image: /boot/initrd.img-5.4.0-21-generic
  /dev/sdb: open failed: No medium found
  /dev/sdb: open failed: No medium found
  /dev/sdb: open failed: No medium found
  /dev/sdb: open failed: No medium found
  /dev/sdb: open failed: No medium found
  /dev/sdb: open failed: No medium found
Adding boot menu entry for UEFI Firmware Settings
done
Run Code Online (Sandbox Code Playgroud)

运行命令后,我的更改似乎没有生效。

我没有名为 /dev/sdb 的卷...我不明白它为什么要寻找那个。

我该如何解决这个问题?

提前致谢。

Mis*_*cha 12

来自启动板错误报告的评论的解决方案:

\n

添加global_filter = [ "r|/dev/sda|", "r|/dev/sdb|" ]到文件/etc/lvm/lvm.conf

\n
 143         # Example\n 144         # Accept every block device:\n 145         # filter = [ "a|.*|" ]\n 146         # Reject the cdrom drive:\n 147         # filter = [ "r|/dev/cdrom|" ]\n 148         # Work with just loopback devices, e.g. for testing:\n 149         # filter = [ "a|loop|", "r|.*|" ]\n 150         # Accept all loop devices and ide drives except hdc:\n 151         # filter = [ "a|loop|", "r|/dev/hdc|", "a|/dev/ide|", "r|.*|" ]\n 152         # Use anchors to be very specific:\n 153         # filter = [ "a|^/dev/hda8$|", "r|.*|" ]\n 154         # \n 155         # This configuration option has an automatic default value.\n 156         # filter = [ "a|.*|" ]\n 157         global_filter = [ "r|/dev/sda|", "r|/dev/sdb|" ]\n
Run Code Online (Sandbox Code Playgroud)\n

当您在sudo update-grub应用该修改之前运行时,出现以下错误:

\n
Sourcing file `/etc/default/grub\'\nSourcing file `/etc/default/grub.d/init-select.cfg\'\nGRUB-Konfigurationsdatei wird erstellt \xe2\x80\xa6\n  /dev/sda: open failed: No medium found\n  /dev/sda: open failed: No medium found\n  .\n  .\n  .\nLinux-Abbild gefunden: /boot/vmlinuz-5.4.0-52-generic\ninitrd-Abbild gefunden: /boot/initrd.img-5.4.0-52-generic\nLinux-Abbild gefunden: /boot/vmlinuz-5.4.0-48-generic\ninitrd-Abbild gefunden: /boot/initrd.img-5.4.0-48-generic\n  /dev/sda: open failed: No medium found\n  .\n  .\n  .\nStartmen\xc3\xbceintrag f\xc3\xbcr UEFI-Firmware-Einstellungen wird hinzugef\xc3\xbcgt erledigt\n
Run Code Online (Sandbox Code Playgroud)\n

应用修改并再次运行后sudo update-grub,错误应该消失:

\n
Sourcing file `/etc/default/grub\'\nSourcing file `/etc/default/grub.d/init-select.cfg\'\nGRUB-Konfigurationsdatei wird erstellt \xe2\x80\xa6\nLinux-Abbild gefunden: /boot/vmlinuz-5.4.0-52-generic\ninitrd-Abbild gefunden: /boot/initrd.img-5.4.0-52-generic\nLinux-Abbild gefunden: /boot/vmlinuz-5.4.0-48-generic\ninitrd-Abbild gefunden: /boot/initrd.img-5.4.0-48-generic\nStartmen\xc3\xbceintrag f\xc3\xbcr UEFI-Firmware-Einstellungen wird hinzugef\xc3\xbcgt erledigt\n
Run Code Online (Sandbox Code Playgroud)\n

  • 而不是 `global_filter = [ "r|/dev/sda|", "r|/dev/sdb|" ]` 你可以使用 `[ "r|/dev/sd[ab]|" ]` (4认同)