building LVM kernels for RH

James McDonald james
Wed Jun 29 06:52:49 PDT 2005


Net Llama! wrote:

>Anyone here had any success building your own 2.6.x kernel from the
>pristine kernel.org source on a RH system that is using LVM (either RHEL4
>or FC3/4)?
>
>I've tried using an initrd and also compiling in support for LVM into the
>2.6.12.1 kernel, and both times, the root filesystem can't be found on
>bootup:
>VFS: Cannot open root device "mapper/VolGroup00-LogVol00" 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)
>
>Surely there has to be a way to do this without using RH's kernel?
>
>  
>
tar -jxf /home/jamesm/downloads/kernel/linux-2.6.12.1.tar.bz2 # untar 
into /usr/src
ln -sf linux-2.6.12.1/ linux # symlink so it is something abit short
cd linux # change directorys
make oldconfig # run make oldconfig
make menuconfig # enable NTFS / CIFS etc
make mrproper # wipe it all out because I didn't know mrproper deletes 
.config arrgh
vi Makefile # put a jmcd on the end of the EXTRAVERSION value
cp /boot/config-2.6.10-1.741_FC3 ./.config  # copy the running kernels 
config back
make oldconfig # do the configuration again ... grumble
make menuconfig
make all # run make all (which incidently creates an initrd)
make modules_install  # have to run this _before_ make install because 
make install relies on the modules directory being there already
make install # install System.map vmlinuz initrd
ls /boot/  # check it out
vi /etc/grub.conf # edit to make the new kernel the default
shutdown -r now # reboot
ps -ef # have a look at what's running hmm seems alright
lsmod # check to see if the modules I need are loaded
pptpconfig # run one of the critical programs I need for work which auto 
creates a mpppe module. yup it's gold.
history  > kernel_compile.txt

Mine worked straight away I have two ATA HDD's which the linux root 
spans across

Disk /dev/hda: 20.4 GB, 20485785600 bytes
255 heads, 63 sectors/track, 2490 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/hda1   *           1          13      104391   83  Linux
/dev/hda2              14        2490    19896502+  8e  Linux LVM

Disk /dev/hdb: 30.0 GB, 30020272128 bytes
255 heads, 63 sectors/track, 3649 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/hdb1   *           1        1020     8193118+   7  HPFS/NTFS
/dev/hdb2            1021        3649    21117442+  8e  Linux LVM


More information about the Linux-users mailing list