0

I was reading the linux book which says this

Finally, if you break your kernel or boot loader, you won't be able to get to single-user mode without extra help. You can often boot your system with a kernel from a bootable CD-ROM by passing the root parameter to the CD-ROM's kernel boot loader. Your system might look somewhat strange without your regular kernel, but you should still be able to move files around or perhaps even compile a new kernel to get yourself out of the jam.

Now i want to practically do that and see how i can recompile the broken kernel from cd.

I means i have the running fine version of centos. I do something and my system won't boot as kernel gor corrupted.

Now can i recompile the kernel as said in book so that i can bring my system in running state. or my all chnages will be lost and data as well

Zoredache
  • 130,897
  • 41
  • 276
  • 420

1 Answers1

3

Simply delete the kernel (or move it somewhere other then /boot) and you will experience the situation described.

Unless you originally compiled your kernel from source there is no reason why you would do that while booted from a CD. Typically you would just download or reinstall the kernel package, or if you are doing what you are supposed to restore it from your backup.

Zoredache
  • 130,897
  • 41
  • 276
  • 420
  • Ok i install the centos from distribution cd. all the settings are set and i deleted the kernel. how can i recompile only kernel with all user home directories as it is –  Jun 29 '10 at 06:53
  • I tend to strongly favor the Debian/Ubuntu distributions. I am not sure exactly what packages you need to reinstall or what tools you would use to rebuild the kernel. – Zoredache Jun 29 '10 at 07:28