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
hmalkanAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

jainrahCommented:
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.
GinEricCommented:
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


GinEricCommented:
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.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Artysystem administratorCommented:
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 /):
/etc/fstab
/boot/grub/grub.conf
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux OS Dev

From novice to tech pro — start learning today.