update-grub 不工作--未找到介质

update-grub 不工作--未找到介质

我在 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

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

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

我该如何修复此问题?

提前致谢。

答案1

解决方案来自此评论在启动板上错误报告

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

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

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

Sourcing file `/etc/default/grub'
Sourcing file `/etc/default/grub.d/init-select.cfg'
GRUB-Konfigurationsdatei wird erstellt …
  /dev/sda: open failed: No medium found
  /dev/sda: open failed: No medium found
  .
  .
  .
Linux-Abbild gefunden: /boot/vmlinuz-5.4.0-52-generic
initrd-Abbild gefunden: /boot/initrd.img-5.4.0-52-generic
Linux-Abbild gefunden: /boot/vmlinuz-5.4.0-48-generic
initrd-Abbild gefunden: /boot/initrd.img-5.4.0-48-generic
  /dev/sda: open failed: No medium found
  .
  .
  .
Startmenüeintrag für UEFI-Firmware-Einstellungen wird hinzugefügt erledigt

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

Sourcing file `/etc/default/grub'
Sourcing file `/etc/default/grub.d/init-select.cfg'
GRUB-Konfigurationsdatei wird erstellt …
Linux-Abbild gefunden: /boot/vmlinuz-5.4.0-52-generic
initrd-Abbild gefunden: /boot/initrd.img-5.4.0-52-generic
Linux-Abbild gefunden: /boot/vmlinuz-5.4.0-48-generic
initrd-Abbild gefunden: /boot/initrd.img-5.4.0-48-generic
Startmenüeintrag für UEFI-Firmware-Einstellungen wird hinzugefügt erledigt

相关内容