Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I accidentally deleted my .config for my kernel configuration on Linux, and seem to remember there was a way to retrieve the kernel configuration via the proc filesystem somehow.

Is this still possible, and if so how would I do it?

share|improve this question
    
you should accept new123456's answer –  mgalgs Oct 5 '12 at 19:02
    
@Sonny Ordell: There are now two valid answers. Can you accept one of them? –  Hennes Oct 2 '13 at 14:43
    
@Hennes User has not been online since Jun 27 '11 at 16:19. Don't think he's going to be accepting anything. –  DanteTheEgregore Oct 2 '13 at 14:49

2 Answers 2

  1. /proc/config.gz
  2. /boot/config
  3. /boot/config-$(uname -r)

Depending on your system, you'll find it in any one of those (possibly more) places.

share|improve this answer
    
On some distros (Fedora/Redhat) it's /boot/config-2.6.18-194.el5 or similar, with the kernel release string appended. –  Phil May 23 '11 at 15:50
1  
@Phil I run a distro (Zenwalk) where those filenames are symlinked by the latest kernel package to /boot/config. I'll go ahead and add these to the list - thanks for reminding me. –  new123456 May 23 '11 at 20:15

For an actual running kernel, one way to get the config file this is to

cat /proc/config.gz | gunzip > running.config

or,

zcat /proc/config.gz > running.config

Then running.config will contain the configuration of the running linux kernel.

However this is only possible if your running linux kernel was configured to have /proc/config.gz. The configuration for this is found in

  • General setup
    • [*] Kernel .config support
      • [*] Enable access to .config through /proc/config.gz

Most distributions do not have this configuration set. They provide kernel config files in their kernel packages and is usually found in /boot/ directory.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.