View Full Version : How do I try a different kernel in Fedora 7 with LVM?

4th July 2007, 01:51 PM

I am having trouble running VMWare on a Fedora 7 install with the 2.6.21 kernel that comes with it. I would like to try a 2.6.18 kernel to see how that goes. I downloaded sources for the 2.6.18 kernel, configured and compiled it, set up grub and booted.

However I get a message a boot time that no logical volume groups can be found. Fedora 7 stuck my root filesystem on LVM when it installed, which seems to make things complicated.

I seems that I have to somehow set up the initrd to have LVM support, but my efforts to do this so far have failed. Seems the standard initrd that the kernel makefile creates doesn't have what's needed.

The lvmcreate_initrd command (not part of the standard Fedora 7 LVM tools - perhaps for some good reason) seems to be what you run to do this. I got hold of this tool and ran it, but when I boot using the resulting initrd I get errors about reading past end of device. I have tried forcing the initrd size to be larger but this doesn't help.

Can anyone help me here? It seems like it should be fairly straight-forward to be able to do this - maybe I'm missing something simple. There are instructions around about making rpms of kernels and so forth, but I just want to try booting with this kernel after building it.

Oh, I have compiled in device-mapper into the kernel in case that helped too, but still no go.


4th July 2007, 03:21 PM
I managed to use a 2.6.18 kernel on fc7 but I can't quite remember the details.
Here are some points that I seem to remember:

- Don't base the kernel's .config on the f7 kernel's .config, because it is that .config that makes f7 do the "New Fedora" way instead of the "Regular" way.

- Be sure the /etc/fstab line for the root mount point / is a device and not a LABEL=
--- If it is LABEL=something the mkinitrd apparently won't set up for LVM
--- Change it to the device designation seen in "df -h" such as:
/dev/mapper/FOO-BAR or
/dev/FOO/BAR where FOO is the VolGroup?? and BAR is the LogVol??

Then using: mkinitrd -f /boot/<KernelVersion>.img <KernelVersion>
may make an initrd that will pull in LVM

Also add a /boot/grub/grub.conf entry for <KernelVersion>
Unknown whether the grub.conf having root=LABEL=blabla is still ok, or needs to be the device as in fstab

Since this is doing the "Regular" way instead of the "New Fedora" way, some fstab entries may need to flip over to hd from sd if they are IDE devices. This is more confusing than it is simple.

5th July 2007, 11:10 AM
Thanks lmo. I've checked my setup and it is already like that. I have /dev/VolGroup00/LogVol00 for root in the fstab file, and also in the grub.conf. I still get the same problem on booting. It says it is searching for volume groups, then says no volume groups were found. It's pretty much all downhill from there!

I did a config of the kernel from scratch - I didn't use the F7 .config file.

I have tried compiling SCSI support and IDE support into the kernel, but still no go. It seems to know about volume groups, but just can't find any! When I boot of the standard F7 kernel everything works fine. Not sure what extra runes they put in theirs to make things work?

5th July 2007, 02:59 PM
Maybe it works better to boot from linux rescue/install CD/DVD:
linux rescue
... pick your installation
... make sure no error message when it mounts it
chroot /mnt/sysimage
... <KernelVersion> should be the one you want among "ls /lib/modules"
mkinitrd -f /boot/<KernelVersion>.img <KernelVersion>

... If still no-go, examine the initrd and perhaps post it as seen in this post here:

I am running fc7 on the older stock fc6 kernel and here is what mine looks like:
root@lmo:~# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/FOO-BAR 12G 4.7G 6.6G 42% /
tmpfs 760M 0 760M 0% /dev/shm
/dev/sda5 99M 68M 26M 73% /boot
root@lmo:~# cat /etc/fstab
/dev/mapper/FOO-BAR / ext3 defaults 1 1
tmpfs /dev/shm tmpfs defaults 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
sysfs /sys sysfs defaults 0 0
proc /proc proc defaults 0 0
/dev/sda6 swap swap defaults 0 0
/dev/sda5 /boot ext2 defaults 1 2
root@lmo:~# uname -r
root@lmo:~# cat /tmp/initrd/init

mount -t proc /proc /proc
echo Mounting proc filesystem
echo Mounting sysfs filesystem
mount -t sysfs /sys /sys
echo Creating /dev
mount -o mode=0755 -t tmpfs /dev /dev
mkdir /dev/pts
mount -t devpts -o gid=5,mode=620 /dev/pts /dev/pts
mkdir /dev/shm
mkdir /dev/mapper
echo Creating initial device nodes
mknod /dev/null c 1 3
mknod /dev/zero c 1 5
mknod /dev/systty c 4 0
mknod /dev/tty c 5 0
mknod /dev/console c 5 1
mknod /dev/ptmx c 5 2
mknod /dev/rtc c 10 135
mknod /dev/tty0 c 4 0
mknod /dev/tty1 c 4 1
mknod /dev/tty2 c 4 2
mknod /dev/tty3 c 4 3
mknod /dev/tty4 c 4 4
mknod /dev/tty5 c 4 5
mknod /dev/tty6 c 4 6
mknod /dev/tty7 c 4 7
mknod /dev/tty8 c 4 8
mknod /dev/tty9 c 4 9
mknod /dev/tty10 c 4 10
mknod /dev/tty11 c 4 11
mknod /dev/tty12 c 4 12
mknod /dev/ttyS0 c 4 64
mknod /dev/ttyS1 c 4 65
mknod /dev/ttyS2 c 4 66
mknod /dev/ttyS3 c 4 67
echo Setting up hotplug.
echo Creating block device nodes.
echo "Loading uhci-hcd.ko module"
insmod /lib/uhci-hcd.ko
echo "Loading ohci-hcd.ko module"
insmod /lib/ohci-hcd.ko
echo "Loading ehci-hcd.ko module"
insmod /lib/ehci-hcd.ko
mount -t usbfs /proc/bus/usb /proc/bus/usb
echo "Loading jbd.ko module"
insmod /lib/jbd.ko
echo "Loading ext3.ko module"
insmod /lib/ext3.ko
echo "Loading scsi_mod.ko module"
insmod /lib/scsi_mod.ko
echo "Loading sd_mod.ko module"
insmod /lib/sd_mod.ko
echo "Loading libata.ko module"
insmod /lib/libata.ko
echo "Loading sata_promise.ko module"
insmod /lib/sata_promise.ko
echo Waiting for driver initialization.
stabilized --hash --interval 250 /proc/scsi/scsi
echo "Loading dm-mod.ko module"
insmod /lib/dm-mod.ko
echo "Loading dm-mirror.ko module"
insmod /lib/dm-mirror.ko
echo "Loading dm-zero.ko module"
insmod /lib/dm-zero.ko
echo "Loading dm-snapshot.ko module"
insmod /lib/dm-snapshot.ko
echo Making device-mapper control node
echo Scanning logical volumes
lvm vgscan --ignorelockingfailure
echo Activating logical volumes
lvm vgchange -ay --ignorelockingfailure FOO
resume /dev/sda6
echo Creating root device.
mkrootdev -t ext3 -o defaults,ro /dev/mapper/FOO-BAR
echo Mounting root filesystem.
mount /sysroot
echo Setting up other filesystems.
echo Switching to new root and running init.
echo Booting has failed.
sleep -1

6th July 2007, 04:15 PM
Ok, I have got it working now. Turns out the LVM issue was a bit of a red herring. It couldn't find any LVM volume groups because it couldn't find any disks! I discovered this after a bit of messing around with the init script in the initrd image.

I have SATA disks and it looks like no SATA support was turned on in the standard 2.6.18 kernel config, and I missed it sitting under SCSI drivers when doing the configuration setup. Once I turned this on, the standard initrd worked just fine. Looks as though vmware may work too. F7 seems to work with no problems with 2.6.18 so far, with the minor exception that reading motherboard temperature sensors isn't supported I think.