# new kernel can't find LVM volumes

## jordanwb

I compiled a new kernel (2.6.27.6) replacing the old one (2.6.26.2). I made a new init file since the root is a LVM volume. I rebooted my server and I got this error:

 *Quote:*   

> initd: Activating LVM2 volumes
> 
> Failed to find sysfs mount point
> 
> initrd: Mounting root filesystem /dev/system/root ro
> ...

 

I compiled the kernel with LVM2 built in.

----------

## richard.scott

How are you building your kernel.... are you using Genkernel to build it?

----------

## jordanwb

make && make modules_install

----------

## eduardhc

 *jordanwb wrote:*   

> make && make modules_install

 

You need to use 'genkernel' if your root partition is on LVM. It configure the kernel to use a 'initrd' script that will scan for LVM volumes and create the appropiate devices nodes for them.

Be sure you also add '--lvm' to genkernel and 'dolvm' to your kernel boot options.

Regards, 

  Eduard

----------

## jordanwb

Why would I need to add 'dolvm' to my kernal params? I did't do that for my existing kernel. I didn't use genkernel either to make the original kernel.

----------

## richard.scott

what kernel versions did you go from and to?

also, did you do a make menuconfig after cp'ing your .config file into /usr/src/linux?

Usually you need lvm modules inside an initrd file to get lvm to boot root from.

Genkernel does this all for you  :Smile: 

----------

## eduardhc

 *jordanwb wrote:*   

> Why would I need to add 'dolvm' to my kernal params? I did't do that for my existing kernel. I didn't use genkernel either to make the original kernel.

 

The 'dolvm' kernel option tells the initrd script that it must search for & activate any LVM volumes it founds. If not, that step is not performed.

Long history short: if your / partition is on an LVM volume then youy need the following in order to boot:

compile kernel with LVM support built-inuse gernkernel with --lvm flag to generate and install the kerneladd 'dolvm' to your kernel boot options (this step is maybe done for you by genkernel, can't remember right now..)

Again, let me stress this point: you only need this is your ROOT partition is on a LVM volume. You don't need all this stuff is your / is on a regular partition and only /home i.e. is on LVM.

Regards

----------

## jordanwb

 *richard.scott wrote:*   

> what kernel versions did you go from and to?

 

2.6.26.2 -> 2.6.27.6

 *richard.scott wrote:*   

> also, did you do a make menuconfig after cp'ing your .config file into /usr/src/linux?

 

Yes.

 *richard.scott wrote:*   

> Usually you need lvm modules inside an initrd file to get lvm to boot root from.

 

I know. I used the init script creator that was on the Gentoo Wiki before it went under.

----------

## richard.scott

 *jordanwb wrote:*   

> I know. I used the init script creator that was on the Gentoo Wiki before it went under.

 

I don't know about that script.... why not try genkernel its dead easy to use:

```
# emerge genkernel
```

you'll need to copy your .config into /etc/kernels with a filename like this:

```
kernel-config-x86-2.6.25-hardened-r9
```

If genkernel doesn't find this it will use a default generic one from /usr/share/genkernel/x86/kernel-config

and all you do is this to build a kernel:

```
genkernel --lvm --menuconfig all
```

HTH

Rich

----------

## ncl

Just updated from 2.6.26.1 to 2.6.27.3 and im having a similar (same?) problem. My root is on lvm but initrd does not find any volume groups and then hangs at password prompt for luks with an error (root is encrypted as well). If i enter 'shell' and run busybox i can see theres no sda nothing in /dev. At first i thought i forgot to select the sata driver but it's there. Sata/pata config is exactly the same as in my previous kernel. So anyway i guess it's worth checking if your kernel is seeing the disk at all.

edit:

Forgot to add, im building my kernels myself and just using genkernel for the initrd. Actually i just generated the initrd the first time and used it without problems with later kernels. Im doing that since 2.6.23.3 so don't tell me to try genkernel  :Wink: 

----------

## richard.scott

 *ncl wrote:*   

> Forgot to add, im building my kernels myself and just using genkernel for the initrd. Actually i just generated the initrd the first time and used it without problems with later kernels. Im doing that since 2.6.23.3 so don't tell me to try genkernel 

 

What's the advantage in building the kernel yourself when genkernel can do it all for you with a nice and feature full script?

Have you tried the genkernel way just to see if it works???   :Wink: 

----------

## ncl

Yes i did try it once a long time ago. Whats the disadvantage of building your own kernel? Typing 3 make commands is not that hard. I still have to go through all the options even if using genkernel because i like to have everything compiled in and keeping it small. When i update to the next minor release i only do a silentoldconfig and I only use modules when i need something new and don't want to reboot at the time. I don't see how genkernel would make my life easier here.

On the other hand i don't want to go into all the details of building initrd by hand (just yet  :Wink: ) so genkernel is a nice alternative.

Getting back to the original problem, google says that rootdelay=90 on the kernel cmd line might help.

----------

## jordanwb

But something that still hasn't been answered is why my initrd image that I made for the new kernel doesn't work, when I performed the exact (to the letter) process to make the initrd image for the original kernel? And as ncl said, all I need to do is type in 3 simple commands plus an easy command to make the initrd image.

----------

## richard.scott

 *jordanwb wrote:*   

> But something that still hasn't been answered is why my initrd image that I made for the new kernel doesn't work, when I performed the exact (to the letter) process to make the initrd image for the original kernel? And as ncl said, all I need to do is type in 3 simple commands plus an easy command to make the initrd image.

 

Have you checked the kernel config to make sure the requried things are included for LVM i.e. device-mapper etc.

Perhaps the "make oldconfig" doesn't activate this for this kernel?

----------

## jordanwb

 *richard.scott wrote:*   

> Have you checked the kernel config to make sure the requried things are included for LVM i.e. device-mapper etc.
> 
> Perhaps the "make oldconfig" doesn't activate this for this kernel?

 

Yes I'm 105% positive I've configured it to be built in. Whenever I get to the Device drivers section that is the first thing I check. I never used "make oldconfig"

----------

## ncl

jordanwb:

Can you verify that the kernel is detecting your drive?

I just checked with rootdelay=90 and it didn't work. But i noticed something strange. The kernel actually is detecting the drive, dmesg says SATA link up and then some [sda] messages but the device file is not created i.e. no /dev/sda. Is that erm... "normal" behaviour for busybox?

----------

