[Top][All Lists]

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

Re: GRUB2, GPT, mdadm & LVM

From: Sander Smeenk
Subject: Re: GRUB2, GPT, mdadm & LVM
Date: Thu, 18 Jul 2013 20:35:43 +0200
User-agent: Mutt/1.5.21 (2010-09-15)

Quoting Chris Murphy (address@hidden):

> > During boot, GRUB starts and drops to 'grub rescue>' stating "Error:
> > disk lvm/fdi-host_root not found".
> This means it's not finding normal.mod or grub.cfg.

Yep. ;)

> [..] So it's a bit curious that it's looking for its files on an lvm
> root rather than on /boot. 

I could have stated that clearer indeed.
/boot and everyting else is on the /dev/mapper/fdi-host_root LV.

I checked with 'set', the prefix= and root= settings seem correct:


But please note that doing 'ls' in the rescue shell does NOT show a
'device' named lvm/fdi-host_root or anything that would indicate it might
be the LVM LV i need. Only (md/0) and all the (hdX/gptY) 'devices' show.

> > Typing 'ls' in the rescue shell shows
> > the '(md/0)' device, but LVM is never started by GRUB.
> Only if /boot/grub files are also on LVM is that needed, in which case
> lvm.mod needs to have been baked into the core.img. But the fact that
> you're getting this message sounds like it's not loading lvm.mod.

So it seems. Yet, if i type 'insmod lvm' in the grub rescue shell, there
is no error returned. This would indicate to me that the .mod was
(already?) loaded correctly, because if i type 'insmod foobar' instead,
grub complains it can't read/find the host_root LV, which is correct
since 'foobar' isn't in core.img so grub would have to load it from

> I forget, but lsmod might work in the grub rescue shell to list what
> modules are available in core.img.

It seems my core.img doesn't support lsmod. :(

> > I tried (re)creating the core.img like so:
> > | # grub-mkimage -o /boot/grub/core_lvm.img -O i386-pc \
> > |     part_gpt part_msdos mdraid09 mdraid1x raid6rec \
> > |     diskfilter lvm ext2
> > And put that in all the disks:
> > | # grub-bios-setup -b i386-pc/boot.img -c core_lvm.img /dev/sdX
> You might be better off using grub-install --debug and figuring out
> how it identifies the various parts.

Meh. Why didn't i think of doing that ;)
" 'No errors reported.', okay then, that's not my problem! " :P

But all seems fine from the start:
| + abstractions=diskfilter mdraid1x raid6rec lvm
| + grub_device=/dev/mapper/fdi-host_root
| + devabstraction_module=diskfilter mdraid1x raid6rec lvm 
| + prefix_drive=(lvm/fdi-host_root)

There is a small bug in the process where part_gpt gets added to the
'modules=' list for each disk in my system, resulting in:
| + /usr/bin/grub-mkimage -d /usr/lib/grub/i386-pc -O i386-pc \
|   --output=/boot/grub/i386-pc/core.img --prefix=(lvm/fdi-host_root)/boot/grub 
|  biosdisk ext2 part_gpt part_gpt part_gpt part_gpt part_gpt part_gpt \
|  part_gpt part_gpt part_gpt part_gpt part_gpt part_gpt part_gpt \
|  part_gpt part_gpt part_gpt diskfilter mdraid1x raid6rec lvm
being called. However i would assume this is harmless...

Then grub-bios-setup runs. It scans all disks and logs:
| info: Inserting hostdisk//dev/sdX into md/0 (mdraid1)
for each of my disks. It's not actually raid1, but raid6,
i'm not sure wether 'mdraid1' is an all purpose mdraid module?
This *might* be an issue?

grub-setup continues nonetheless:
| info: Scanning for lvm devices on disk md/0.
| info: Found array fdi.
| info: Inserting md/0 into fdi (lvm)
|  [..]
| info: guessed root_dev `lvm/fdi-host_root' from dir `/boot/grub/i386-pc'.
| info: setting the root device to `lvm/fdi-host_root'.
| info: the first sector is <2048,0,512>.
perfectly true. It saves the sectors from 2048 to 2183, which seems the
size of core.img and logs 'Installation finished. No error reported.'

I'm at a loss :)

Thanks for your time,
| Man who stand on toilet is high on pot
| 4096R/20CC6CD2 - 6D40 1A20 B9AA 87D4 84C7  FBD6 F3A9 9442 20CC 6CD2

reply via email to

[Prev in Thread] Current Thread [Next in Thread]