LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Gentoo
User Name
Password
Gentoo This forum is for the discussion of Gentoo Linux.

Notices


Reply
  Search this Thread
Old 02-24-2015, 04:04 PM   #1
pusrob
Member
 
Registered: Jan 2006
Distribution: Gentoo
Posts: 507

Rep: Reputation: 36
initramfs generated by genkernel doesn't automatically activate LVM


Hi.

I'm trying to boot on an EFI based system with the help of initramfs and grub2, where the root partition is on an LVM volume located on sdb.

So the problem is, that although the system finds and starts GRUB fine; GRUB finds and starts initramfs located also on the LVM volume just fine; the initramfs itself does not find the root partition on its own.

First, it was trying to find root on sda2, but I added a line in genkernel.conf to supply initramfs the proper location of root (REAL_ROOT=/dev/mapper/vg0-lvol1). Now it is looking at the proper location, but it fails to locate it as it doesn't seem to exist. By dropping to the emergency shell, blkid instantly reveals that the logical volumes indeed do not seem to exist. By manually activating the log. volumes (lvm vgchange -a y vg0) and then running blkid again reveals that all logical volumes are now activated, thus this proves that initramfs indeed has lvm capabilities, it just fails to activate them automatically.

Thus the question is: how to make a genkernel generated initramfs automatically activate my logical volumes, so that the system could finally boot properly?

FYI: I indeed added "dolvm" to the grub kernel paramters for boot, but it seems it has little effect, as until I didn't provide the REAL_ROOT paramter into the genkernel.conf itself, the initramfs was never looking for root in the right place (even with grub real_root parameters).

I'm trying to use gentoo stable.

The sdb1 vfat (boot) partition was mounted to /boot/efi

/boot (on lvol1) contains all grub config and files, but the grub folder of sdb1 is empty (is it bad?)

Thanks in advance.
 
Old 02-24-2015, 04:53 PM   #2
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: Fedora
Posts: 4,140

Rep: Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263
Is CONFIG_BLK_DEV_DM=y in the kernel or is the module loaded in the initramfs?
 
Old 02-25-2015, 02:44 PM   #3
pusrob
Member
 
Registered: Jan 2006
Distribution: Gentoo
Posts: 507

Original Poster
Rep: Reputation: 36
Hi.
Yes, it is in the kernel.
 
Old 02-25-2015, 06:25 PM   #4
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,779

Rep: Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212
You can look in the initrd and see if the scripts contain the instructions to access the LVM volume. The initrd is a compressed cpio archive. You can unpack it by going to a temporary directory and running
Code:
gunzip -c /boot/initrd.img-{whatever} | cpio -idm
Does the file scripts/local-top/lvm2 even exist? It probably won't if the initrd was built while you were not using LVM.
 
Old 02-26-2015, 05:22 AM   #5
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886
The kernel parameter dolvm activates the LVM part only if it is present in the iniitrd. Did you tell genkernel to actually include LVM functionality in the initrd using the --lvm option?
 
Old 02-26-2015, 10:40 AM   #6
pusrob
Member
 
Registered: Jan 2006
Distribution: Gentoo
Posts: 507

Original Poster
Rep: Reputation: 36
Quote:
Originally Posted by TobiSGD View Post
Did you tell genkernel to actually include LVM functionality in the initrd using the --lvm option?
Of course. I edited the genkernel.conf and modified/uncommented the line to: LVM="yes".
I don't think we are dealing with a missing capabilty, as the activation of lvm volumes works, if done manually in the emergency shell included in initramfs. My only problem is, that the initramfs doesn't do it automatically.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Sending automatically generated emails anon112 Linux - Software 4 11-27-2014 09:21 AM
Automatically Generated Wallpapers w1k0 Programming 5 11-26-2013 02:25 PM
Xauth data not being generated automatically coiner Linux - Software 3 09-05-2012 08:07 AM
[SOLVED] initramfs genkernel vs custom kernel steve_pa Gentoo 8 01-25-2012 07:58 PM
initramfs cannot find lvm root partition mgrant Linux - General 1 01-23-2009 07:12 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Gentoo

All times are GMT -5. The time now is 05:43 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration