Monday, June 8, 2009

kernel panic on boot and lvm filters

Problem:

Updated the RHEL5 system to 2.6.18-92.1.13.e15 kernel. When he rebooted the system, system panicked with following errors.


Unable to access resume device (/dev/VolGroup00/LogVol01)
mount: could not find filesystem '/dev/root'
setuproot: moving /dev failed: No such file or directory
switchroot: mount failed: No such file or directory
Kernel panic - not syncing: Attempted to kill init!


Troubleshooting:

I saw / mounted on lvm.

/dev/mapper/VolGroup00-LogVol00 on / type ext3 (rw)


But in the 'vgdisplay' command output, I was not able to see the logical volume !!!!

Interestingly following entry was in /etc/lvm/lvm.conf.

filter = [ "r/disk/", "r/sd./", "a/./" ]


The filter will exclude all /dev/disk/* and /dev/sd* devices.


Solution:

Edit /etc/lvm/lvm.conf and replace following entry

filter = [ "r/disk/", "r/sd.*/", "a/.*/" ]


with

filter = [ "a/dev/mapper/.*/", "a/dev/sda2$/", "r/.*/" ]


This filter will enable all /dev/mpath/* devices and /dev/sda2 device where the / was mounted.

* Clear /etc/lvm/.cache.

# > /etc/lvm/.cache


* Run vgscan command

# vgscan


* Reinstall the latest kernel rpm.

# rpm -e kernel-2.6.18-128.1.10.el5
# yum install kernel


After following the suggestions, the system booted fine with the new kernel.

Rebuilding the initrd would have also worked.

No comments:

Post a Comment