# [SOLVED] Kernel Panic - Unable to mount root fs (again...)

## alnvidal

* [SOLVED] - Just needed to enable SMP.

Hi, I have been trying to install Gentoo on a SATA HD, but I stops at the classic Kernel Panic:

It takes near 30 seconds in this step:

```

ata1: dev 0 ATA-7, max UDMA 7, 156301488 sector: LBA48

```

(I'm not sure about the spacing)

And then...:

```

VFS: Cannot open root device "sda3" or unknown-block(0,0)

Please append a correct "root=" boot option

Kernel panic - not syncing: VFS: Unable to mount root fs on unknown block(0,0)

```

My chipset is VIA, and the SATA controller (VT8237), too. It supports RAID, but I don't use it.

However, I compiled as built-in this and some other chipsets, but it didn't work, always giving the same error message.

I'm NOT using the /boot in a separated partition, and trying with kernel 2.6.19-r9 (gentoo-sources).

I tried to builtin SATA deprecated support, compile ALL the drivers in the low-level drivers section, enabled RAID... but the same problem. 

Using genkernel, it works, but I don't want to use it permanently.

What's wrong?

Here are the parts of the config related to SCSI, SATA and ReiserFS (I'm using it):

```

# CONFIG_BLK_DEV_IDESCSI is not set

...

# CONFIG_BLK_DEV_IDE_SATA is not set

# CONFIG_BLK_DEV_HD_IDE is not set

...

#

# SCSI device support

#

# CONFIG_RAID_ATTRS is not set

CONFIG_SCSI=y

CONFIG_SCSI_PROC_FS=y

#

# SCSI support type (disk, tape, CD-ROM)

#

CONFIG_BLK_DEV_SD=y

# CONFIG_CHR_DEV_ST is not set

# CONFIG_CHR_DEV_OSST is not set

# CONFIG_BLK_DEV_SR is not set

CONFIG_CHR_DEV_SG=y

# CONFIG_CHR_DEV_SCH is not set

#

# Some SCSI devices (e.g. CD jukebox) support multiple LUNs

#

# CONFIG_SCSI_MULTI_LUN is not set

# CONFIG_SCSI_CONSTANTS is not set

# CONFIG_SCSI_LOGGING is not set

#

# SCSI Transport Attributes

#

# CONFIG_SCSI_SPI_ATTRS is not set

# CONFIG_SCSI_FC_ATTRS is not set

# CONFIG_SCSI_ISCSI_ATTRS is not set

# CONFIG_SCSI_SAS_ATTRS is not set

#

# SCSI low-level drivers

#

# CONFIG_ISCSI_TCP is not set

# CONFIG_BLK_DEV_3W_XXXX_RAID is not set

# CONFIG_SCSI_3W_9XXX is not set

# CONFIG_SCSI_7000FASST is not set

# CONFIG_SCSI_ACARD is not set

# CONFIG_SCSI_AHA152X is not set

# CONFIG_SCSI_AHA1542 is not set

# CONFIG_SCSI_AHA1740 is not set

# CONFIG_SCSI_AACRAID is not set

# CONFIG_SCSI_AIC7XXX is not set

# CONFIG_SCSI_AIC7XXX_OLD is not set

# CONFIG_SCSI_AIC79XX is not set

CONFIG_SCSI_DPT_I2O=m

# CONFIG_SCSI_IN2000 is not set

# CONFIG_MEGARAID_NEWGEN is not set

# CONFIG_MEGARAID_LEGACY is not set

# CONFIG_MEGARAID_SAS is not set

CONFIG_SCSI_SATA=y

CONFIG_SCSI_SATA_AHCI=y

# CONFIG_SCSI_SATA_SVW is not set

CONFIG_SCSI_ATA_PIIX=y

# CONFIG_SCSI_SATA_MV is not set

# CONFIG_SCSI_SATA_NV is not set

# CONFIG_SCSI_PDC_ADMA is not set

# CONFIG_SCSI_SATA_QSTOR is not set

# CONFIG_SCSI_SATA_PROMISE is not set

CONFIG_SCSI_SATA_SX4=y

CONFIG_SCSI_SATA_SIL=y

CONFIG_SCSI_SATA_SIL24=y

CONFIG_SCSI_SATA_SIS=y

CONFIG_SCSI_SATA_ULI=y

CONFIG_SCSI_SATA_VIA=y

# CONFIG_SCSI_SATA_VITESSE is not set

CONFIG_SCSI_SATA_INTEL_COMBINED=y

# CONFIG_SCSI_BUSLOGIC is not set

# CONFIG_SCSI_DMX3191D is not set

# CONFIG_SCSI_DTC3280 is not set

# CONFIG_SCSI_EATA is not set

# CONFIG_SCSI_FUTURE_DOMAIN is not set

# CONFIG_SCSI_GDTH is not set

# CONFIG_SCSI_GENERIC_NCR5380 is not set

# CONFIG_SCSI_GENERIC_NCR5380_MMIO is not set

# CONFIG_SCSI_IPS is not set

# CONFIG_SCSI_INITIO is not set

# CONFIG_SCSI_INIA100 is not set

# CONFIG_SCSI_PPA is not set

# CONFIG_SCSI_IMM is not set

# CONFIG_SCSI_NCR53C406A is not set

# CONFIG_SCSI_SYM53C8XX_2 is not set

CONFIG_SCSI_IPR=m

# CONFIG_SCSI_IPR_TRACE is not set

# CONFIG_SCSI_IPR_DUMP is not set

# CONFIG_SCSI_PAS16 is not set

# CONFIG_SCSI_PSI240I is not set

# CONFIG_SCSI_QLOGIC_FAS is not set

# CONFIG_SCSI_QLOGIC_FC is not set

# CONFIG_SCSI_QLOGIC_1280 is not set

# CONFIG_SCSI_QLA_FC is not set

# CONFIG_SCSI_LPFC is not set

# CONFIG_SCSI_SIM710 is not set

# CONFIG_SCSI_SYM53C416 is not set

# CONFIG_SCSI_DC395x is not set

# CONFIG_SCSI_DC390T is not set

# CONFIG_SCSI_T128 is not set

# CONFIG_SCSI_U14_34F is not set

# CONFIG_SCSI_ULTRASTOR is not set

# CONFIG_SCSI_NSP32 is not set

# CONFIG_SCSI_DEBUG is not set

#

# File systems

#

CONFIG_REISERFS_FS=y

CONFIG_REISERFS_CHECK=y

CONFIG_REISERFS_PROC_INFO=y

CONFIG_REISERFS_FS_XATTR=y

CONFIG_REISERFS_FS_POSIX_ACL=y

CONFIG_REISERFS_FS_SECURITY=y

```

/boot/grub/grub.conf

```

default 0

timeout 30

title Gentoo

root (hd0,2)

kernel /boot/gentoo root=/dev/sda3

```

And the useful part of /etc/fstab

```

/dev/sda3         /         reiserfs      noatime, notail      0 1

/dev/sda4         none      swap      sw               0 0

/dev/cdroms/cdrom0   /mnt/cdrom   iso9660      noauto,ro         0 0

proc               /proc      proc         defaults            0 0

shm               /dev/shm      tmpfs      nodev,nosuid,noexec   0 0

```

Just to confirm that the problem isn't me, to change the old and wrong kernel with the recent compiled one:

```

mount /dev/sda3 /mnt/gentoo

mount -t proc none /mnt/gentoo/proc

mount -o bind /dev /mnt/gentoo/dev

chroot /mnt/gentoo /bin/bash

env-update

source /etc/profile

cd /usr/src/linux

make menuconfig

..... save and exit

make && make modules_install

rm -rf /boot/gentoo-with-problem

cp arch/i386/boot/bzImage /boot/new-gentoo

(in this case, change the grub.conf)

exit

umount /mnt/gentoo/proc /mnt/gentoo/dev /mnt/gentoo

reboot

```

All right?

Thanks in advance.Last edited by alnvidal on Sat Jun 24, 2006 1:33 pm; edited 1 time in total

----------

## nixnut

Moved from Installing Gentoo to Kernel & Hardware.

Kernel problem, so moved here

----------

## noup

Allan, isn't it possible to instruct GenKernel to generate a .config file based on the hardware detection (i've never used GenKernel, so i can't tell)?

----------

## jmbsvicetto

Hi and welcome to the forums.

 *alnvidal wrote:*   

> Hi, I have been trying to install Gentoo on a SATA HD, but I stops at the classic Kernel Panic:
> 
> ```
> 
> VFS: Cannot open root device "sda3" or unknown-block(0,0)
> ...

 

Your problem is likely related to having enabled the SATA deprecated support. Boot with the live-cd, mount your partitions, chroot, change your kernel config with make menuconfig, rebuild the kernel make && make modules_install, copy the kernel to your /boot dir/partition and reboot.

Does it work now?

----------

## alnvidal

noup   :Razz: , I think it is possible, but I'd like to have a kernel configured by myself. 

I used partimage to save an image of the Gentoo instalation right before the Kernel part, to save time.

Then I tried /proc/config.gz as the configuration file, it works, but just at the first compilation. After this, I tried the menuconfig again, disabled some options not related to the  SCSI support, but the same error. Then I tried to simply copy /proc/config.gz again, recompiling, but the error was there again  :Confused: 

But with this config the little freeze ("ata1: dev 0 ATA-7, max UDMA 7, 156301488 sector: LBA48") disappeared.

jmbsvicetto, I'm not using the deprecated SATA support right now, I just tried it once (with no success).

Anyway, I'll keep on trying...

----------

## noup

 *alnvidal wrote:*   

> noup  , I think it is possible, but I'd like to have a kernel configured by myself.

 

The idea is precisely to start with a working config and incrementally remove features, or just to compare that config with yours to see what's missing. But from what genkernel seems to make, i think the difference might not be in the kernel config but instead somewhere else.   :Confused: 

 *Quote:*   

> 
> 
> I used partimage to save an image of the Gentoo instalation right before the Kernel part, to save time.
> 
> Then I tried /proc/config.gz as the configuration file, it works, but just at the first compilation. After this, I tried the menuconfig again, disabled some options not related to the  SCSI support, but the same error. Then I tried to simply copy /proc/config.gz again, recompiling, but the error was there again 
> ...

 

What is that config.gz file related to? That does look odd.

----------

## jmbsvicetto

If you're not using the deprecated support, please post the output of the following:

```
lspci

grep -i sata /usr/src/linux/.config | grep -v ^#
```

----------

## alnvidal

noup, this is exactly what I'm doing now, I tried to remove only the options that I REALLY wouldn't use from the config, like ISDN, NFS... And changed the processor type from 486 to K7. Not even with just these simple changes it worked...

Now I'm trying again, without changing the "processor type" (sorry, I don't remember how it is written in menuconfig), but with all that alterations related to ISDN, for instance.

jmbsvicetto, I will do this soon, and then I post the answer.

----------

## alnvidal

A little question:

I downloaded and installed a stage3-i686. Is there any problem if I use the kernel as K7, or I should reinstall the stage using a x86 file in order to do this?

----------

## baomike

That was my thought , boot the live-cd and check out fstab and some other things.

but I was told that  to mount /dev/sda3 I had to be root.  WHAT is the root password?

I have made the assumption the the live-cd can be used to edit the system, is that correct?

----------

## noup

 *alnvidal wrote:*   

> A little question:
> 
> I downloaded and installed a stage3-i686. Is there any problem if I use the kernel as K7, or I should reinstall the stage using a x86 file in order to do this?

 

I think you're alright. Still, taken from the Handbook:

 *Quote:*   

> 
> 
> In most cases, the command uname -m can be used to help you decide which stage file to download.
> 
> 

 

----------

## noup

 *baomike wrote:*   

> That was my thought , boot the live-cd and check out fstab and some other things.
> 
> but I was told that  to mount /dev/sda3 I had to be root.  WHAT is the root password?
> 
> I have made the assumption the the live-cd can be used to edit the system, is that correct?

 

You mean, booting your live cd and chrooting into your gentoo installation (to edit fstab and other things), right? You don't need the root password to chroot. (As a note, that's precisely what you do when you forget your root password, you chroot into your installation and change it.)

----------

## baomike

Still have the same problem. You can't chroot to /dev/sda3, it has to be mounted first.

To mount it you have to be root.

Which leads me back to same problem, of a unkown (unknowable?) password for the root on the live-cd.

----------

## alnvidal

After 3 days trying, about 40 kernel compilations, and it finally worked!!

I had to enable SMP. I don't know why, since I have only a simple Athlon XP 2200+... But now it's working.

I would never figure this out, since the first option I used to disable was... SMP. 

Thanks for the help   :Wink: 

baomike, you don't need the root password to became root, in the livecd, all terminals are "logged" as root. Just mount the partition (mount /dev/sda3 /mnt/gentoo, and also proc and dev, as the handbook says), forgetting for a while all that multi-user scheme. (Please, correct me if I said something wrong)

----------

## noup

 *alnvidal wrote:*   

> After 3 days trying, about 40 kernel compilations, and it finally worked!!
> 
> I had to enable SMP. I don't know why, since I have only a simple Athlon XP 2200+... But now it's working.
> 
> I would never figure this out, since the first option I used to disable was... SMP. 
> ...

 

Man, i'm glad it worked for you, but that makes no sense to me.   :Razz:  Perhaps enabling SMP gets to enable other things that actually make that work... or perhaps not.  :Smile: 

----------

## alnvidal

Yep, it's weird... maybe a kernel bug?

I just hope I don't have problems in the future. Now, let's emerge the funny part   :Very Happy: 

----------

## noup

 *alnvidal wrote:*   

> Yep, it's weird... maybe a kernel bug?
> 
> I just hope I don't have problems in the future. Now, let's emerge the funny part  

 

Allan, try doind a diff between the new kernel config (with SMP) and the faulty one, see if the difference is only on the SMP part.

----------

## alnvidal

No doubt. I've tried twice, using the /proc/config.gz, with and without SMP. Later, I tried my own config, with and without SMP again. Both, without SMP, don't boot.

----------

## baomike

I used the live-cd to compile a new kernel. And now that I have the correct scsi driver in 

the kernel it can find /dev/sda3 and mount it as root.

Problems encountered:

must be root to mount drives 

used "sudo" ie sudo mount /dev/hda3 /mnt/gentoo

Had to mount proc. using sudo as above allows this.

I also forgot to mount /dev/sda1  on /mnt/gentoo/boot

which meant /boot  ( after chroot) was empty. 

never could figure out how to get out (reboot gracefully) from 

where I was after chroot. I used the command "sync" a couple of times

waited a few second and killed power. no ill effects.

I now have a functional gentoo system .

Tnx for help provided both to me and others.

----------

## cnagel

Well, I'm resurrecting this thread because I've spent a day and a half attempting to get a kernel and a grub.conf that work together.

What gets me is why the LiveCD works so easily, lets me use all the filesystems to compile, etc., but the newly compiled kernel cannot.  Maybe I should just copy the kernel from the CD?...

I'm a little newish to this, but I don't plan to give up!  :Smile:   I have tried all the suggestions in this thread, but none have worked.  What is the strangest to me is that the panic happens after PAGES of output.  Since grub tanks if it cannot find the kernel file, I'm assuming /dev/sda1 is already mounted.  It's /dev/sda3 that is un-sync-able...

Not sure what I can post to more clearly explicate the issue, or what (more) I should disable to "start clean".   Any suggestions?

Thanks,

Chris

----------

## cnagel

Well, I was able to get past the kernel panic by compiling in the IDE/SATA support (yeah, the DEPRECATED one).  Now my fs mounts fine.

Just that udev won't mount now....

Chris

----------

## jeancf

I've been looking for a solution for this for hours. I found it here: http://kerneltrap.org/node/1955

 *Quote:*   

> I had this same problem running on two different machines. I am not sure what causes it but the fix I used was to specify the major and minor numbers of the device that holds the root filesystem.
> 
> Eg. If "/" is on /dev/hda2 then type "ls -l /dev/hda2" and you will see the major and minor number of the disk, for example on my system I get:
> 
> brw-rw---- 1 root disk 3, 2 Sep 15 14:40 /dev/hda2
> ...

 

----------

## zanzer7

A year later, and I get this same problem after a fresh install. I've tried all the solutions posted in this thread, and I've also tried whatever I came across with google searches.

After loading grub correctly, and about 30 seconds into the (otherwise successful boot), I get this:

```
VFS: Cannot open root device "sda7" or unknown-block(0,0)

Please append a correct "root=" boot option

Kernel panic - not syncing: VFS: Unable to mount root fs on unknown block(0,0)

```

Note that the (apparently working) boot partition uses ReiserFS just like the (not working) root partition.

I have tried various combinations of in-compiling just the deprecated SATA support, as well as just the sata_nv (I have an nVidia Forceware motherboard) support, both, neither - I still get the same error.

Could this be related to my boot and root being on an extended partition? I installed grub on /boot/, so does this mean it isn't in the actual MBR? The grub menu works fine, so does the booting all the way until the error above.

My partition scheme looks like this:

```
/dev/sda1   Windows XP (ntfs)

/dev/sda2   Storage (ntfs)

/dev/sda3   Extended partition (holds sda5, sda6 and sda7)

/dev/sda5   Boot partition (reiserfs)

/dev/sda6   Swap

/dev/sda7   Root partition (reiserfs)
```

I don't know what files would be helpful to paste here, so please name them if any.

----------

## zanzer7

I managed to solve my problem.

It turns out I had forgotten to enable SCSI disk support.

The relevant kernel config is:

```
< > ATA/ATAPI/MFM/RLL support

SCSI device support -->

  <*> SCSI disk support

<*> Serial ATA (prod) and Parallel ATA (experimental) drivers -->

  <*> NVIDIA SATA support
```

Obviously, you will have to enable something else than NVIDIA SATA support, if you don't have an nVidia motherboard.

----------

## cry4dawn_2000

 *zanzer7 wrote:*   

> I managed to solve my problem.
> 
> It turns out I had forgotten to enable SCSI disk support.
> 
> The relevant kernel config is:
> ...

 

I had the same problem with an emachines ET1331G-07w and this is what fixed it thanx    :Very Happy: 

----------

