You are not logged in.

#1 2012-01-20 00:31:46

unilx
Member
From: Fredericton,Canada
Registered: 2009-10-01
Posts: 183

(SOLVED) Grub2 won't boot lvm on gpt

When i try to boot arch the grub screen comes up for a second and then my computer restarts. I followed this tutorial to the letter: http://www.youtube.com/watch?v=69X9ZYA41xU
I've been at this for a couple days with no luck.
Thanks

Last edited by unilx (2012-01-30 19:09:37)

Offline

#2 2012-01-20 01:01:28

/dev/zero
Member
From: Melbourne, Australia
Registered: 2011-10-20
Posts: 1,247

Re: (SOLVED) Grub2 won't boot lvm on gpt

The tutorial is a bit on the side of "tl;dr". What commands did you use to do all the instally stuff and what's in your grub.cfg?

Offline

#3 2012-01-20 01:40:38

Durden
Member
Registered: 2011-06-19
Posts: 261

Re: (SOLVED) Grub2 won't boot lvm on gpt

Offline

#4 2012-01-20 01:57:32

unilx
Member
From: Fredericton,Canada
Registered: 2009-10-01
Posts: 183

Re: (SOLVED) Grub2 won't boot lvm on gpt

I can't chroot into my drive so I'm not sure what's in my grub.cfg

From the live cd:

modprobe dm-mod
gdisk sda

When in gdisk i created a boot partition "+32M" "EF02" (on 1)and a logical volume manager "8E00"(on 2) I'm not sure if i was supposed to give the lmv a size, I didn't, then I wrote the partitions to disk and closed gdisk.
pvcreate /des/sda2                            (created a physical drive from the lvm)
vgcreate arch /dev/sda2                    (created a volume group "arch")

Next i created my partitions:
lvcreate -L 100MB -n boot arch
lvcreate -L 5GB -n root arch
lvcreate -L 12GB -n var arch
lvcreate -L 30GB -n home arch
lvcreate -L 1GB -n tmp arch
lvcreate -C y -L 6GB -n swap arch

Then filesystems:

mkfs.ext2 /dev/arch/boot
mkfs.ext4 /dev/arch/root
mkfs.reiserfs /dev/arch/var
mkfs.ext4 /dev/arch/home
mkfs.ext4 /dev/arch/tmp
mkswap /dev/arch/swap

In "prepare hard drives" i manually configured my block devices and I skipped anything/everything to do with bootloaders, Grub,syslinux
In rc.conf i enabled USELVM=yes
In /etc/mkinitcpio.conf I added "lvm2" to "hooks"

I finished installing arch and didn't reboot.

Next....
mount -o bind /dev /mnt/dev
mount -t proc /proc /mnt/proc
mount -t sysfs /sys /mnt/sys
chroot /mnt  /bin/bash

........

pacman -S grub2-bios

grub_bios-install --boot--directory=/boot --no-floppy --recheck --debug /dev/sda

grub-mkconfig -o /boot/grub/grub.cfg

Then i reboot and it doesn't work.

Last edited by unilx (2012-01-20 03:27:59)

Offline

#5 2012-01-20 05:36:38

Durden
Member
Registered: 2011-06-19
Posts: 261

Re: (SOLVED) Grub2 won't boot lvm on gpt

Is /boot it's own partition? If i'm not mistaken that will not work with grub2 + lvm2

Offline

#6 2012-01-20 05:38:21

Durden
Member
Registered: 2011-06-19
Posts: 261

Re: (SOLVED) Grub2 won't boot lvm on gpt

Offline

#7 2012-01-20 07:38:31

grahamedgecombe
Member
From: UK
Registered: 2011-12-26
Posts: 2
Website

Re: (SOLVED) Grub2 won't boot lvm on gpt

As your /boot is on an LVM partition, you need to add the lvm module to the grub-install command line so GRUB embeds it inside core.img. You should also add part_gpt and ext2 as well - you need to specify the modules GRUB will need for it to be able to read everything else it needs from /boot.

To do this you should add --modules="part_gpt lvm ext2" to the grub-install command.

Offline

#8 2012-01-20 07:43:56

/dev/zero
Member
From: Melbourne, Australia
Registered: 2011-10-20
Posts: 1,247

Re: (SOLVED) Grub2 won't boot lvm on gpt

Right, I think Durden (edit: and grahamedgecombe) is on the right track. Hooks you put in your mkinitcpio.conf only matter after the initramfs manages to load; it sounds like you're not even getting that far.

When I installed a LVM over LUKS over LVM, I kept the /boot partition entirely separate to all the LVMy stuff. My /dev/sda1 corresponds to /boot (formatted as ext2) and my /dev/sda2 corresponds to the rest of the volume group you've called "arch".

You might be interested in checking out the thread from when I ran into problems with my own set up, and Falconindy helped me resolve it very quickly.

Last edited by /dev/zero (2012-01-20 07:47:00)

Offline

#9 2012-01-23 00:10:14

unilx
Member
From: Fredericton,Canada
Registered: 2009-10-01
Posts: 183

Re: (SOLVED) Grub2 won't boot lvm on gpt

Do I replace the two words "VolumeGroup" with "arch"?

# (0) Arch Linux
menuentry "Arch Linux" {
insmod lvm
set root=(VolumeGroup-lv_boot)
# you can only set following two lines
linux /vmlinuz-linux root=/dev/mapper/VolumeGroup-root ro
initrd /initramfs-linux.img
}

to

# (0) Arch Linux
menuentry "Arch Linux" {
insmod lvm
set root=(arch-lv_boot)
# you can only set following two lines
linux /vmlinuz-linux root=/dev/mapper/arch-root ro
initrd /initramfs-linux.img
}

Last edited by unilx (2012-01-23 00:14:27)

Offline

#10 2012-01-23 00:16:11

/dev/zero
Member
From: Melbourne, Australia
Registered: 2011-10-20
Posts: 1,247

Re: (SOLVED) Grub2 won't boot lvm on gpt

Did you try what grahamedgecombe suggested?

Offline

#11 2012-01-23 00:28:13

unilx
Member
From: Fredericton,Canada
Registered: 2009-10-01
Posts: 183

Re: (SOLVED) Grub2 won't boot lvm on gpt

Yes, it didn't work, I must be doing something wrong. I think I'm going to have to thoroughly read the manuals on grub2 and lvm

Last edited by unilx (2012-01-30 02:10:11)

Offline

#12 2012-01-30 02:10:36

unilx
Member
From: Fredericton,Canada
Registered: 2009-10-01
Posts: 183

Re: (SOLVED) Grub2 won't boot lvm on gpt

Well i managed to get arch to boot by editing the /boot/grub/grub.cfg directly. For some reason, running the command grub-mkconfig -o /boot/grub/grub.cfg
and grub-install won't update anything from my /etc/default/grub file or anything from my /etc/grub.d folder. What i have to do:

grub-mkconfig  > /boot/grub/grub.cfg

Then append my menu entries

#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#
### BEGIN /etc/grub.d/00_header ###
insmod part_gpt
insmod part_msdos
if [ -s $prefix/grubenv ]; then
  load_env
fi
set default="0"
if [ "${prev_saved_entry}" ]; then
  set saved_entry="${prev_saved_entry}"
  save_env saved_entry
  set prev_saved_entry=
  save_env prev_saved_entry
  set boot_once=true
fi

function savedefault {
  if [ -z "${boot_once}" ]; then
    saved_entry="${chosen}"
    save_env saved_entry
  fi
}

function load_video {
  insmod vbe
  insmod vga
  insmod video_bochs
  insmod video_cirrus
}

set menu_color_normal=light-blue/black
set menu_color_highlight=light-cyan/blue

insmod part_gpt
insmod lvm
insmod ext2
set root='lvm/arch-rooti'

menuentry "Arch Linux 3.2.2-1 [Primary]" {
insmod lvm
insmod ext2
insmod part_gpt

set root=(arch-boot)
linux /vmlinuz-linux root=/dev/arch/root vga=795 ro
initrd /initramfs-linux.img
}

menuentry "Arch Linux 3.2.2-1 [Recovery]" {
insmod lvm
insmod ext2
insmod part_gpt

set root=(arch-boot)
linux /vmlinuz-linux root=/dev/arch/root ro
initrd /initramfs-linux-fallback.img
}

This does work  but i lose a lot of functionality

Offline

Board footer

Powered by FluxBB