9

one HDD crashed from my RAID and I added a new HDD.
Now I wanted to install GRUB to the new HDD: with grub-install /dev/sdb. I get these warnings:

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.

On update-grub2 I get:

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

Output of 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

I reinstalled both kernels with apt-get install --reinstall but these errors/warnings persists.
Does anyone know how I can get rid of them?

Update:

Since it was only a warning, not an error (and GRUB has to be still on sda) I restarted the system. The system booted and the warnings are gone. I dont know what triggered the warnings.

  • Looks like you are missing something. Which RAID level you use? After you added device to RAID, you should not work with it directly. Please post result of cat /proc/mdstat here. – maniaque Aug 3 '14 at 13:28
  • added output to my post. RAID level is 1. resync is already done. – pythonimus Aug 3 '14 at 13:58
  • So, all your disks and md-devices are up. You should not try to install grub directly - mdadm syncs hard disc contents automatically. If you would like to install grub to md device, so use grub-install /dev/md1, but are you sure you need grub on md device? Do you boot from md device? – maniaque Aug 4 '14 at 14:27
  • I dit it like mentioned here Step12: Reinstall GRUB 2 ([...] Do not specify a partition number) [...] If the system partitions are on a software RAID install GRUB 2 on all disks in the RAID. [...] Or here – pythonimus Aug 4 '14 at 17:55
13

I was having the same problem while rebuilding a degraded SW-RAID array, and tripped over this on another website:

The grub-2.00 source where the warning arises is in ./grub-core/disk/diskfilter.c and has this comment:

/* 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.  */

(Taken from https://bbs.archlinux.org/viewtopic.php?id=160785)

In other words, this strange error occurs when you have degraded RAID arrays, and should disappear (which it did in your case) once your arrays are functioning properly.

When my RAID arrays finally finished syncing, the error disappeared on both update-grub and grub-install.

  • 1
    I just changed a hard disk and rebuilt the raid. When I ran grub-install during the rebuild, I got these warnings. I can confirm that when the rebuild finished and I ran grub-install again, these warning disappeared! – Vangelis Tasoulas Sep 8 '14 at 11:15
  • 2
    Didn't vanished for me for 3 days. Rebuild was done when I first tryed to grub-install. – pythonimus Sep 8 '14 at 22:34
11

Had the same thing today. Turns out it's caused by grub-probe trying to access partitions through /dev/sda, which is not cache-coherent with /dev/sda1 (and sda2 etcetera).

You can fix it using

blockdev --flushbufs /dev/sda1

(repeat for other partitions as necessary).

  • this did it for me, it was sufficient to run this on the /boot partition – lifeofguenter Mar 10 '18 at 17:12
3

Since it was only a warning, not an error (and GRUB has to be still on sda) I restarted the system.
The system booted and the warnings are gone.
I dont know what triggered the warnings.

2

Using grub2-install while migrating from a single disk to raid1, I had very similar symptoms, being multiple warning lines as follows. I wasn't willing to reboot just to "test" whether or not this was a fatal problem however. In my case I wanted to put /boot onto a 4-disk RAID1 while the other partitions were going to be separated 2-disk RAID1s:

grub2-install: warning: Couldn't find physical volume ‘(null)’. Some modules may be missing from core image..

grub2-mkconfig also showed multiple errors in the resulting configuration:

/usr/sbin/grub2-probe: warning: Couldn't find physical volume `(null)'. Some modules may be missing from core image..

I found the problem was that I had created the RAID array without specifying the metadata version. Older grub versions require --metadata=0.90 when creating the array. After re-doing this bit on the /boot partition, grub2-install worked 100%. Bear in mind that the original partition with the /boot was /dev/sda1, hence why the commands below have 3 disks + 1 missing instead of all 4 disks.

Before:

$ mdadm --create --level 1 /dev/md2 --raid-devices=4 /dev/sd{b,c,d}1 missing

After:

$ mdadm --create --level 1 /dev/md2 --raid-devices=4 --metadata=0.90 /dev/sd{b,c,d}1 missing

Related to device map, grub had "grub-mkdevicemap" command. This has been replaced with "--recheck" flag in grub2-install:

Old:

$ grub-mkdevicemap -n
$ grub-install /dev/sda

New:

$ grub2-install --recheck /dev/sda

Also please remember, if using multiple disks, to repeat the command on all disks. This prevents the situation where you have grub installed on one disk only but that disk happens to die on you (which would result in an unbootable system):

$ for disk in sd{a,b,c,d} ; do grub2-install --recheck /dev/$disk ; done
Installing for i386-pc platform.
Installation finished. No error reported.
Installing for i386-pc platform.
Installation finished. No error reported.
Installing for i386-pc platform.
Installation finished. No error reported.
Installing for i386-pc platform.
Installation finished. No error reported.
1

This happens because the grub device map (/boot/grub/device.map) is not correct anymore, after exchanging a drive from raid. Simply run

grub-mkdevicemap -n

for updating the device map and

grub-install

for the corresponding devices.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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