LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 06-22-2009, 03:54 AM   #1
gauravholey
Member
 
Registered: May 2009
Posts: 35

Rep: Reputation: 15
Accidentally deleted config file....how to restore it?


hi there,

I have accidentally deleted the config file under the boot directory...i am using kernel 2.6.25 ...please help me to restored it....i have tried using make oldconfig && make prepare...but it did not work....but still i am able to boot through the same kernel using grub(i have 2-3 kernel images installed on my machine)....i can access the internet...but the area of concern is that i am not able to compile the kernel modules...?...Please help...every help would be greatly appreciated...


Best Regards,
Gaurav Holey

Last edited by gauravholey; 06-22-2009 at 04:11 AM.
 
Old 06-22-2009, 04:22 AM   #2
jomen
Senior Member
 
Registered: May 2004
Location: Leipzig/Germany
Distribution: Arch
Posts: 1,687

Rep: Reputation: 55
...if the current kernel was compiled that way you can use:
Code:
zcat /proc/config.gz > /usr/src/linux/.config.current
to have the config of the currently running kernel copied to: /usr/src/linux/.config.current
Rename/copy that to .config or .config.old and start over using that.

You can always start from scratch too.
make mrproper
or
make distclean
or just
make clean
and then
make menuconfig
...

HTH
 
Old 06-22-2009, 04:31 AM   #3
jsteel
Member
 
Registered: Mar 2007
Location: England
Distribution: Arch
Posts: 392

Rep: Reputation: 34
What distribution are you using? You should be able to reinstall your kernel which should then put the configuration file back in your /boot/ directory.
 
Old 06-22-2009, 05:44 AM   #4
gauravholey
Member
 
Registered: May 2009
Posts: 35

Original Poster
Rep: Reputation: 15
hi there,

after doing zcat /proc/config.gz > /usr/src/linux/.config.current I got the following

gzip: /proc/config.gz: No such file or directory.

i am using fedora core7.

i have compiled and installed kernel manually...not using yum or rpm..just in case for info.

i have tried building it from scratch i.e make clean,make menuconfig...i got the following error

make: *** No rule to make target `menuconfig'. Stop.


Gaurav Holey

Last edited by gauravholey; 06-22-2009 at 05:51 AM.
 
Old 06-22-2009, 07:53 AM   #5
jomen
Senior Member
 
Registered: May 2004
Location: Leipzig/Germany
Distribution: Arch
Posts: 1,687

Rep: Reputation: 55
Quote:
after doing zcat /proc/config.gz > /usr/src/linux/.config.current I got the following

gzip: /proc/config.gz: No such file or directory
that just means this feature (having the current config available from there) was not used when your kernel was compiled.

What jsteel suggested should be an option...

I have no idea what the cause of this could be - sorry.
Code:
make: *** No rule to make target `menuconfig'. Stop.
edit:
...apart from you not being in the right directory when you issued this command
- which should be /usr/src/linux (possibly /usr/src/linux_version_)
end edit

Still there is "make config" and "make xconfig" and maybe even other graphical tools...I don't know Fedora well enough to be specific.

Last edited by jomen; 06-22-2009 at 07:58 AM.
 
  


Reply



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
accidentally deleted my ifcfg-eth2 file JRink Linux - Newbie 2 01-12-2007 02:50 PM
How to recover libc.so.6 file if it's deleted accidentally? tebet11@yahoo.com Linux - Distributions 4 12-25-2006 08:13 PM
Accidentally deleted System.map file... emalbum Linux - Kernel 1 09-03-2006 10:14 AM
How to restore a deleted file satimis Linux - Newbie 1 09-12-2003 04:18 AM
restore back deleted file edreddy Linux - General 4 07-19-2002 06:43 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 12:57 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
Open Source Consulting | Domain Registration