Reboot after kernel 2.6.31 is compiled
Insmod: error inserting '/lib/dm-region-hash.ko':-1 File exists
Solution:
1. decompress the initrd file.
[Root @ bogon ~] # Cp/boot/initrd-2.6.30.4.img/tmp
[Root @ bogon ~] # Cd/tmp/
[Root @ bogon tmp] # ls
Initrd-2.6.30.4.img
[Root @ bogon tmp] # mkdir newinitrd
[Root @ bogon tmp] # cd newinitrd/
[Root @ bogon newinitrd] # zcat./initrd-2.6.30.4.img | cpio-I
11537 blocks
After the release, the following content is displayed:
[Root @ bogon newinitrd] # ls
Bin dev etc init lib proc sbin sys sysroot
2. OK. Edit init and delete the two rows in the four repeated rows.
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. Repackage initrd
[Root @ bogon newinitrd] # find. | cpio-c-o> ../initrd
11538 blocks
[Root @ bogon newinitrd] # cd ..
[Root @ bogon tmp] # gzip-9 <initrd> initrd. img
[Root @ bogon tmp] # ls
Initrd-2.6.30.4.img initrd. img newinitrd
Okay, initrd. img is the re-packaged initrd, and then copy initrd. img to/boot, change the initrd-2.6.30.4.img in grub. conf to initrd. img,
So "insmod: error inserting '/lib/dm-region-hash.ko':-1 File exists" won't have
RedHat nash Version 5.1.19.6 startingrver (2.6.33.3)
Mount: cocould not find filesystem '/dev/root'
Setuproot: moving/dev failed: No such file or directory
Setuproot: error mounting/proc: No such file or directory
Setuproot: error mounting/sys: No such file or directory
Switchroot: mount failed: No such file or directory
Kernel panic-not syncing: Attempted to kill init!
[Linux-initrd @ 0x1fc37000, 0x228585 bytes]
So I found a lot on the Internet, and tried many methods such as adding modules, re-compiling N times, and changing fstab. Finally, find a solution on a website.
Method: modify "CONFIG_SYSFS_DEPRECATED_V2" in the. config file during compilation. By default, this option is not set. If it is commented out, change it to y. It is changed to "CONFIG_SYSFS_DEPRECATED_V2 = y". After the modification, compile it again and restart it.