View previous topic :: View next topic |
Author |
Message |
hokiau n00b
Joined: 24 Dec 2013 Posts: 18
|
Posted: Mon Jul 21, 2014 1:14 pm Post subject: Cannot boot a fresh install with grub2 root fs on lvm |
|
|
[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 |
|
|
szatox Advocate
Joined: 27 Aug 2013 Posts: 3135
|
Posted: Mon Jul 21, 2014 6:17 pm Post subject: |
|
|
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 |
|
|
hokiau n00b
Joined: 24 Dec 2013 Posts: 18
|
Posted: Tue Jul 22, 2014 12:27 pm Post subject: |
|
|
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 |
|
|
webknjaz n00b
Joined: 29 Oct 2014 Posts: 8
|
Posted: Wed Oct 29, 2014 11:26 am Post subject: Same problem.. |
|
|
Hi,
Did you manage to fix the issue? |
|
Back to top |
|
|
Roman_Gruber Advocate
Joined: 03 Oct 2006 Posts: 3846 Location: Austro Bavaria
|
Posted: Wed Oct 29, 2014 2:20 pm Post subject: |
|
|
well topic covers systemd
usually 512mb boot with ext2, initramfs from genkernel with proper kernel and openrc / eudev works quite well. |
|
Back to top |
|
|
hokiau n00b
Joined: 24 Dec 2013 Posts: 18
|
Posted: Wed Feb 11, 2015 6:11 am Post subject: |
|
|
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 |
|
|
|