You are not logged in.

#1 2015-10-10 21:29:04

hellsheep
Banned
Registered: 2015-10-10
Posts: 4

Can't install Grub with root on LVM

Hi there,

I've tried installing GRUB with root and boot as logical volumes on an LVM volume group.

The problem was as follows:

$ grub-install --recheck /dev/sda
grub-install: error: disk 'lvmid/<some id>' not found

My setup was:

|       boot       |       root      |
--------------------------------------
|             volume group           |
--------------------------------------
|     /dev/sda     |     /dev/sdb    |

The boot logical volume was created with "--type raid1"

I've tried GPT and MBR partitioning and adding a "BIOS boot partition" when using GPT, but nothing helped. The error is reproducible in a virtual machine.
Any ideas?

Offline

#2 2015-10-11 08:41:08

boban_dj
Member
Registered: 2015-03-17
Posts: 150

Re: Can't install Grub with root on LVM

@hellsheep
I remember simular issues here https://bbs.archlinux.org/viewtopic.php?id=201147
and here https://bbs.archlinux.org/viewtopic.php?id=201853
maybe one of them will help.

Offline

#3 2015-10-11 19:22:00

hellsheep
Banned
Registered: 2015-10-10
Posts: 4

Re: Can't install Grub with root on LVM

Hi boban_dj,
it's not the same: I'm having problems installing, where GRUB can't find what it needs. The others have problems booting, where the kernel can't find the disks.

Offline

#4 2015-10-12 05:12:41

boban_dj
Member
Registered: 2015-03-17
Posts: 150

Re: Can't install Grub with root on LVM

What type bios partition did you make? ef02, where did you install it. Did you add the lvm module to grub.cfg. whats the output of

pvdisplay vgdisplay lsblk -f fdisk -l etc/grub/grub.cfg /etc/default/grub /etc/fstab /etc/mkinitcpio.conf

and

hellsheep wrote:

The error is reproducible in a virtual machine.

is like: walk the same way as me to Rome

You could give more info when investigating so we could give a better answer.

Offline

#5 2015-10-12 06:19:20

hellsheep
Banned
Registered: 2015-10-10
Posts: 4

Re: Can't install Grub with root on LVM

I tried to simplify my setup a bit further to make it easier to reproduce and noticed that I don't get an error when I don't mirror the logical volume with the boot partition.

There's also a GRUB bug ticket which is related, even though it's already marked "fixed".

I'll try to narrow it down a bit more when I get back from work.

Offline

#6 2015-10-14 18:14:00

hellsheep
Banned
Registered: 2015-10-10
Posts: 4

Re: Can't install Grub with root on LVM

I've played around a bit and apparently GRUB won't install with /boot on an LVM logical volume if said volume is either "--type raid1" or "-m1" (mirrored). Normal LVM volumes are fine, even if they span more than one device.

Here's one example of how to get the error using two disks (/dev/sda and /dev/sdb), each MBR-formated with a partition spanning the whole disk, and an LVM-raid1-partition across both as root

$ parted /dev/sda mklabel msdos
$ parted /dev/sdb mklabel msdos
$ cfdisk /dev/sda
  -> create partition /dev/sda1 spanning entire disk
$ cfdisk /dev/sdb
  -> create partition /dev/sdb1 spanning entire disk
$ pvcreate /dev/sda1
$ pvcreate /dev/sdb1
$ vgcreate vg1 /dev/sda1 /dev/sdb1
$ lvcreate vg1 -l +100%FREE -n lv_root --type raid1
$ mkfs.ext4 /dev/mapper/vg1-lv_root
$ mount /dev/mapper/vg1-lv_root /mnt
$ pacstrap /mnt base
$ genfstab -p /mnt >> /mnt/etc/fstab
$ mkdir /mnt/hostrun
$ mount --bind /run /mnt/hostrun
$ arch-chroot /mnt
$ pacman -S grub
$ grub-install --recheck /dev/sda
 grub-install: error: disk 'lvmid/.../...' not found.

(the bind-mounts are there to give access to LVM within the chroot)
(you can use "-m1" instead of "--type raid1", same result)

Offline

Board footer

Powered by FluxBB