There are a number of boot problems related to missing modules in the initrd image, boot device can't be found, and also many mount or device scanning problems that result in errors like:
switchroot:mount failed
Kernel panic-not synching:Attempted to kill init!
In order to get better errors, you want to add some debugging to the initrd image. An easy way to do this, is by hopefully by selecting and booting a kernel/initrd that does work, or booting Linux Rescue (with networking) and getting a copy of the initrd.
Once you have the initrd image, you can unpack it, edit, and re-pack it with the following commands.
Now vi init and change the following lines.
echo Mounting proc filesystem echo Mounting sysfs filesystem mount -t sysfs /sys /sys echo Creating /dev
Now, repack the modified initrd.
switchroot:mount failed
Kernel panic-not synching:Attempted to kill init!
In order to get better errors, you want to add some debugging to the initrd image. An easy way to do this, is by hopefully by selecting and booting a kernel/initrd that does work, or booting Linux Rescue (with networking) and getting a copy of the initrd.
Once you have the initrd image, you can unpack it, edit, and re-pack it with the following commands.
cd /tmp
mkdir initrd
cd initrd
gzip -dc /boot/initrd-2.6.18-194.el5.img | cpio -ivd Now vi init and change the following lines.
#!/bin/nash
mount -t proc /proc /proc
setquiet <<----- remove or # out find . | cpio --quiet -c -o | gzip > /boot/initrd_test.img
echo Mounting proc filesystem echo Mounting sysfs filesystem mount -t sysfs /sys /sys echo Creating /dev
For multipath issues,
add in an extra line to display the mpath devices, and also change the verbosity on the multpath scan so you can see if any devices are getting created.
echo Creating multipath devices
/bin/multipath -v 0 <<<<---- change this to -v1
dmsetup ls --target multipath --exec 'kpartx -a -p p'
/bin/multipath -l <<<<---- add this to list mpath devicesNow, repack the modified initrd.
find . | cpio --quiet -c -o | gzip > /boot/initrd_test.img
本文介绍了解决Linux系统中由于initrd映像缺少模块、无法找到启动设备等问题的方法。通过调试initrd映像,可以获取更详细的错误信息,帮助诊断与多路径相关的启动故障。
905

被折叠的 条评论
为什么被折叠?



