Skip to contentSkip to conversation

grub on lvm2

DISCUSSION Mark Hannessen 2 participants 2 messages Feb 7, 2007 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 9 lines
Quoted 9 lines
# begin grub.cfg
set timeout=10
set default=0

menuentry "My Linux Kernel on (lvm2_core-boot)" {
set root=(lvm2_core_boot)
linux /boot/vmlinuz root=/dev/ram
initrd /initrd

Quoted 4 lines
Quoted 1 line
# end grub.cfg

I don't believe "set root" behaves properly. If that's the problem, you will need to duplicate that value into both following lines.

ok I now made it look like this:

menuentry "My Linux Kernel on (lvm2_core-boot)" {
set root=(lvm2_core_boot)
linux (lvm2_core_boot)/boot/vmlinuz root=/dev/ram initrd (lvm2_core_boot)/boot/initrd
}

Quoted 4 lines
Quoted 2 lines

I now tried various combinations of grub-setup and grub-install but I can't seem to get it right...

Perhaps you could be a little more specific.

this I used for my core.img

grub-mkimage -d /boot/grub -v -o /boot/grub/core.img ls ext2 gpt pc linux _linux boot chain configfile fshelp help lvm

and this is the most far I got:

grub-setup -d /boot/grub -v -r '(lvm2_core-boot)' -m /boot/grub/device.map '(lvm2_core-boot)'

grub-setup: info: prefix = /grub
grub-setup: info: getting the size of /boot/grub/boot.img
grub-setup: info: reading /boot/grub/boot.img
grub-setup: info: getting the size of /boot/grub/boot.img
grub-setup: info: getting the size of /boot/grub/core.img
grub-setup: info: reading /boot/grub/core.img
grub-setup: info: getting the size of /boot/grub/core.img
grub-setup: error: unknown device

why I grub probe I get the same:

grub-probe -v /boot/grub
grub-probe: info: changing current directory to /dev
grub-probe: info: changing current directory to i2c
grub-probe: info: changing current directory to lvm2_server1
grub-probe: info: changing current directory to lvm2_core
grub-probe: info: changing current directory to shm
grub-probe: info: changing current directory to pts
grub-probe: info: changing current directory to bus
grub-probe: info: changing current directory to usb
grub-probe: info: changing current directory to 004
grub-probe: info: changing current directory to 003
grub-probe: info: changing current directory to 002
grub-probe: info: changing current directory to 001
grub-probe: info: changing current directory to snd
grub-probe: info: changing current directory to sound
grub-probe: info: changing current directory to net
grub-probe: info: changing current directory to misc
grub-probe: info: changing current directory to pktcdvd
grub-probe: info: changing current directory to xen
grub-probe: info: changing current directory to mapper cannot find a GRUB drive for lvm2_core-boot.

Mark

#2 lore raw
Quoted 9 lines · Mark Hannessen

ok I now made it look like this:

menuentry "My Linux Kernel on (lvm2_core-boot)" {
set root=(lvm2_core_boot)
linux (lvm2_core_boot)/boot/vmlinuz root=/dev/ram initrd (lvm2_core_boot)/boot/initrd
}

My config with lvm looks pretty similar but I am using an initramfs image and its looking like this

menuentry "Debian GNU/Linux, linux 2.6.20" {
set root=(fatoftheland-main)
linux /boot/vmlinuz-2.6.20 root=/dev/mapper/fatoftheland-main ro initrd /boot/initrd.img-2.6.20
}

Quoted 5 lines

this I used for my core.img

grub-mkimage -d /boot/grub -v -o /boot/grub/core.img ls ext2 gpt pc linux _linux boot chain configfile fshelp help lvm

As far as I remember (it has been a long time since I last created the core.img file) the order is important. Try

grub-mkimage -o /boot/grub/core.img pc lvm ext2 _chain

Quoted 4 lines

and this is the most far I got:

grub-setup -d /boot/grub -v -r '(lvm2_core-boot)' -m /boot/grub/device.map '(lvm2_core-boot)'

Use the real disk here and not the lvm VG.

grub-setup -r '(fatoftheland-main)' '(hd0)'.

This works for me.

Kind regards,
Michael