Ubuntu

GRUB“核心映像中可能缺少某些模組”警告

  • July 8, 2021

一個硬碟從我的 RAID 中崩潰,我添加了一個新硬碟。

現在我想將 GRUB 安裝到新的硬碟上:使用grub-install /dev/sdb. 我收到這些警告:

Installing for i386-pc platform.
grub-install: warning: Couldn't find physical volume `(null)'. Some modules may be missing from core image..
grub-install: warning: Couldn't find physical volume `(null)'. Some modules may be missing from core image..
Installation finished. No error reported.

update-grub2得到:

Generating grub configuration file ...
/usr/sbin/grub-probe: warning: Couldn't find physical volume `(null)'. Some modules may be missing from core image..
/usr/sbin/grub-probe: warning: Couldn't find physical volume `(null)'. Some modules may be missing from core image..
/usr/sbin/grub-probe: warning: Couldn't find physical volume `(null)'. Some modules may be missing from core image..
/usr/sbin/grub-probe: warning: Couldn't find physical volume `(null)'. Some modules may be missing from core image..
Found linux image: /boot/vmlinuz-3.13.0-32-generic
Found initrd image: /boot/initrd.img-3.13.0-32-generic
/usr/sbin/grub-probe: warning: Couldn't find physical volume `(null)'. Some modules may be missing from core image..
/usr/sbin/grub-probe: warning: Couldn't find physical volume `(null)'. Some modules may be missing from core image..
/usr/sbin/grub-probe: warning: Couldn't find physical volume `(null)'. Some modules may be missing from core image..
Found linux image: /boot/vmlinuz-3.13.0-30-generic
Found initrd image: /boot/initrd.img-3.13.0-30-generic
/usr/sbin/grub-probe: warning: Couldn't find physical volume `(null)'. Some modules may be missing from core image..
/usr/sbin/grub-probe: warning: Couldn't find physical volume `(null)'. Some modules may be missing from core image..
/usr/sbin/grub-probe: warning: Couldn't find physical volume `(null)'. Some modules may be missing from core image..
/usr/sbin/grub-probe: warning: Couldn't find physical volume `(null)'. Some modules may be missing from core image..
Found memtest86+ image: /memtest86+.elf
Found memtest86+ image: /memtest86+.bin
done

的輸出cat /proc/mdstat

Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10]
md3 : active raid1 sdb4[3] sda4[2]
     1847608639 blocks super 1.2 [2/2] [UU]

md1 : active raid1 sdb2[3] sda2[2]
     524276 blocks super 1.2 [2/2] [UU]

md2 : active raid1 sdb3[3] sda3[2]
     1073740664 blocks super 1.2 [2/2] [UU]

md0 : active raid1 sdb1[3] sda1[2]
     8387572 blocks super 1.2 [2/2] [UU]

unused devices: none

我重新安裝了兩個核心,apt-get install --reinstall但這些錯誤/警告仍然存在。

有誰知道我怎樣才能擺脫它們?

更新:

因為這只是一個警告,而不是錯誤(並且 GRUB 必須仍在 sda 上),所以我重新啟動了系統。系統啟動並且警告消失了。我不知道是什麼觸發了警告。

我在重建降級的 SW-RAID 陣列時遇到了同樣的問題,並在另一個網站上絆倒了這個問題:

出現警告的 g​​rub-2.00 源位於 ./grub-core/disk/diskfilter.c 中,並有以下註釋:

/* TRANSLATORS: This message kicks in during the detection of
  which modules needs to be included in core image. This happens
  in the case of degraded RAID and means that autodetection may
  fail to include some of modules. It's an installation time
  message, not runtime message.  */

(取自https://bbs.archlinux.org/viewtopic.php?id=160785

換句話說,這個奇怪的錯誤發生在您降級 RAID 陣列時,並且一旦您的陣列正常執行就應該消失(在您的情況下就是這樣)。

當我的 RAID 陣列最終完成同步時,update-grub 和 grub-install 上的錯誤都消失了。

今天也有同樣的事情。原來這是由於grub-probe嘗試通過 訪問分區引起的/dev/sda,這與/dev/sda1(和sda2等等)不記憶體一致。

您可以使用修復它

blockdev --flushbufs /dev/sda1

(根據需要對其他分區重複)。

引用自:https://serverfault.com/questions/617552