Skip to contentSkip to conversation

Set an LVM volume as default root device

DISCUSSION Aesir 2 participants 3 messages Feb 28, 2009 – Mar 5, 2009

lore
Share & tools
lore

Aesir

author
#0 lore raw

Hi everyone,

while discovering the beauties of grub2 I'm trying to get a working setup with /boot partition on LVM. Unfortunately until now to boot this system I had to set root device and prefix "by hand" from the rescue shell. In fact, while the working values should be

root (vg0-boot)
prefix (vg0-boot)/grub

the ones that grub2 uses by default are

root (hd0)
prefix (hd0)/grub

I haven't figured out yet how to change that default value, even reading grub-setup help I couldn't find it out. I would be really pleased if someone could help me.

Sorry if this is a silly question, hope for your comprehension :-)

Thanks!

Signature · 1 line
Maurizio Longari <[email protected]>
#1 lore raw
Quoted 7 lines · Aesir

Hi everyone,

while discovering the beauties of grub2 I'm trying to get a working setup with /boot partition on LVM. Unfortunately until now to boot this system I had to set root device and prefix "by hand" from the rescue shell. In fact, while the working values should be

root (vg0-boot)
prefix (vg0-boot)/grub

Quoted 8 lines

the ones that grub2 uses by default are

root (hd0)
prefix (hd0)/grub

I haven't figured out yet how to change that default value, even reading grub-setup help I couldn't find it out. I would be really pleased if someone could help me.

Sorry if this is a silly question, hope for your comprehension :-)

grub-install / grub-mkconfig should already DTRT. Are you using those to install and generate grub.cfg ?

Signature · 5 lines
Robert Millan

  The DRM opt-in fallacy: "Your data belongs to us. We will decide when (and
  how) you may access your data; but nobody's threatening your freedom: we
  still allow you to remove your data and not access it at all."
author
#2 lore raw
Quoted 13 lines · On Wed, 4 Mar 2009 22:05:38 +0100 Robert Millan <[email protected]> wrote:
Quoted 12 lines · Aesir

Hi everyone,

while discovering the beauties of grub2 I'm trying to get a working setup with /boot partition on LVM. Unfortunately until now to boot this system I had to set root device and prefix "by hand" from the rescue shell. In fact, while the working values should be

root (vg0-boot)
prefix (vg0-boot)/grub

the ones that grub2 uses by default are

root (hd0)
prefix (hd0)/grub

Quoted 19 lines
Quoted 3 lines

I haven't figured out yet how to change that default value, even reading grub-setup help I couldn't find it out. I would be really pleased if someone could help me.

Sorry if this is a silly question, hope for your comprehension :-)

grub-install / grub-mkconfig should already DTRT. Are you using those to install and generate grub.cfg ?

Signature · 11 lines
Robert Millan

  The DRM opt-in fallacy: "Your data belongs to us. We will decide when (and
  how) you may access your data; but nobody's threatening your freedom: we
  still allow you to remove your data and not access it at all."


_______________________________________________
Grub-devel mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/grub-devel

Thanks for the reply.
I realized what the problem was.

The commands I was using were:

grub-mkimage --output=/boot/grub/core.img ext2 _chain pc gpt biosdisk lvm --prefix=/grub

and

grub-setup --root-device='(vg0-boot)' /dev/sda

Obviously my fault was to indicate only the relative path in the --prefix option instead of '(vg0-boot)/grub'. I mistakenly tought that the --root-device option in grub-setup served for that purpose.

Now everything is perfectly working,
Thanks again.

Signature · 1 line
Maurizio Longari