Recompiling Red Hat Enterprise Linux 4 kernel (2.6 kernel)

Posted on 2006-04-06
Last Modified: 2010-04-21
I want to restore Red Hat Entrprise Linux 4 system from a backup of another machine. Sine the hardware is different on my restore machine, the system is not coming up. I want to recompile the kernel to match the hardware
Question by:hmalkan
    LVL 1

    Expert Comment

    Could you provide with the error messages ? Also when you say "not coming up" at which point is it failing to bootup ?

    While recompiling the kernel, the 'make menuconfig' step helps you to tune the kernel according to hardware etc. The file being modified is .config in the kernel source tree.
    LVL 12

    Expert Comment

    You need a boot disk, a floppy usually, to get up and running first.  Then you can can patch the kernel manually until you can make it boot from the hard drive.  You should have a generic bare.i or bareacpi.i and make the bookdisk.  You may also need ramdisks.

    Author Comment

    Let me provide you with details of my problem.
    I had a  RedHatEnterprise Linux 4 Update 2 installed on a slower Pentium III machine  for establishing vpn connections to various locations.  Now i have a faster Pentium 4 machine and i want to restore the backup of my old PIII machine to P 4 machine. I am using dump and restore .  The restore on new p4 machine was successful (all filesystems /  /boot /usr /var restored)  But  i boot the system it hangs  at the grub loader  with error  unable to locate file and the display is  all greyed/blurry.  
    I tried recompiling the kernel  (all references for recompiling kerenel say /usr/src/linux but in RHEL4 it is /usr/src/kernels/ kernel-version/)  after booting from  cd with Linux rescure mode , chroot /mnt/sysimage  but it fails . Here is what i did
    cd /usr/src/kernels/kernel-version
    make mrproper  ( fails)
    make &&  make modules (fails)

    Thanks for suggestions. More help is appreciated

    LVL 12

    Accepted Solution

    Point: can't 'make' on a dead system.  Either use the floppy or some other Linux installation to pick around the bad system until you find out what is causing the kernel to panic.  There is another way to bypass the init files, but I don't remember the command.

    You probably need to be in mode 1, teleinit.  Which is very basic and used to fsck the file system.
    LVL 27

    Assisted Solution

    System compiled for PIII should boot on PIV unless you are using different boot media (i.e it was IDE and it becomes SCSI).
    If you have the same boot media problem is not in your kernel.
    You may have different partitions than on original system - it may be a reason of your problem.
    Suppose "/" it was /dev/hda1 on old system and "/" is /dev/hda5 now or something like this.

    I recommend you to repartition new hard drive and create '/boot' as first partition '/dev/hda1' of your new system. '/' will be next. Of couse you need to perform restore again then.

    'system it hangs  at the grub loader  with error  unable to locate file and the display is  all greyed/blurry' it points to incorrectly configured/installed 'grub' loader.

    To be clear with your problem please supply:

    (when booted from CD)
    fdisk -l /dev/hda

    (then mount "/", "/boot" partitions)
    df -h

    (then chroot to new /):

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Join & Write a Comment

    Have you ever been frustrated by having to click seven times in order to retrieve a small bit of information from the web, always the same seven clicks, scrolling down and down until you reach your target? When you know the benefits of the command l…
    The purpose of this article is to fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
    This video is in connection to the article "The case of a missing mobile phone (". It will help one to understand clearly the steps to track a lost android phone.

    755 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now