Friday 4 January 2013

You get a kernel panic after doing a kernel update when using hyper-v integration services aka linuxic

It appears the hyper-v integration tools have no way to detect that the kernel has been updated. If you update your kernel the linuxic tools will be stuck on the old version and it will cause a kernel panic after you reboot. You need to select the previous kernel and boot into that to fix it.

Run "uname –r" to get the current kernel

Run the following commands to find which files are using uname to retrieve the kernel version
  • cd /opt/linuxic
  • grep –iR “uname –r” *
Edit the files with vi and replace "uname –r" with the following

shell echo "2.6.18-194.26.1.el5PAE" in the make files (your kernel version will be different)

echo "2.6.18-194.26.1.el5PAE" in the perl scripts  (your kernel version will be different)

Then run the script below. The script will detect the latest kernel (from /etc/grub.conf) version and upgate the linuxic files

 
date=`date +"%d%m%Y"`;

cp -R /opt/linuxic /opt/linuxic."$date";
cd /opt/linuxic;

grep -m2 title /etc/grub.conf | awk '{print $7}' | sed -e 's/(//g;s/)//g' | xargs > kernels.txt

while read newkernel oldkernel
do
grep -ilR "echo \"$oldkernel\"" * | xargs sed -i 's/'$oldkernel'/'$newkernel'/g';
done < 'kernels.txt'
 
  
If Linux Integration services are not installed then:
  • Download the latest linux integration services for hyper-v
  • Login to SVCMM
  • Right click on virtual machine and select properties
  • Select DVD/CD drive in the menu, on the right select the image file option
  • Select the LinuxIC file, select the share option also
  • Click OK and go back to console
  • Run “mkdir /mnt/cdrom; mount /dev/cdrom /mnt/cdrom”
  • Mkdir /opt/linuxic
  • Cp /mnt/cdrom/* /opt/linuxic
  • Cd /opt/linuxic
  • Make
  • Run the fix above and set up the script to update the kernel version in linuxic

No comments:

Post a Comment