the linux can't boot after compile a new kernel
Hi,all:
I am a newbie and studying the kernel. I installed a fedora with kernel 2.6.15-1 (quite old, isn't it ?) on my vmware workstation and try to compile a new kernel with 2.6.15.2 just for testing. I download the kernel and compile with that: make menuconfig make modules-install install then I reboot the server but if i choose the new kernel. the system poped up the error msg like : Unable to find device-mapper major/Minor No volume groups found unable to find volume group "VolGroup00" Unable to access resume devices (/dev/VolGroup00/Logvol01) mount: could not find filesystem '/dev/root' ======= yes. I am using LVM to setup the fedora. i search online and find some possible causes: 1) the .config does not contain support for LVM. then i choose to enclude the support for LVM 2) need to re-create initrd i use commond initrd --force-lvm-probe to generate the .img file But both the method do not work. and i notices that the new '2.6.15.2.img' is about 1.5M which is smaller than the current 2.6.15.1 img (1.7M) how can i check the problem ? thanks |
Hi aaaaatoz, welcome to LQ,
this cannot work (in most cases) and this has nothing to do with LVM. If you download the kernelsources, there is a default .config file which is not adapted to your computer. You need a .config file for your computer in order to build a kernel which supports your hardware. One way to achieve this is to copy the .config file from the kernel sources of your 2.6.15.1 kernel to the sources of the new kernel. Then run Code:
make oldconfig I'd recommend to build this kernel and try it out (if you need an initrd you'll have to create a new one). If the new kernel works, you may change the configuration, for example add the LVM. Markus |
Hey, how about intial ram disk? As i see you did it but have choosed a version of your new kernel when creating initrd?
|
Quote:
I did it by initrd --force-lvm-probe newversion.img newversion |
Quote:
thanks, i will do it soon |
Quote:
thanks in advance! |
As I wrote, you'll have to copy the .config file of the old kernel into the sourcedirectory of the new one. Then the command "make oldconfig" creates a new .config with the additional kernelfeatures, i.e. the features wich have been added to the kernel since the release of the old one.
Markus |
Quote:
as a newbie, still confused about where is the location of the current kernel's .config file. I am using fedora and even try to use find / -name ".config" command, i can't find the .config files of current linux. is it kept after installation ? |
I use to store a copy of .config in my /boot directory. Normaly you should find a config file there.
Otherwise the kernel sources are in /usr/src/linux-2.6.??.? and you'll find the .config file there. Be sure to use the ls command with the -a option in order to list also the files with a dot "." as their first character, dot-files are hidden normaly. As an example here the output of ls -a from my kernelsources: Code:
.. |
Quote:
a little dissapointed with my installation. there is no .config in /usr/src/lin*** . even there is no linux** directory.there is only a directory named redhat. but still no file there. maybe my fedora is too old and i did not install the src when i installed the kernel. also there is no .config in my /boot. i have not backup anything there. |
When you compiled new kernel it took out entry for old kernel?
When I compiled new kernel I had option of booting into old as well. |
Well, with some of the distributions you'll have to install the kernelsources if you need them. I'm using Slackware and Gentoo and have the sources installed by default.
If you really want to learn Linux, I'd recommend to install Slackware, it is a great distribution for learning-purposes. Very stable, and they have a very helpful and knowledgeable community here in the forum: http://www.linuxquestions.org/questions/slackware-14/ Slackware is very easy to install. But be aware that you'll need the commandline in order to configure the system. Slackware comes with a "vanilla"-kernel, this means they don't patch the kernel, it is installed as it is. Note that the Slackware-forum here in LQ is the official Slackware-forum. Markus |
Quote:
i will try other distribution like slackware instead. |
Quote:
you are right. if i use the current system's .config file. i can compile the new kernel version. and the current config file is located in /boot/ but not with the name of .config but as config-2.6.15-1.2504-FC5 in my case. thanks. |
Yes, since you can have more than one kernel in the /boot directory, it makes sense to give the .config files in this directory a name which refers to it's kernel.
Markus |
All times are GMT -5. The time now is 10:23 AM. |