You are not logged in.

#1 2014-11-14 22:51:55

CarlD
Member
From: London
Registered: 2013-11-23
Posts: 128

LVM and Grub

Hi All,

I would appreciate any advice from those experienced in using LVM with Grub as the bootloader (BIOS). I've not been able to find any relevant information in the Arch Wiki, so would be more than happy to update and expand the GRUB and/or LVM articles, if I can find out for myself.

Let's say I've created the volume group 'volgroup00' using partitions spanning three devices, e.g.:

vgcreate volgroup00 /dev/sda1 /dev/sdb3 /dev/sdc1

One of the LV's created from this group is used as the root partition.

However, where wishing to install grub, the device must be specified. If I wanted to install grub to the same device as root, then since the LV used for root was created from a VG consisting of three devices (i.e. sda, sdb, and sdc), how would I know which device to pick?

# grub-install --target=i386-pc --recheck /dev/sda
# grub-install --target=i386-pc --recheck /dev/sdb
# grub-install --target=i386-pc --recheck /dev/sdc

Much appreciated!

Last edited by CarlD (2014-11-15 10:24:40)

Offline

#2 2014-11-14 23:32:19

tzoi516
Member
Registered: 2014-05-02
Posts: 76

Re: LVM and Grub

#
# 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
insmod lvm

I use LVM, and just had to make sure my grub.cfg had the right insmod in there.

Offline

#3 2014-11-15 10:27:31

CarlD
Member
From: London
Registered: 2013-11-23
Posts: 128

Re: LVM and Grub

tzoi516 wrote:
#
# 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
insmod lvm

I use LVM, and just had to make sure my grub.cfg had the right insmod in there.

Thanks for the reply, Tzo!

Yes, I believe this is necessary when installing grub within an LVM container. My confusion is in respect to which device to pick for when the Root Logical Volume (LV) is from a Volume Group that consists of multiple devices. Again, if the VG consists of partitions from sda, sdb, and sdc, then which of those do I specify for the grub-install command?

EDIT: Seems you've also highlighted a possible error in the Arch Wiki Grub article. You only need 'insmod lvm' listed in grub.cfg for /boot LVM installations to work. The article states to amend the 'set root=' part, but this seems to be un-necessary.

Last edited by CarlD (2014-11-15 16:08:06)

Offline

Board footer

Powered by FluxBB