# help booting lvm rootfs using genkernel - SOLVED

## Moriah

I am having a TERRIBLE time trying to get a new box to boot!    :Evil or Very Mad: 

The box is an AMD quad-core and I am running genkernel-x86_64-2.6.29-gentoo-r5 on it.  It has 5 SATA drives in a SATA backplane.  I was able to boot the box using a non-LVM root filesystem and a fully manually generated kernel.    :Cool: 

I need it to have LVM on the root filesystem so I can use snapshots for backup integrity.  I cannot get it to boot with the root filesystem under LVM.    :Sad: 

I had no trouble running:

```

modprove dm_mod

vgscan

vgchange -a y

```

from the liveCD, and everything went smoothly during the routine install per the AMD64 Handbook.  I used genkernel to make the kernel, with manual control imposed by menuconfig, and keeping my old config from the manually generated kernel as a starting point.

Here is the /boot/grub/grub.conf section used to boot the box:

```

title=genkernel-x86_64-2.6.29-gentoo-r5

root (hd0,0)

kernel /kernel-genkernel-x86_64-2.6.29-gentoo-r5 root=/dev/ram0 init=/linuxrc ramdisk=8192 real_root=/dev/gentoo/rootfs dolvm udev

initrd /initramfs-genkernel-x86_64-2.6.29-gentoo-r5

```

But when I boot it, I get:

```

>> Activating mdev

>> Scanning for Volume Groups

  Reading all physical volumes.  This may take a while...

>> Activating Volume Groups

>> Determining root device...

!! Block device /dev/gentoo/rootfs is not a valid root device...

!! Could not find the root block device in .

   Please specify another value or: press Enter for the same, type "shell" for a shell, or "q" to skip...

root block device() :: 

```

If I then type shell and do a vgscan, I get "no volume groups found".    :Sad: 

Does anybody have a clue what is wrong?  This is driving me nuts!    :Evil or Very Mad: 

Thanks!    :Very Happy: 

----------

## John R. Graham

Have you see the Gentoo LVM2 installation guide or the Gentoo Linux x86 with Software Raid and LVM2 Quick Install Guide?

- John

----------

## Moriah

Yes, I have read them both.  This is not my first time doing this.  I have many machines running LVM on the root filesystem, but it is the first time I have done it in well over a year.  Apparently, something drastic has changed since then, as my old initrd setup will not work with the newer kernel, so I tried to use genkernel to create one.  Things have changed *SO* much that its not even called initrd anymore; its called initramfs!

I have 3 machines that need to be built, and many others that could use a kernel upgrade, but until this problem is resolved, I dare not mess with the production systems.

Oh yes, I also have one box with the root filesystem on RAID-1 and LVM, but it is running the 2.6.15-gentoo-r1 kernel.

The documentation you referred me to is older than Methuselah:

http://www.elilabs.com/cgi-bin/myword_query.cgi?query=Genesis%205:27#27  :Surprised: 

Is there any more recent HowTo that was written after all these changes?

Thanks for your help!    :Very Happy: 

----------

## Moriah

I got it!    :Very Happy: 

I had to build the modules, and then make sure that the device mapper and the lvm stuff (snapshot, crypt, zero, etc.) were *NOT* modules.  It only took me 2 tries after I switched away from a completely static kernel to get it all to work.  The first try I got the vgscan to detect the logical volumes, so I knew I was on the right track.

Nobody ever responded to this thread, and very little response to an earlier thread I opened for the same problem.  This has been a back-burner effort for me for over a month, but now its working.

----------

## Shingoshi

 *Moriah wrote:*   

> I got it!   
> 
> I had to build the modules, and then make sure that the device mapper and the lvm stuff (snapshot, crypt, zero, etc.) were *NOT* modules.  It only took me 2 tries after I switched away from a completely static kernel to get it all to work.  The first try I got the vgscan to detect the logical volumes, so I knew I was on the right track.
> 
> Nobody ever responded to this thread, and very little response to an earlier thread I opened for the same problem.  This has been a back-burner effort for me for over a month, but now its working.

 

I know how you feel about not having your threads answered. I don't know if my situation is like yours or not. I installed my system by simply copying over the files from the livecd to my harddrive. I thought by doing that, I would have the kernel included as well. I had to go look for it /mnt/livecd/usr/src/arch/x86 to get the right bzImage. My system started to boot, but then hung without knowing how to handle the xfs filesystem. It seemed to have no problem with the fact the root partition is on RAID1. But the problem now remains as to how to specify xfs as the root filesystem type. I thought it would be something as simple as -t xfs. I haven't tried it yet, because I have to keep switching my monitor between the two machines. But I guess I'll try that right now and see what happens.

Ok. Here's the update. I rebooted and got the errors:

 *Quote:*   

> SQUASHFS error: squashfs_read_data failed to read block 0,0
> 
> SQUASHFS error: unable to read squashfs_super_block
> 
> VFS: Cannot open root device "md0" or unknown block (9,0)
> ...

 

So could someone please explain the best way to fix this. I'm thinking of just trying to install a new kernel from emerge in my now running chroot. I hope that will work. But if there's an easier way for me to simply boot my system with the kernel from the livecd, please how to go about it.

Thank you in advance!

Xavian-Anderson Macpherson

Shingoshi

----------

## Moriah

You can't just copy the liveCD kernel because it reads a squashfs from the livecd, and you need to read an xfs for your root filesystem.  You need to build a kernel for your machine.  If you need help building a kernel, go to Pappy's Kernel Seeds at https://forums.gentoo.org/viewtopic-t-801641-start-475.html and you will find all the expert help you need.

----------

## Shingoshi

 *Moriah wrote:*   

> You can't just copy the liveCD kernel because it reads a squashfs from the livecd, and you need to read an xfs for your root filesystem.  You need to build a kernel for your machine.  If you need help building a kernel, go to Pappy's Kernel Seeds at https://forums.gentoo.org/viewtopic-t-801641-start-475.html and you will find all the expert help you need.

 

Thanks for the response. I soon realized there was no way around it. So I built a new kernel and installed it. My system is running now. I just need to get back into it with either "init 1" or the livecd and change the master password. But all in all, I'm very please with my progress.

Thanks!

Xavian-Anderson Macpherson

Shingoshi

----------

