LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 03-02-2010, 08:22 AM   #1
sumix
LQ Newbie
 
Registered: Mar 2010
Location: Czech Republic
Distribution: Ubuntu 9.10, Debian 5.0.4
Posts: 6

Rep: Reputation: 0
Question Getting "kernel panic" after recompiling kernel


Hello,

I'm in an urgent need to recompile kernel (since I have to get pNFS to work), so I downloaded and patched a 2.6.33-rc6 vanilla kernel, configured and compiled. When I booted it, i got a kernel panic saying kernel was unable to access hda1 partition. Well, I told myself I had probably forgotten to compile PATA (piix) controller driver or ext3 driver in the kernel, which proved to be true. So I reconfigured it and recompiled, however I've been facing the same message:

Quote:
...
scsi 0:0:0:0 Direct-Access ATA MAXTOR ...
scsi 1:0:0:0 CD-ROM SAMSUNG ...
VFS: Cannot open root device "hda1" or unknown-block(0,0)
Please append a correct "root=" boot option: here are the available partitions:
Kernel panic - not syncing: VFS: unable to mount root fs on unknown-block(0,0)
I've googled a lot to solve this problem, haven't found any solution that works for me though. GRUB can see the hda1 (hd0,0) device, but kernel can't . In menu.lst, I've the same configuration for the new kernel (with only changed kernel image name and commented initrd line) as the one for the default distribution kernel (I'm using Debian 5.0.4).

Above the kernel panic message I can see it seems like both PATA drives (CD-ROM and HDD) act like scsi devices, which might be the problem? But I don't know why (probably due to the kernel .config configuration - but which options exactly?) and I don't know whether it is really the reason of my problem. Maybe I could fix it with an init ramdisk, but I think it's not necessary here, so I would prefer to fix it without it... My .config can be found at http://charon.styxx.cz/tmp/.config.

Many thanks in advance!
 
Old 03-02-2010, 08:33 AM   #2
JimBrewster
Member
 
Registered: Feb 2010
Location: usa:/dev/random
Distribution: Slackware, Salix
Posts: 237

Rep: Reputation: 59
I've been reading a bit about block device naming changes in the new kernels. You might try changing the "root=/dev/hda1" to "root=/dev/sda1" in your kernel line of menu.lst.
 
Old 03-02-2010, 08:45 AM   #3
sumix
LQ Newbie
 
Registered: Mar 2010
Location: Czech Republic
Distribution: Ubuntu 9.10, Debian 5.0.4
Posts: 6

Original Poster
Rep: Reputation: 0
Thanks for the advice... unfortunately that doesn't work for me . I think there's something wrong with my kernel configuration, but I can't figure out what exactly it is (I suspect something related to the PATA controller)
 
Old 03-02-2010, 09:05 AM   #4
JimBrewster
Member
 
Registered: Feb 2010
Location: usa:/dev/random
Distribution: Slackware, Salix
Posts: 237

Rep: Reputation: 59
Did you compare the old config with the new?

Something else in this section should be selected, it seems to me:
Code:
# CONFIG_PATA_ACPI is not set
# CONFIG_PATA_ALI is not set
# CONFIG_PATA_AMD is not set
# CONFIG_PATA_ARTOP is not set
# CONFIG_PATA_ATP867X is not set
# CONFIG_PATA_ATIIXP is not set
# CONFIG_PATA_CMD640_PCI is not set
# CONFIG_PATA_CMD64X is not set
# CONFIG_PATA_CS5520 is not set
# CONFIG_PATA_CS5530 is not set
# CONFIG_PATA_CS5535 is not set
# CONFIG_PATA_CS5536 is not set
# CONFIG_PATA_CYPRESS is not set
# CONFIG_PATA_EFAR is not set
CONFIG_ATA_GENERIC=y
# CONFIG_PATA_HPT366 is not set
# CONFIG_PATA_HPT37X is not set
# CONFIG_PATA_HPT3X2N is not set
# CONFIG_PATA_HPT3X3 is not set
# CONFIG_PATA_ISAPNP is not set
# CONFIG_PATA_IT821X is not set
# CONFIG_PATA_IT8213 is not set
# CONFIG_PATA_JMICRON is not set
# CONFIG_PATA_LEGACY is not set
# CONFIG_PATA_TRIFLEX is not set
# CONFIG_PATA_MARVELL is not set
# CONFIG_PATA_MPIIX is not set
# CONFIG_PATA_OLDPIIX is not set
# CONFIG_PATA_NETCELL is not set
# CONFIG_PATA_NINJA32 is not set
# CONFIG_PATA_NS87410 is not set
# CONFIG_PATA_NS87415 is not set
# CONFIG_PATA_OPTI is not set
# CONFIG_PATA_OPTIDMA is not set
# CONFIG_PATA_PDC2027X is not set
# CONFIG_PATA_PDC_OLD is not set
# CONFIG_PATA_QDI is not set
# CONFIG_PATA_RADISYS is not set
# CONFIG_PATA_RDC is not set
# CONFIG_PATA_RZ1000 is not set
# CONFIG_PATA_SC1200 is not set
# CONFIG_PATA_SERVERWORKS is not set
# CONFIG_PATA_SIL680 is not set
# CONFIG_PATA_SIS is not set
# CONFIG_PATA_TOSHIBA is not set
# CONFIG_PATA_VIA is not set
# CONFIG_PATA_WINBOND is not set
# CONFIG_PATA_WINBOND_VLB is not set
# CONFIG_PATA_SCH is not set
 
Old 03-02-2010, 09:18 AM   #5
sumix
LQ Newbie
 
Registered: Mar 2010
Location: Czech Republic
Distribution: Ubuntu 9.10, Debian 5.0.4
Posts: 6

Original Poster
Rep: Reputation: 0
In the original configuration, the directives you mentioned are set to be "M" (drivers compiled as modules), which doesn't provide any useful information (since it's a general distribution kernel which has to provide support for different devices and uses an initial ramdisk).
 
Old 03-02-2010, 09:26 AM   #6
JimBrewster
Member
 
Registered: Feb 2010
Location: usa:/dev/random
Distribution: Slackware, Salix
Posts: 237

Rep: Reputation: 59
Quote:
Originally Posted by sumix View Post
In the original configuration, the directives you mentioned are set to be "M" (drivers compiled as modules), which doesn't provide any useful information (since it's a general distribution kernel which has to provide support for different devices and uses an initial ramdisk).
Ah, well, then you'll need to enable those needed for your controller either set to "Y" to be built in to the kernel or to "M" and then included in an initial ramdisk. Making an initrd is not hard, but the commands and procedures might vary by distribution.
 
Old 03-02-2010, 09:48 AM   #7
sumix
LQ Newbie
 
Registered: Mar 2010
Location: Czech Republic
Distribution: Ubuntu 9.10, Debian 5.0.4
Posts: 6

Original Poster
Rep: Reputation: 0
Yes, I know that the controller driver is missing (or rather some driver related to the controller or filesystem), but I hoped someone experienced in this area would tell me exactly what to fix . I didn't want to mess with making initrd (well, I know it wouldn't probably a big issue, however it's still some studying on top of my problem ). Nevertheless, right now, it seems that trying to compile all the drivers as modules and making initrd is the only possible solution. Now I've to figure out how to make the initrd (I know some time ago mkinitrd was used for this purpose but AFAIK it's deprecated now and use of mkinitramfs with different arguments and properties is recommended). Anyways, thanks for the advices.
 
Old 03-02-2010, 10:01 AM   #8
JimBrewster
Member
 
Registered: Feb 2010
Location: usa:/dev/random
Distribution: Slackware, Salix
Posts: 237

Rep: Reputation: 59
One thing that might make your kernel configuration quicker and make sure you don't miss any modules (though you'll get more than you need...):

After you patch your kernel source, copy /boot/config-<old kernel version> to /path/to/clean/patched/kernel/source/.config, then run make oldconfig. It will only prompt you for options that have changed from the old kernel to the new+patches.

Then you'll still have to make an initrd, but this could save you a little trouble in the config stage...
 
Old 03-04-2010, 06:21 AM   #9
sumix
LQ Newbie
 
Registered: Mar 2010
Location: Czech Republic
Distribution: Ubuntu 9.10, Debian 5.0.4
Posts: 6

Original Poster
Rep: Reputation: 0
Lightbulb

Well, I finally got it to work. Just posting one of the possible solutions in case someone encounters the same problem and finds this thread: I've accomplished it in a similar way as you described here, Jim.

I copied the original .config coming with the debian kernel to my kernel source directory (just to make sure something wouldn't be missing once again):
Code:
cp /boot/config-2.6.22-2-686 /usr/src/linux/.config
then cleaned all the stuff I had compiled before, made a slight modification in the configuration (added pNFS support), recompiled and installed the kernel+modules:
Code:
make clean && make menuconfig && make && make install && make modules_install
and finally made init ramdisk (my new kernel was 2.6.33-rc6 with pNFS patch, ie. 2.6.33-rc6-pnfs):
Code:
mkinitramfs -o /boot/initrd.img-2.6.33-rc6-pnfs 2.6.33-rc6-pnfs
and

added initramdisk file path to my GRUB config (menu.lst) so the first boot option looked like that:
Code:
title           Debian GNU/Linux, kernel 2.6.33-rc6-pnfs
root            (hd0,0)
kernel          /boot/vmlinuz-2.6.33-rc6-pnfs root=/dev/hda1 ro
initrd          /boot/initrd.img-2.6.33-rc6-pnfs
and successfully rebooted.

However, as I've been adviced (just only too late ), my problem was probably caused by missing kernel config options - there were two possible ways to go:

1. The way of "old" IDE drivers (probably not a problem, but I was scared by the word "deprecated"
Code:
<*> ATA/ATAPI/MFM/RLL support[*]     ATA disk support
<*>   generic/default IDE chipset support
<*>   Generic PCI IDE Chipset Support
<*>   Intel PIIX/ICH chipsets support
which should result in root device being /dev/hda

2. The way of new PATA/SCSI (not sure if it's a totally good definition):
Code:
-*- SCSI device support 
<*> SCSI disk support
<*> Serial ATA (prod) and Parallel ATA (experimental) drivers
    =>[*]   ATA SFF support
       <*>     Intel ESB, ICH, PIIX3, PIIX4 PATA/SATA support
which should result in root device being /dev/sda.

I haven't tried the two possible solutions mentioned above, but it looks like it should work without problems. Hope that will be helpful to someone facing similar problems in the future.

Last edited by sumix; 03-04-2010 at 10:01 AM.
 
  


Reply

Tags
panic, pata


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
"Invalid module format" after recompiling kernel without changing .config - why? kovlensky Linux - Kernel 5 09-10-2008 12:42 PM
Slackware 11 Upgrade to kernel 2.6 "Kernel Panic" Mithic Slackware 2 11-18-2006 09:18 PM
"Kernel panic: VFS: Unable to mount root fs" - Kernel fails to boot linux Freedom Seeker Linux - General 11 11-12-2006 07:48 PM
Error while "make modules" while recompiling the kernel on linux 2.4.21-40ELsmp gaurav_verma22 Red Hat 2 07-19-2006 06:32 AM
Common problems explained: "kernel panic - not syncing", "unable to mount..." sundialsvcs Linux - Newbie 2 03-01-2006 12:17 PM


All times are GMT -5. The time now is 10:03 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration