• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 332
  • Last Modified:

Recompiling Red Hat Enterprise Linux 4 kernel (2.6 kernel)

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
2 Solutions
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.
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.
hmalkanAuthor Commented:
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

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.
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 /):
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Amazon Web Services - Basic

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now