* grub on lvm2
@ 2007-02-03 12:15 Mark Hannessen
2007-02-06 0:56 ` Hollis Blanchard
0 siblings, 1 reply; 4+ messages in thread
From: Mark Hannessen @ 2007-02-03 12:15 UTC (permalink / raw)
To: grub-devel
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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: grub on lvm2
2007-02-03 12:15 grub on lvm2 Mark Hannessen
@ 2007-02-06 0:56 ` Hollis Blanchard
0 siblings, 0 replies; 4+ messages in thread
From: Hollis Blanchard @ 2007-02-06 0:56 UTC (permalink / raw)
To: The development of GRUB 2
On Sat, 2007-02-03 at 04:15 -0800, Mark Hannessen wrote:
> 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
I don't believe "set root" behaves properly. If that's the problem, you
will need to duplicate that value into both following 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.
> 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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: grub on lvm2
2007-02-07 13:00 ` Mark Hannessen
@ 2007-02-07 16:42 ` Michael Guntsche
0 siblings, 0 replies; 4+ messages in thread
From: Michael Guntsche @ 2007-02-07 16:42 UTC (permalink / raw)
To: The development of GRUB 2
On Feb 7, 2007, at 2:00 PM, Mark Hannessen wrote:
>
> 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
}
> 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
> 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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: grub on lvm2
[not found] <20070206170519.CAFB44A5E15@mail.nperfection.com>
@ 2007-02-07 13:00 ` Mark Hannessen
2007-02-07 16:42 ` Michael Guntsche
0 siblings, 1 reply; 4+ messages in thread
From: Mark Hannessen @ 2007-02-07 13:00 UTC (permalink / raw)
To: grub-devel
> > # 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
>
> 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
}
> > 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
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2007-02-07 16:43 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-02-03 12:15 grub on lvm2 Mark Hannessen
2007-02-06 0:56 ` Hollis Blanchard
[not found] <20070206170519.CAFB44A5E15@mail.nperfection.com>
2007-02-07 13:00 ` Mark Hannessen
2007-02-07 16:42 ` Michael Guntsche
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.