LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-12-2011, 01:17 AM   #1
aaaaatoz
LQ Newbie
 
Registered: Jan 2010
Posts: 10

Rep: Reputation: 0
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
 
Old 01-12-2011, 04:48 AM   #2
markush
Senior Member
 
Registered: Apr 2007
Location: Germany
Distribution: Slackware
Posts: 3,979

Rep: Reputation: 850Reputation: 850Reputation: 850Reputation: 850Reputation: 850Reputation: 850Reputation: 850
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
this command builds a new .config with all the configurations from the old kernel and asks you for features which differ between the old/new kernel.

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
 
Old 01-12-2011, 08:04 AM   #3
sevs
Member
 
Registered: Jul 2008
Location: Russia, Saratov
Distribution: debian, knoppix, mandriva, asplinux, altlinux
Posts: 110

Rep: Reputation: 20
Hey, how about intial ram disk? As i see you did it but have choosed a version of your new kernel when creating initrd?
 
Old 01-12-2011, 05:18 PM   #4
aaaaatoz
LQ Newbie
 
Registered: Jan 2010
Posts: 10

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by sevs View Post
Hey, how about intial ram disk? As i see you did it but have choosed a version of your new kernel when creating initrd?

I did it by initrd --force-lvm-probe newversion.img newversion
 
Old 01-12-2011, 05:23 PM   #5
aaaaatoz
LQ Newbie
 
Registered: Jan 2010
Posts: 10

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by markush View Post
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
this command builds a new .config with all the configurations from the old kernel and asks you for features which differ between the old/new kernel.

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

thanks, i will do it soon
 
Old 01-12-2011, 05:49 PM   #6
aaaaatoz
LQ Newbie
 
Registered: Jan 2010
Posts: 10

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by markush View Post
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
this command builds a new .config with all the configurations from the old kernel and asks you for features which differ between the old/new kernel.

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
just wondering where is the location of the 'old' .config. how does linux remember the oldconfig ? is it referred to the current config. eg.if i downloaded and configured several kernels, how linux know which is the so-called old one ?

thanks in advance!
 
Old 01-12-2011, 05:58 PM   #7
markush
Senior Member
 
Registered: Apr 2007
Location: Germany
Distribution: Slackware
Posts: 3,979

Rep: Reputation: 850Reputation: 850Reputation: 850Reputation: 850Reputation: 850Reputation: 850Reputation: 850
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
 
Old 01-12-2011, 06:05 PM   #8
aaaaatoz
LQ Newbie
 
Registered: Jan 2010
Posts: 10

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by markush View Post
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
thanks Markus.

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 ?
 
Old 01-12-2011, 06:17 PM   #9
markush
Senior Member
 
Registered: Apr 2007
Location: Germany
Distribution: Slackware
Posts: 3,979

Rep: Reputation: 850Reputation: 850Reputation: 850Reputation: 850Reputation: 850Reputation: 850Reputation: 850
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:
..
..tmp_kallsyms1.o.cmd
..tmp_kallsyms2.o.cmd
..tmp_kallsyms3.o.cmd
..tmp_vmlinux1.cmd
..tmp_vmlinux2.cmd
..tmp_vmlinux3.cmd
.config
.config.old
.gitignore
.mailmap
.missing-syscalls.d
.tmp_System.map
.tmp_kallsyms1.S
.tmp_kallsyms1.o
.tmp_kallsyms2.S
.tmp_kallsyms2.o
.tmp_kallsyms3.S
.tmp_kallsyms3.o
.tmp_versions
.tmp_vmlinux1
.tmp_vmlinux2
.tmp_vmlinux3
.version
.vmlinux.cmd
.vmlinux.o.cmd
COPYING
CREDITS
Documentation
Kbuild
MAINTAINERS
Makefile
Module.symvers
README
REPORTING-BUGS
System.map
arch
block
crypto
drivers
firmware
fs
include
init
ipc
kernel
lib
mm
modules.builtin
modules.order
net
samples
scripts
security
sound
tools
usr
virt
vmlinux
vmlinux.o
Markus
 
1 members found this post helpful.
Old 01-12-2011, 06:43 PM   #10
aaaaatoz
LQ Newbie
 
Registered: Jan 2010
Posts: 10

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by markush View Post
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:
..
..tmp_kallsyms1.o.cmd
..tmp_kallsyms2.o.cmd
..tmp_kallsyms3.o.cmd
..tmp_vmlinux1.cmd
..tmp_vmlinux2.cmd
..tmp_vmlinux3.cmd
.config
.config.old
.gitignore
.mailmap
.missing-syscalls.d
.tmp_System.map
.tmp_kallsyms1.S
.tmp_kallsyms1.o
.tmp_kallsyms2.S
.tmp_kallsyms2.o
.tmp_kallsyms3.S
.tmp_kallsyms3.o
.tmp_versions
.tmp_vmlinux1
.tmp_vmlinux2
.tmp_vmlinux3
.version
.vmlinux.cmd
.vmlinux.o.cmd
COPYING
CREDITS
Documentation
Kbuild
MAINTAINERS
Makefile
Module.symvers
README
REPORTING-BUGS
System.map
arch
block
crypto
drivers
firmware
fs
include
init
ipc
kernel
lib
mm
modules.builtin
modules.order
net
samples
scripts
security
sound
tools
usr
virt
vmlinux
vmlinux.o
Markus
hi Markus,

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.
 
Old 01-12-2011, 06:50 PM   #11
EDDY1
LQ Addict
 
Registered: Mar 2010
Location: Oakland,Ca
Distribution: wins7, Debian wheezy
Posts: 6,838

Rep: Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649
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.
 
Old 01-12-2011, 06:51 PM   #12
markush
Senior Member
 
Registered: Apr 2007
Location: Germany
Distribution: Slackware
Posts: 3,979

Rep: Reputation: 850Reputation: 850Reputation: 850Reputation: 850Reputation: 850Reputation: 850Reputation: 850
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
 
Old 01-12-2011, 07:17 PM   #13
aaaaatoz
LQ Newbie
 
Registered: Jan 2010
Posts: 10

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by markush View Post
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
thank. I had thought Redhat(CenOS,fedora) is the largest but i really found it is ugly sometimes.
i will try other distribution like slackware instead.
 
Old 01-13-2011, 06:23 PM   #14
aaaaatoz
LQ Newbie
 
Registered: Jan 2010
Posts: 10

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by markush View Post
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:
..
..tmp_kallsyms1.o.cmd
..tmp_kallsyms2.o.cmd
..tmp_kallsyms3.o.cmd
..tmp_vmlinux1.cmd
..tmp_vmlinux2.cmd
..tmp_vmlinux3.cmd
.config
.config.old
.gitignore
.mailmap
.missing-syscalls.d
.tmp_System.map
.tmp_kallsyms1.S
.tmp_kallsyms1.o
.tmp_kallsyms2.S
.tmp_kallsyms2.o
.tmp_kallsyms3.S
.tmp_kallsyms3.o
.tmp_versions
.tmp_vmlinux1
.tmp_vmlinux2
.tmp_vmlinux3
.version
.vmlinux.cmd
.vmlinux.o.cmd
COPYING
CREDITS
Documentation
Kbuild
MAINTAINERS
Makefile
Module.symvers
README
REPORTING-BUGS
System.map
arch
block
crypto
drivers
firmware
fs
include
init
ipc
kernel
lib
mm
modules.builtin
modules.order
net
samples
scripts
security
sound
tools
usr
virt
vmlinux
vmlinux.o
Markus
Markus,
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.
 
Old 01-13-2011, 06:37 PM   #15
markush
Senior Member
 
Registered: Apr 2007
Location: Germany
Distribution: Slackware
Posts: 3,979

Rep: Reputation: 850Reputation: 850Reputation: 850Reputation: 850Reputation: 850Reputation: 850Reputation: 850
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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Boot Problems After Kernel Compile ieydis Mandriva 2 09-04-2005 04:17 PM
kernel compile - boot screen kam_kenneth Linux - Newbie 2 05-08-2004 05:32 PM
after compile still boot into the old kernel?? why?? ckamheng Slackware 7 12-30-2003 05:02 AM
kernel compile and boot loader Abe_the_Man Linux - Newbie 2 10-06-2003 09:13 PM
Kernel Compile Boot Loader? boot disk? SPMcRuube Linux - Newbie 3 12-03-2002 08:02 PM


All times are GMT -5. The time now is 07:27 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration