# SOLVED "Unable to mount root"

## DaftDog

Running kernel 2.6.4 on the PC I'm writing this from with no problems... HD is attached to a Promise Controller and now sits happily on /dev/hd3. After getting this to work I tried the same kernel (and millions of other releases) on my newer PC with SATA (SII3112A)... absolutely no luck there... whatever I tried (different kernel configurations, different kernel "root"-options in grub) I ALWAYS get:

```

VFS: Cannot open root device hdx (you name it, it doesn't work)

Please append a correct "root=" option

Kernel panic: VFS: unable to mount root fs on hdx

```

The kernel can not find the root partition whatever drive I try... YES the driver is in the kernel statically (actually ALL HD-Drivers are in there) and YES the necessary filesystems are also there.

Live-CD 2004.0 Minimal has absolutely no problems finding and using the harddrive, neither does Knoppix with kernel 2.6... why on earth won't it work with my own kernel????

I'm no expert in this at all, but is this error related to the boot loader maybe (Grub)? Wouldn't make sense to me since the "root=" parameter is a "kernel-option" that is just passed through the boot-loader and apparently arrives at the kernel properly!?

Anyhow... someone please help... been working on this for weeks now and the next thing I'll do is skip to another distro, which would really be a shame since I wanted to use Gentoo business-wide.

Thanks in advance!

p.s. Some more info on the PC and its config:

Installation

- Started with Live-CD 2004.0 Minimal and a freshly downloaded Stage1

- Did NOT use genkernel

Hardware (lspci)

```

...

IDE interface: nVidia Corporation nForce2 IDE (rev a2)

...

RAID bus controller: CMD Technology Inc Silicon Image SiI 3112 SATARaid Controller (rev 02)

...

```

Partitions

```

/dev/hdc1 NTFS Win2k (I know, I know... but at least this one works!)

/dev/hdc2  ext3          /boot

/dev/hdc3  swap

/dev/hdc4  Extended

/dev/hdc5  fat32         shared

/dev/hdc6  reiserfs     /

```

All drives, HD and CD, are detected by the kernel during bootup AND show up as hdc (HD) and hda (CD).

grub.conf

```

timeout 5

default 0

# Linux 2.6.4

title Linux 2.6.4

root (hd0,1)

kernel (hd0,1)/kernel-2.6.4 root=/dev/hdc6

# Win2k

title Windows 2000

root(hd0,0)

chainloader +1

```

Kernel configs that might be relevant

```

- Device Drivers

  - ATA/ATAPI/MFM/RLL support

    - <*> Include IDE/ATA-2 DISK support

      - <*> User multi-mode by default

    - <*> Include IDE/ATAPI CDROM support

    - [*] PCI IDE chipset support

      - [*] Sharing PCI IDE interrupts support

        - [*] Generic PCI IDE Chipset support

        - [*] Generic PCI bus-master DMA support

          - [*] Use PCI DMA by default when available

          - <*> Every driver compiled into kernel just to be sure

- File systems

  - <*> Second extended fs support

    - <*> Ext3 jourlnalled file system support

    - <*> Reiserfs support

    - <*> Kernel automounter version 4 support

    - Pseudo filesystems --->

      - [*] /proc file system support

      - [*] /dev file system support

      - [*] Virtual memory file system support

    - Partition types --->

      - [*] Advanced partition selection

        - [*] PC BIOS (MSDOS partition tables) support

        - [*] Windows Logical Disk Manager (Dynamic Disk) support

```

Last edited by DaftDog on Wed Apr 07, 2004 10:09 pm; edited 3 times in total

----------

## ikaro

sata uses scsi drivers so ive read somewhere in the forums.

 :Rolling Eyes: 

----------

## DaftDog

Using SCSI-Drivers enhances speed but it's not mandatory... and it's not available for the SII-controller yet.

Tried compiling in some SCSI-support anyways but had no luck.  :Sad: 

----------

## aultl

I had this same problem after installing 2004.0 you need to change your grub.conf file.

this line:

  # Linux 2.6.4

  title Linux 2.6.4 

  root (hd0,1)

->  kernel (hd0,1)/kernel-2.6.4 root=/dev/hdc6

needs to be this:

kernel (hd0,1)/kernel-2.6.4 root=/dev/ram0 init=linuxrc real_root=/dev/hdc6 

initrd(hd0,1)/initrd-2.6.4

here is what my grub.conf looks like:

```

  default 1

  timeout 30  

  splashimage=(hd0,8)/boot/grub/splash.xpm.gz

  

  #linux

  title=Linux-2.6.3

  root(hd0,8)

  kernel(hd0,8)/boot/kernel-2.6.3-gentoo-r1 root=/dev/ram0 init=linuxrc real_root=/dev/hda9 vga=791

  initrd(hd0,8)/boot/initrd-2.6.3-gentoo-r1

  

  #WinXP

  title=WinXP

  root(hd0,0)

  chainloader +1

```

You will have to boot off of the install cd to edit your grub.conf file.

OOPS, I am not sure if this will help, I just re-read your post and realized you have an SATA drive, mine is a standard IDE but I was getting the same error until I changed my grub.conf.

YMMV. 

aultl

----------

## DaftDog

Hey aulti,

the settings you use are just necessary when having used genkernel. I compiled the kernel manually, so it doesn't need initrd and the ramdisk settings.

Thanks anyway... more ideas welcome!

----------

## aultl

 *DaftDog wrote:*   

> Hey aulti,
> 
> the settings you use are just necessary when having used genkernel. I compiled the kernel manually, so it doesn't need initrd and the ramdisk settings.
> 
> Thanks anyway... more ideas welcome!

 

I can't rememeber if I did or not  :Smile: . I had to install two or three times. The first time I could not get my 3com nic working the second time I could not get genkernel to build a kernel, it kept crashing during the "building modules" section. But both times this was the only kernel string that worked in grub. ?!? I think I may have installed once more and gentoo kept complaining that devfsd was required and it was not installed. However, after ~5 years of playing I have no reason to keep my window's partition, excecpt for printing.  

[OT]

That reminds me of a Monty Python skit, "the third castle burned down, fell over then sank into the swap, but the fourth castle is still standing."

----------

## morologous

Somewhere I heard that SATA drives are accessed like SCSI drives at /dev/sdax

Can anyone substantiate that?

----------

## srs5694

Concerning the SATA and SCSI-mode access, it depends. If you're using libata drivers, which are activated in the SCSI section of the kernel configuration, you'll use SCSI device identifiers (/dev/sda, etc.). Some SATA controllers, though, have drivers in the normal ATA section of the kernel configuration, and they'll be accessed as ATA drives (/dev/hda, etc., although usually /dev/hde or above). Some controllers have both old-style ATA and libata (pseudo-SCSI) drivers available, and so can be accessed either way, depending on which driver gloms onto the hardware first. As I understand it (from reading this site and the kernel configuration files), both options are available for the OP's Silicon Image 3112 controller, but the sata option is still considered highly experimental and won't even appear in the kernel configuration menus unless you select the kernel option to prompt for experimental drivers. It sounds as if the OP is using the older (P)ATA driver, but it's conceivable that s/he's activated the libata driver and it's controlling the drive, in which case it'll appear as /dev/sda (or possibly /dev/sdb or something higher, if there are other SCSI or pseudo-SCSI devices on the system).

Another point: In my experience, /dev/hdx assignments can change between OSs or kernels. I say this because of some experience with a beta distribution I'm not supposed to talk about, so I won't say much -- just that it seems to have reversed the order of drive letters for my SATA and PATA devices, compared to what I see under Gentoo. I don't know why this has happened, but it's possible that the OP is seeing the same problem. If so, fixing it would require changing the /etc/fstab entries and the root= option passed to the kernel in GRUB, and doing it blind. (Changing the "(hd#,#)" values in GRUB should not be necessary, though, as it's clear that GRUB is at least locating and loading the kernel.)

Yet another point: I haven't checked it very carefully, but IIRC, the recently-released 2.6.5 kernel's change log says something about the SiI 3112 libata driver going non-beta. If the OP isn't using libata now, it might be worth trying it with a 2.6.5 kernel (even if it means temporarily using a less stable libata driver with an earlier kernel). If the OP does this s/he should build the libata driver into the kernel and either not build the PATA driver or build it as a module, in order to ensure that the PATA driver doesn't latch onto the SATA controller before the libata driver can do so.

----------

## DaftDog

This is almost embarrassing... but the real problem was an "Unknown partition table"... I had enabled the "Windows Logical Disk Manager" because this is a dual-boot system and I had partitioned part of the HD during the Win2k installation... what I would have needed to enable was the "PC BIOS (MSDOS partition tables) support".

I hadn't seen the "Unknown partition table" error because it passed by too quickly to read and after the kernel panic the system didn't respond to anything (and I don't know how to break/slow down the kernel boot). When the method suggested by srs5694 didn't work (tried to compile the scsi-libata drivers instead of the pata drivers I had used all the time) and couldn't see if the kernel found any drives at all, I took my digicam and took photos of the boot process, reading what it said there... it did find the discs, but on one of the photo the "Unknown partition table"-error showed up, and I had a fix for that one in about 5 minutes.

Now the system will boot a bit further but gets stuck when trying to remount root in read/write mode... I'll switch back to the pata drivers for now and see if they get any further.

Anyhow, huge thanks for the suggestions and the help! Love this forum, one never feels alone   :Very Happy: 

----------

## BlinkEye

 *DaftDog wrote:*   

> This is almost embarrassing... but the real problem was an "Unknown partition table"... I had enabled the "Windows Logical Disk Manager" because this is a dual-boot system and I had partitioned part of the HD during the Win2k installation... what I would have needed to enable was the "PC BIOS (MSDOS partition tables) support".
> 
> I hadn't seen the "Unknown partition table" error because it passed by too quickly to read and after the kernel panic the system didn't respond to anything (and I don't know how to break/slow down the kernel boot). 

 

well, it could be that this is the answer to two system which didn't boot with my kernel. don't know why this happened, but it could be because i enabled at all an option in the kernel for windows partition tables (alltough i partitioned my hd's only from linux) - hope this is the error, because i can't figure it out otherwise. i hate genkernel  :Exclamation: 

----------

## Little Nemo

 *DaftDog wrote:*   

> This is almost embarrassing... but the real problem was an "Unknown partition table"... I had enabled the "Windows Logical Disk Manager" because this is a dual-boot system and I had partitioned part of the HD during the Win2k installation... what I would have needed to enable was the "PC BIOS (MSDOS partition tables) support".

 

Nice one. Had it too, yesterday. I sometimes mount Macintosh formatted ZIP disks, so I included "Advanced partition table selection" and "Macintosh partition support", but forget to include the default MSDOS stuff. This should not even be de-selectable on PC systems IMHO. Anyway, in my case the result was a kernel panic, and it took me half a day to find the origin of this stupid problem. I was as embarrassed as you say you are.   :Embarassed: 

----------

## BlinkEye

so, i'm embarassed too   :Embarassed: . i had to de-select every option in this particular section of the kernel. i lost more than half a day and was wondering for several days why it didn't work. some minutes ago i saw MY kernel booting. again, thanks for pointing me (unwillingly) into the right direction.

----------

## DaftDog

Hehe feels good not to be the only one forgetting something like that   :Very Happy: 

Happy Easter!

----------

## BlinkEye

same to you

----------

