#659460 grub-pc: grub-install can't install on raid0 device (grub-probe can't find /boot)

Package:
grub-pc
Source:
grub2
Description:
GRand Unified Bootloader, version 2 (PC/BIOS version)
Submitter:
John Hughes
Date:
2022-05-02 20:21:05 UTC
Severity:
important
Tags:
#659460#5
Date:
2012-02-11 10:14:00 UTC
From:
To:
Dear Maintainer,

   * What led up to the situation?

I tried to install wheezy on a Sony Vaio Z2 which has a raid0 disk

   * What exactly did you do (or not do) that was effective (or
     ineffective)?

Tried to install grub

   * What was the outcome of this action?

grub-install on /dev/md126 (the raid0) fails:

/usr/sbin/grub-probe: error: no such disk /dev/md126p5

   * What outcome did you expect instead

Since /dev/md126p5 is /boot I expected grub to install


grub-install suggests the output of grub-probe -v might be interesting.  Here it is:
# /usr/sbin/grub-install /dev/md126
/usr/sbin/grub-probe: error: no such disk.
Auto-detection of a filesystem of /dev/md126p5 failed.
Try with --recheck.
If the problem persists please report this together with the output of "/usr/sbin/grub-probe --device-map="/boot/grub/device.map" --target=fs -v /boot/grub" to <bug-grub@gnu.org>
# /usr/sbin/grub-probe --device-map=/boot/grub/device.map --target=fs -v /boot/grub
/usr/sbin/grub-probe: info: Scanning for dmraid_nv RAID devices on disk hd0.
/usr/sbin/grub-probe: info: the size of hd0 is 250069680.
/usr/sbin/grub-probe: info: the size of hd0 is 250069680.
/usr/sbin/grub-probe: info: Scanning for dmraid_nv RAID devices on disk hd1.
/usr/sbin/grub-probe: info: the size of hd1 is 250069680.
/usr/sbin/grub-probe: info: the size of hd1 is 250069680.
/usr/sbin/grub-probe: info: scanning hd0 for LVM.
/usr/sbin/grub-probe: info: the size of hd0 is 250069680.
/usr/sbin/grub-probe: info: no LVM signature found.
/usr/sbin/grub-probe: info: the size of hd0 is 250069680.
/usr/sbin/grub-probe: info: scanning hd1 for LVM.
/usr/sbin/grub-probe: info: the size of hd1 is 250069680.
/usr/sbin/grub-probe: info: no LVM signature found.
/usr/sbin/grub-probe: info: the size of hd1 is 250069680.
/usr/sbin/grub-probe: info: Scanning for mdraid09 RAID devices on disk hd0.
/usr/sbin/grub-probe: info: the size of hd0 is 250069680.
/usr/sbin/grub-probe: info: the size of hd0 is 250069680.
/usr/sbin/grub-probe: info: Scanning for mdraid09 RAID devices on disk hd1.
/usr/sbin/grub-probe: info: the size of hd1 is 250069680.
/usr/sbin/grub-probe: info: the size of hd1 is 250069680.
/usr/sbin/grub-probe: info: Scanning for mdraid1x RAID devices on disk hd0.
/usr/sbin/grub-probe: info: the size of hd0 is 250069680.
/usr/sbin/grub-probe: info: the size of hd0 is 250069680.
/usr/sbin/grub-probe: info: Scanning for mdraid1x RAID devices on disk hd1.
/usr/sbin/grub-probe: info: the size of hd1 is 250069680.
/usr/sbin/grub-probe: info: the size of hd1 is 250069680.
/usr/sbin/grub-probe: info: Scanning for mdraid09 RAID devices on disk hd0.
/usr/sbin/grub-probe: info: the size of hd0 is 250069680.
/usr/sbin/grub-probe: info: the size of hd0 is 250069680.
/usr/sbin/grub-probe: info: Scanning for mdraid09 RAID devices on disk hd0,msdos3.
/usr/sbin/grub-probe: info: the size of hd0 is 250069680.
/usr/sbin/grub-probe: info: Scanning for mdraid09 RAID devices on disk hd0,msdos2.
/usr/sbin/grub-probe: info: the size of hd0 is 250069680.
/usr/sbin/grub-probe: info: Scanning for mdraid09 RAID devices on disk hd0,msdos1.
/usr/sbin/grub-probe: info: the size of hd0 is 250069680.
/usr/sbin/grub-probe: info: Scanning for mdraid09 RAID devices on disk hd1.
/usr/sbin/grub-probe: info: the size of hd1 is 250069680.
/usr/sbin/grub-probe: info: the size of hd1 is 250069680.
/usr/sbin/grub-probe: info: Scanning for mdraid1x RAID devices on disk hd0.
/usr/sbin/grub-probe: info: the size of hd0 is 250069680.
/usr/sbin/grub-probe: info: the size of hd0 is 250069680.
/usr/sbin/grub-probe: info: Scanning for mdraid1x RAID devices on disk hd0,msdos3.
/usr/sbin/grub-probe: info: the size of hd0 is 250069680.
/usr/sbin/grub-probe: info: Scanning for mdraid1x RAID devices on disk hd0,msdos2.
/usr/sbin/grub-probe: info: the size of hd0 is 250069680.
/usr/sbin/grub-probe: info: Scanning for mdraid1x RAID devices on disk hd0,msdos1.
/usr/sbin/grub-probe: info: the size of hd0 is 250069680.
/usr/sbin/grub-probe: info: Scanning for mdraid1x RAID devices on disk hd1.
/usr/sbin/grub-probe: info: the size of hd1 is 250069680.
/usr/sbin/grub-probe: info: the size of hd1 is 250069680.
/usr/sbin/grub-probe: info: scanning hd0 for LVM.
/usr/sbin/grub-probe: info: the size of hd0 is 250069680.
/usr/sbin/grub-probe: info: no LVM signature found.
/usr/sbin/grub-probe: info: the size of hd0 is 250069680.
/usr/sbin/grub-probe: info: scanning hd0,msdos3 for LVM.
/usr/sbin/grub-probe: info: the size of hd0 is 250069680.
/usr/sbin/grub-probe: info: no LVM signature found.
/usr/sbin/grub-probe: info: scanning hd0,msdos2 for LVM.
/usr/sbin/grub-probe: info: the size of hd0 is 250069680.
/usr/sbin/grub-probe: info: no LVM signature found.
/usr/sbin/grub-probe: info: scanning hd0,msdos1 for LVM.
/usr/sbin/grub-probe: info: the size of hd0 is 250069680.
/usr/sbin/grub-probe: info: no LVM signature found.
/usr/sbin/grub-probe: info: scanning hd1 for LVM.
/usr/sbin/grub-probe: info: the size of hd1 is 250069680.
/usr/sbin/grub-probe: info: no LVM signature found.
/usr/sbin/grub-probe: info: the size of hd1 is 250069680.
/usr/sbin/grub-probe: info: changing current directory to /dev.
/usr/sbin/grub-probe: info: changing current directory to mapper.
/usr/sbin/grub-probe: info: opening md126,5.
/usr/sbin/grub-probe: error: no such disk.

# ls /dev/md126p5
brw-rw-rw- 1 root root 259, 4 Feb 10 22:55 /dev/md126p5
# mount
/dev/md126p7 on / type ext3 (rw,relatime,errors=remount-ro,user_xattr,acl,barrier=1,data=ordered)
/dev/md126p5 on /boot type ext3 (rw,relatime,errors=continue,user_xattr,acl,barrier=1,data=ordered)
tmpfs on /dev type tmpfs (rw,relatime,mode=755)

#659460#10
Date:
2012-02-11 10:29:19 UTC
From:
To:
This looks like fakeraid rather than a honest software raid. You need to
manually add it to device.map.

#659460#15
Date:
2012-02-11 11:02:20 UTC
From:
To:
The difference is rather blurred now that it's mdadm that's handling it
rather than the old dm-raid.

I'll try adding it to the map by hand.

Which seems to work.

#659460#20
Date:
2012-02-11 11:19:48 UTC
From:
To:
This is exactly the problem. GRUB can't distinguish between the both. Do
you know an ioctl, or at very least a command to distinguish them?
Also honest raid doesn't try to scam you into believing that it's a
hardware raid.

#659460#25
Date:
2012-02-11 11:33:27 UTC
From:
To:
Ok, adding

      (hd2) /dev/md126

to target/boot/grub/device.map then re-running the grub-install works
(it didn't find the windows install, but doing an update-grub from the
running system fixed that).

Like you I get the feeling that the source of the problem is that it's a
mdadm raid using intel container format (aka fake raid).  grub looks
like it's trying to cope with either the old dmraid, or linux raid being
handled by mdadm, but this case is beyond it's abilities.

Would you like me to try debugging this further?

#659460#30
Date:
2012-02-11 11:36:02 UTC
From:
To:
What scam?  As far as I can tell it's just a mdadm raid with an intel
container format rather than a mdadm container format.

#659460#35
Date:
2012-02-11 12:15:46 UTC
From:
To:
Adding BIOS driver for this screws things up.
And the scam is adding this to mobo features as a "RAID" and an attempt
to make this pass as if it was a hardware RAID.
GRUB currently considers mdX as a non-available through BIOS unless user
overrides it in device.map, we need to add a logic to handle the
fakeraid as a BIOS disk.
It's possible to add support for intel RAID but it will be useless since
the member disks aren't available through BIOS to begin with.

#659460#40
Date:
2012-02-13 16:18:58 UTC
From:
To:
I started a cross mailing list discussion of this last year, and I
think the conclusion was that grub needs to ask mdadm what the
metadata format is, and if it is the intel format, assume the raid is
bios accessible the way it currently does for dmraid.

#659460#45
Date:
2022-05-02 20:19:55 UTC
From:
To:
Greeting ,I had written an earlier mail to you but without response