# Using my own kernel, initramfs problems with LVM root disk

## zBrain

Preface: using a genkernel built kernel/initramfs I can use the system, so everything on that level is ok.

I built my own kernel, however, and subsequently used genkernel to generate an initramfs:

```
genkernel --lvm --mdadm iniramfs
```

The mdadm is probably unnecessary, my /home is on mdadm but my root drive is on my SSD.

The symptom is pretty simple, I get to "loading initramfs" after selecting it from grub2, and it stops.

My question is: how do I find out why it stops? Is there a way to debug an initramfs? A log somewhere?

----------

## szatox

What is your boot commad line?

You can debug from within initramfs. Simply add "debug" param to boot options.

What do you mean by "your own kernel"? Is it the same version as initramfs? Have you changed modules in the meantime? (between building initramfs and kernel)

----------

## zBrain

I just tried booting with debug enabled - it seems to not even get far enough in to do that.

Here's the grub entry:

 *Quote:*   

> 
> 
>  menuentry 'Gentoo GNU/Linux, with Linux 4.3.3' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.3.3-advanced-4d3dfdc5-31ba-4185-abea-81dc1a093809' {
> 
>                 load_video
> ...

 

There is an insmod lvm in grub's header portion as well

----------

## NeddySeagoon

zBrain,

```
linux /vmlinuz-4.3.3 root=/dev/mapper/vg--gentoo-lv--root ro dolvm rootfstype=ext4
```

You need lvm support to get root mounted but its not even getting that far, unless you omitted console support from the kernel.

It might be booting correctly but you just can't see it.

make friends with wgetpaste and use it to share your kernel .config

----------

## zBrain

Interesting tool...

https://bpaste.net/show/6f5e2ef11772

Appreciate you taking the time to help.

----------

## NeddySeagoon

zBrain

You have 

```
# CONFIG_BLK_DEV_DM is not set
```

thats the kernel support for device mapper, otherwise LVM, so your kernel will never see the root filesystem.

<*> will work, <M> will work if the module is in your initrd. 

That's actually a menu control. What you need inside the menu depends on the LVM features you use.  A lot of the options are for testing.

I didn't ask for your lspci but the high level SCSI and AHCI options are there.  That's suits most people today.

As you have CONFIG_VGA_CONSOLE=y and CONFIG_DRM_RADEON=m your kernel shoulh start on the text kernel, then switch to the Radeon framebuffer console once the module loads.  If the module is in the initrd, that's fairly early in the boot process.  If the module is missing from the initrd, you don't get the Radeon framebuffer console until root is mounted, which we have already said, isn't going to happen.

grub loads the compressed kernel, the initrd and jumps to the kernel entry address.   

The first thing the kernel does is put the message "Decompressing Linux..." on the console.  The kernel is still compressed when this happens, so its still a long way from mounting the initrd as the temporary root.

Do you see "Decompressing Linux..." on the console?

You have 

```
# CONFIG_EFI is not set
```

that's OK as long as your BIOS is not in EFI mode.

Can you post your lspci please?

There are some more subtle ways to be missing console text, like you have multiple displays/video cards and the BIOS and kernel use different display surfaces.

----------

## zBrain

I really thought you had nailed it. I updated my kernel config, ran make all && make install, then rebuilt my initramfs and ran grub2-mkconfig....

Same result. I get the echo from grub, then "Loading initramfs" then nothing. I do not get "Decompressing Linux"

This machine actually has nvidia cards in it. 2x 580 running SLI and 3 displays.

I am booting EFI, and added that as well.

My new .config:

https://bpaste.net/show/0d72a4a80fa2

lspci

 *Quote:*   

> 
> 
>  # lspci
> 
> 00:00.0 Host bridge: Intel Corporation Xeon E5/Core i7 DMI2 (rev 07)
> ...

 

----------

## zBrain

 *NeddySeagoon wrote:*   

> zBrain
> 
> There are some more subtle ways to be missing console text, like you have multiple displays/video cards and the BIOS and kernel use different display surfaces.

 

Can anybody expound on this? I suspect this may be my issue.

----------

## NeddySeagoon

zBrain,

The console output may be present but not on the display surface you are expecting it on.

With two graphics cards, I have seen the boot messages and grub on one card and the kernel console on another.

You have to connect two displays or move the display to the other card to see both with a single display.

SLI won't be in use until the nvida drivers get loaded and thats well into the boot process.  

Even then, nvidia-drivers does not provide a console. You need plain old VGA Console.

Removing one graphics card meanwhile may be an easy debug option.

----------

## zBrain

I am now having the same issue with newer genkernel builds. I plugged a monitor in to every output on the video cards and it is not booting on any of them. I've googled everything I can think of and tried countless variations of kernel configs. I've even tried poking through diffs on the working config vs mine to no avail.

Is there a way to get a log to see what's failing?

----------

