Common kernel compilation errors

Source: Internet
Author: User

 

 

 

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.

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.