Kernel compilation with lvm

Cédric grandspas at opmbx.org
Mon Apr 6 20:16:54 UTC 2015


Finally I did it! Yes!

I had other problems but I was able to solve all of them. I will just
describe what I did. First I used the Pkgfile for building dracut. Then
I
used it to generate the mkiniramfs. Because I don't use so often a
chroot environment, I didn't understand at first why dracut was not able
to build the lvm module in the initramfs. It was because lvm was
provided by the iso, but I had not installed it in the mount partition.
So
after the setup-chroot the lvm command was not found. I solved it by
also installing it.

I edited the file dracut.conf with the following line:

# Bring up <device> in initramfs, <device> should be the device name
add_device+=" /dev/mapper/lvolroot /dev/mapper/lvolswap
/dev/mapper/hdvg-lvolhome "

Those directories are my root partition, swap and home. To build the
initramfs:

# dracut --add-fstab /etc/fstab

I'm not sure if that option is necessary. I have then
installed the lilo bootloader. At the beginning because I had a lot of
problems I installed several times lilo. I happened that lilo could not
install because the kernel was too big (I don't remember exactly the
exact error message). No idea why, after a reboot, it worked without a
problem. After the reboot I got an error like:

"VFS: cannot open root device "fe00" or unknown. Please append a correct
"root = " boot option.
Kernel Panic - not syncing: VFS unable to mount root fs."

My first kernel panic after many years without, a pleasure! Perhaps
James gave me the answer:

>    Dracut should work out of box but very important you append kernel
>    command
>    line to lilo.conf. Dracut will show you what it finds using dracut
>    --print-cmdline (I think)

It was indeed the solution. I had the option for lilo:

root=/dev/mvg/lvolroot

but it didn't work. It's necessary to give it with the "append"
parameter:

append="ro root=/dev/mvg/lvolroot"

I use syslinux as bootloader, so for me I didn't think to use the
"append" parameter.

After that I was able to boot. Thank you for your help!

Now I can discover crux!

Regards,

Cédric




More information about the CRUX mailing list