# Kernel parameters for LVM on RAID1? [SOLVED]

## binro

I have been setting up LVM on RAID using the excellent HOWTO at http://gentoo-wiki.com/HOWTO_Gentoo_Install_on_Software_RAID_mirror_and_LVM2_on_top_of_RAID.

All goes well until I try to boot. I have strayed from the HOWTO by putting all the partitions on the VG (except for /boot), so my kernel parameters contain:

```

root=/dev/vg/rootfs dolvm2 lvmraid=/dev/md2,/dev/md3

```

When I boot I get:

md: Autodetecting RAID arrays.

md: autorun ...

md: ... autorun DONE.

VFS: Cannot open root device "vg/rootfs" or unknown-block(0,0)

Please append a correct "root=" boot option

Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)

At this point I am at a loss! Note I have built the file-system, raid and device-mapper modules into the kernel to avoid messing around with initrd images. Anybody any ideas?

TIA

----------

## aceFruchtsaft

I'm not sure if compiling the stuff into the kernel is sufficient. You probably need other things in the initramfs as well in order to get it working.

If you are using Genkernel to compile your kernel (which simplifies this task), have you used the --lvm2 --mdadm options?

----------

## binro

 *aceFruchtsaft wrote:*   

> I'm not sure if compiling the stuff into the kernel is sufficient. You probably need other things in the initramfs as well in order to get it working.
> 
> If you are using Genkernel to compile your kernel (which simplifies this task), have you used the --lvm2 --mdadm options?

 

I always compile kernels by hand, but now you mention it, I think you could be right, you need an initrd. I will install genkernel and give it a spin.

Cheers

----------

## aceFruchtsaft

 *binro wrote:*   

>  *aceFruchtsaft wrote:*   I'm not sure if compiling the stuff into the kernel is sufficient. You probably need other things in the initramfs as well in order to get it working.
> 
> If you are using Genkernel to compile your kernel (which simplifies this task), have you used the --lvm2 --mdadm options? 
> 
> I always compile kernels by hand, but now you mention it, I think you could be right, you need an initrd. I will install genkernel and give it a spin.
> ...

 

Just be sure to backup your .config. I never understood how genkernel manages the .config file, but since I don't like to lose my prooven kernel configuration, I always run genkernel with the --no-clean option, otherwise it might overwrite .config.

----------

## binro

I used genkernel to make an initrd and now get:

20:07:14  32;1m>> 0;39m 1m Activating mdev  0;39m

20:07:14  32;1m>> 0;39m 1m Activating Device-Mapper RAID(s)  0;39m

20:07:14 no block devices found

20:07:14  32;1m>> 0;39m 1m Detected real_root as a md device. Setting up the device node.

20:07:14 ..  0;39m

20:07:14  32;1m>> 0;39m 1m Detected real_root as a md device. Setting up the device node.

20:07:14 ..  0;39m

20:07:14  32;1m>> 0;39m 1m Scanning for Volume Groups  0;39m

20:07:14   Reading all physical volumes.  This may take a while...

20:07:17  32;1m>> 0;39m 1m Activating Volume Groups  0;39m

20:07:17  32;1m>> 0;39m 1m Determining root device...  0;39m

20:07:17  31;1m   0;39m 1m Block device /dev/vg/rootfs is not a valid root device...  0;3

20:07:17 9m

20:07:17  31;1m   0;39m 1m Could not find the root block device in .  0;39m

20:07:17    Please specify another value or: press Enter for the same, type "shell" for a

20:07:17  shell, or "q" to skip...

20:07:17 root block device() :: 

It still doesn't like the root device.   :Sad: 

----------

## binro

Ok, by dint of reading through the /linuxrc code that genkernel builds into the initrd, I realised that I needed a "domdadm" parameter, not "dodmraid". Then it all gets up and walks.   :Very Happy: 

It's not easy this stuff. So the final list of parameters is:

```

root=/dev/ram0 init=/linuxrc real_root=/dev/vg/rootfs dolvm domdadm lvmraid=/dev/md2,/dev/md3

```

HTH

----------

## aceFruchtsaft

 *binro wrote:*   

> Ok, by dint of reading through the /linuxrc code that genkernel builds into the initrd, I realised that I needed a "domdadm" parameter, not "dodmraid". Then it all gets up and walks.  
> 
> 

 

Which is weird as I have been booting a  genkernel-generated kernel for some years now, also have the root partition on an MD device (though not on LVM as you do) and never even knew about the "domdadm" parameter. The system still boots fine, and the output on the screen even say's something like "root device is on MD... activating MD ...".

Update: Coming to think about it, since I have real_root=/dev/mdx the kernel/init scripts automatically know that the device mapper is needed, while you have real_root=/dev/vgx/rootfs, where it's not obvious. That kind of makes sense.  :Wink: 

----------

