Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Cannot boot a fresh install with grub2 root fs on lvm
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
hokiau
n00b
n00b


Joined: 24 Dec 2013
Posts: 18

PostPosted: Mon Jul 21, 2014 1:14 pm    Post subject: Cannot boot a fresh install with grub2 root fs on lvm Reply with quote

[glsa=][/glsa]I read that grub2 could boot a system with / on a lvm volume. I did just that with a fresh install of gentoo with gpt, grub2, systemd. / is on /dev/vg/slash and /boot on a non-lvm partition. I generated the kernel with genkernel-next using --lvm and --udev params. grub2-mkconfig generated the grub2 configuration file with the "dolvm" kernel param. When I tried to boot the system, it said "Activating Logical Volume Groups", and then "/run/lvm/lvmetad.socket: connect failed: No such file or directory", and "/dev/mapper/vg-slash is an invalid root device..."

How do I make sure lvmetad.socket is there during boot?
Back to top
View user's profile Send private message
szatox
Advocate
Advocate


Joined: 27 Aug 2013
Posts: 3135

PostPosted: Mon Jul 21, 2014 6:17 pm    Post subject: Reply with quote

If you have initramfs, any bootloader will boot linux on lvm.
Bootloader's job is to load kernel into RAM, optionaly load initramfs and then give up control.

However, AFAIR genkernel puts /etc/lvm/lvm.conf into initramfs, which means you must have lvm already configured by the time you build initramfs.

Also, it seems gentoo doesn't want to run without
root=/dev/ram0
(and real_root=<path to lvm volume>)
Back to top
View user's profile Send private message
hokiau
n00b
n00b


Joined: 24 Dec 2013
Posts: 18

PostPosted: Tue Jul 22, 2014 12:27 pm    Post subject: Reply with quote

Here's what I did:
1. in /etc/defaults/grub added GRUB_DEVICE=/dev/ram0, and added a kernel param "real_root=/dev/vg/slash"
2. grub2-mkconfig -o /boot/grub/grub.cfg
3. genkernel --lvm --udev all

Supposedly I should have the proper lvm params for initramfs. When I rebooted, I still saw the error:
/run/lvm/lvmetad.socket: connect failed: No such file or directory
...
/dev/vg/slash is an invalid root device

So, it's still not finding /run/lvm/lvmetad.socket. What is wrong?
Back to top
View user's profile Send private message
webknjaz
n00b
n00b


Joined: 29 Oct 2014
Posts: 8

PostPosted: Wed Oct 29, 2014 11:26 am    Post subject: Same problem.. Reply with quote

Hi,

Did you manage to fix the issue?
Back to top
View user's profile Send private message
Roman_Gruber
Advocate
Advocate


Joined: 03 Oct 2006
Posts: 3846
Location: Austro Bavaria

PostPosted: Wed Oct 29, 2014 2:20 pm    Post subject: Reply with quote

well topic covers systemd

usually 512mb boot with ext2, initramfs from genkernel with proper kernel and openrc / eudev works quite well.
Back to top
View user's profile Send private message
hokiau
n00b
n00b


Joined: 24 Dec 2013
Posts: 18

PostPosted: Wed Feb 11, 2015 6:11 am    Post subject: Reply with quote

i figured it out:
1. you need to genkernel with the --lvm flag.
2. make sure grub preload the lvm module. in /etc/default/grub add a line GRUB_PRELOAD_MODULES=lvm.
3. boot kernel with dolvm parameter. in /etc/default/grub append dolvm to GRUB_CMDLINE_LINUX.
4. don't forget to regenerate grub2 config file after you modify /etc/default/grub, e.g. grub2-mkconfig -o /boot/grub/grub.conf.
5. reboot.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum