grub on lvm2
Hi list,
I have read on some websites that grub1.95 can boot from lvm So I thought I'd give it a try.
I am quite new to grub2, so please forgive me my noobischness. This is what i did:
1) I added /dev/hda to the physical extents ( pvcreate /dev/hda )
2) created a volume group on it ( vgcreate lvm2_core /dev/hda )
3) and created a boot partition on it ( lvcreate -L100M boot lvm2_core )
4) and wrote a partition on it: ( mkfs.reiserfs /dev/lvm2_core/boot )
5) mounted it on /boot and copied a bunch of grub .mod files to /boot/grub
6) created a config file called grub.cfg in /boot/grub/grub.cfg that looks like this:
# 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
# end grub.cfg
so far so good (i hope..)
I now tried various combinations of grub-setup and grub-install but I can't seem to get it right...
could anyone give me a syntax that should work here? or perhaps some documentation so I could figure it out myself..
thanks a lot!
Mark Hannessen
Quoted 19 lines · Mark Hannessen
Hi list,
I have read on some websites that grub1.95 can boot from lvm So I thought I'd give it a try.
I am quite new to grub2, so please forgive me my noobischness. This is what i did:1) I added
/dev/hdato the physical extents ( pvcreate/dev/hda)
2) created a volume group on it ( vgcreatelvm2_core/dev/hda)
3) and created a boot partition on it ( lvcreate -L100M bootlvm2_core)
4) and wrote a partition on it: ( mkfs.reiserfs/dev/lvm2_core/boot)
5) mounted it on /boot and copied a bunch of grub .mod files to/boot/grub
6) created a config file called grub.cfg in/boot/grub/grub.cfgthat looks like this:# begin grub.cfg set timeout=10 set default=0
Quoted 6 lines
menuentry "My Linux Kernel on (lvm2_core-boot)" {
set root=(lvm2_core_boot)
linux/boot/vmlinuzroot=/dev/ram
initrd /initrd# 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.
Quoted 3 lines
so far so good (i hope..)
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.
Quoted 2 lines
could anyone give me a syntax that should work here? or perhaps some documentation so I could figure it out myself..
All GRUB2 documentation is in the wiki: http://grub.enbug.org/
-Hollis