If you receive an error for pvscsi about no modules found after upgrading the kernel.
# /sbin/mkinitrd -v -f /boot/initrd-2.6.18-417.el5-2.img 2.6.18-417.el5 Creating initramfs Modulefile is /etc/modprobe.conf Looking for deps of module ehci-hcd Looking for deps of module ohci-hcd Looking for deps of module uhci-hcd Looking for deps of module ext3: jbd Looking for deps of module jbd Looking for driver for device sda2 Looking for deps of module pci:v000015ADd000007C0sv000015ADsd000007C0bc01sc07i00 Looking for deps of module pvscs No module pvscsi found for kernel 2.6.18-417.el5, aborting.
find the module in the previous kernel and copy it into the lib folder of the new kernel image.
# find /lib/modules/2.6.18-308.4.1.el5/ -name "pvscsi*" /lib/modules/2.6.18-308.4.1.el5/misc/pvscsi.ko # cp /lib/modules/2.6.18-308.4.1.el5/misc/* /lib/modules/2.6.18-417.el5/misc *Note: optionally, you can copy all the VMware drivers from the old kernel with # cp /lib/modules/2.6.18-308.4.1.el5/misc/vx* /lib/modules/2.6.18-417.el5/misc # depmod -a 2.6.18-417.el5
Create again the new initrd file
# mkinitrd -f --with=pvscsi --with=vmxnet --with=vmxnet3 /boot/initrd-2.6.18-417.el5-2.img 2.6.18-417.el5 Creating initramfs Modulefile is /etc/modprobe.conf Looking for deps of module pci:v000015ADd000007C0sv000015ADsd000007C0bc01sc07i00: scsi_mod pvscsi Looking for deps of module scsi_mod Looking for deps of module sd_mod: scsi_mod Looking for deps of module pvscsi: scsi_mod Looking for deps of module pci:v000015ADd000007A0sv00000000sd00000000bc06sc04i00: shpchp Looking for deps of module vmxnet Looking for deps of module vmxnet3 [snipped] Adding module scsi_mod Adding module sd_mod Adding module pvscsi Adding module vmxnet Adding module vmxnet3
Edit grub.conf and include in the new kernel image, the new initrd just created.
# vi /etc/grub.conf title Red Hat Enterprise Linux Server (2.6.18-417.el5) root (hd0,0) kernel /vmlinuz-2.6.18-417.el5 ro root=/dev/rootvg/root initrd /initrd-2.6.18-417.el5-2.img
Script to fix the VMWare paravirtual driver
#!/bin/bash
# Get the latest kernel installed
NEW_VERSION=`ls -tA1 /lib/modules | head -n 1`
# Check if the module is already present, if not- continue
if [ ! -e /lib/modules/$NEW_VERSION/misc/pvscsi.ko ]; then
# Log output to show version we’re fixing
/bin/logger “Fixing VMware Paravirtual Drivers for reboot. Kernel: $NEW_VERSION”
# Create the misc directory that VMware tools would
mkdir /lib/modules/$NEW_VERSION/misc > /dev/null 2>&1
# Find the current running kernel
OLD_VERSION=`uname -r`
# Copy the existing module to new kernel tree
cp /lib/modules/$OLD_VERSION/misc/pvscsi.ko /lib/modules/$NEW_VERSION/misc > /dev/null 2>&1
# Rebuild our modules cache
depmod -a $NEW_VERSION > /dev/null 2>&1
# Create a new initrd, including the new pvscsi module
mkinitrd -f –with=pvscsi /boot/initrd-$NEW_VERSION.img $NEW_VERSION > /dev/null 2>&1
else
# This would occur when module is already present
/bin/logger “VMware Paravirtual Drivers Fix Installed”
fi
exit 0
|