JonsenElizee 发表于 2013-1-26 14:33:02

如何解决内核编译dm-region-hash File Exists 错误

these days, I compiled linux-2.6.32.2 linux new kernel.
when I boot from the new kernel, dm-region-hash File Exists this error will occur.
here, I find some material from web and share with every one for the new kernel will be compile by many linux fans.
编译2.6.31内核后重启出现
insmod: error inserting '/lib/dm-region-hash.ko' : -1 File exists
解决方法:
1,解压initrd文件
# cp /boot/initrd-2.6.30.4.img /tmp
# cd /tmp/
# ls
initrd-2.6.30.4.img
# mkdir newinitrd
# cd newinitrd/
# zcat ../initrd-2.6.30.4.img |cpio -i
11537 blocks
释放之后看到如下内容
# ls
bindevetcinitlibprocsbinsyssysroot

2,ok,下边就是编辑init,删掉其中重复的四行中的两行
echo "Loading dm-region-hash.ko module"
insmod /lib/dm-region-hash.ko
echo "Loading dm-region-hash.ko module"
insmod /lib/dm-region-hash.ko

3,重新打包initrd
# find .|cpio -c -o > ../initrd
11538 blocks
# cd ..
# gzip -9 < initrd > initrd.img
# ls
initrd-2.6.30.4.imginitrd   initrd.img    newinitrd

好了,initrd.img就是重新打包的initrd了,然后把initrd.img拷贝到/boot,更改grub.conf里边的initrd-2.6.30.4.img为initrd.img就可以了,
这样“insmod: error inserting '/lib/dm-region-hash.ko' : -1 File exists” 就不会有了

其实将init文件的第二行“setquiet” 去掉,你就知道initrd文件到底在做什么了
页: [1]
查看完整版本: 如何解决内核编译dm-region-hash File Exists 错误