[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#686955: grub-installer: Grub fails to install on dm-crypt on LVM on SATA RAID 0



On Fri, Sep 07, 2012 at 07:41:20PM +0100, Conrad Hughes wrote:
> Thanks very much for such a fast response --- I'm well aware that dmraid
> is "not recommended", but it would be really handy if I could keep it
> for the Windows dual boot.  Your suggestion that mdadm supports Intel
> RST sounds really interesting --- but I can't see anything that
> documents how you activate/use it in the Debian installer.

Well I did it manually.  So far it works vastly better than dmraid did.
And yes I did it for the same reason so I could have a dual boot with
raid for windows.

> It does appear possibly to just be enabled by default, in that if I run
> through the wheezy installer *without* adding the dmraid=true kernel
> boot parameter, then it recognises a "Linux Software Raid" array on
> /dev/md126; with some false starts I've managed to partition this as
> before (small /boot, then a large dm-crypt partition on which I put LVM,
> then splitting the LVM into swap and root partitions).  Again, grub
> tries to install to /dev/hda1 and fails, but this time when I reboot to
> the wheezy rescue mode, things are much more complicated.  During disk
> discovery, it doesn't recognise the RAID array until I tell the
> installer to look for it, at which point it recognises /dev/md126 but
> doesn't do anything with it.  I had to manually start a shell and invoke

Yes md126 is the intel raid.

>   cryptsetup luksOpen /dev/md126p7 dm-6_crypt
> 
> then restart the disk discovery process, finally being given an option
> to use /dev/mapper/waif-root for my root partition.  Then, however, I
> ran into trouble with grub: update-grub complained of file not found
> repeatedly, and grub-install failed to install because it "couldn't
> find" my LVM root volume.  /boot/grub/device.map at this point contains
> just three drives, my USB install disk, and the base hard drives of the
> machine's RAID array (as hd0, hd1, hd2 respectively).  If I add a bogus
> (hd3) entry pointing at the raid drive, /dev/md126, then update-grub
> stops complaining "file not found", and even successfully finds the
> Windows partition.  If I then add a bogus (hd4) entry pointing at the
> dm-crypt partition I mounted, /dev/mapper/dm-6_crypt, then grub-install
> stops complaining about not finding /dev/mapper/waif-root and claims to
> have successfully executed.

Yes grub can be a bit of a hassle.  I am trying to remember what I did to get grub going.

> The net result though, is exactly the same --- on reboot I get
> 
>   Welcome to GRUB!
> 
>   error: no such disk.
>   Entering rescue mode...
>   grub rescue>
> 
> I'm assuming I need some additional magic to make grub assemble the raid
> array, find the boot partition, decrypt the dm-crypt partition, and open
> the root volume...

Well grub is supposed to talk to the bios disk device instead.

I have a device.map for grub like this:

# cat /boot/grub/device.map 
(hd0)   /dev/disk/by-id/md-uuid-5847a5f9:19773d99:f13783a1:b611c764

And I believe I then did grub-install /dev/md126

After all the BIOS will provide hd0 (0x80) as the RAID device, so hd0
in grub will be the right thing and grub doesn't need to know that it
is a raid.  Grub does need to know that /dev/md126 is hd0 in linux
however.

-- 
Len Sorensen


Reply to: