# [SOLVED]New Install - Unable To Mount Root FS

## Jon Wilder

Hi all. I haven't messed with Gentoo in a few years but decided to throw it on one of my machines again.

I just did the installation last night following the Gentoo Installation Guide. I'm using the Grub 2 boot loader. On boot, I get a kernel panic as shown below -

```

[    5.275100] ---[ end Kernel panel - not syncing: VFS: Unable to mount root fs on unknown-block(8,4)

```

I have triple checked the compiled in kernel drivers for my drive controllers. Originally I had two SATA drives in conjunction with the IDE drive I'm installing Gentoo on, but have since removed every drive but the Gentoo drive for troubleshooting purposes.

My motherboard is an Asus M2N32-SLI Deluxe with nVidia chipset. Here is the lspci output showing all of my hard drive controllers -

```

00:0c.0 IDE Interface: NVIDIA Corporation MCP55 IDE (rev A1)

00:0d.0 IDE Interface: NVIDIA Corporation SATA Controller (rev a2)

00:0d.1 IDE Interface: NVIDIA Corporation SATA Controller (rev a2)

00:0d.2 IDE Interface: NVIDIA Corporation SATA Controller (rev a2)

03:00.0 Mass storage controller: Silicon Image, Inc. Sil 3132 Serial ATA Raid II Controller (rev 01)

```

My kernel version is 3.18.12-gentoo. Here are my kernel settings for the drives and file systems -

```

Device Drivers --->

    < >ATA/ATAPI/MFM/RLL support (DEPRECIATED) ----

    <*>Serial ATA and Parallel ATA drivers (libata) --->

        <*>AHCI SATA Support

        <*>Silicon Image 3124/3132 SATA Support

        <*>ATA SFF Support (for legacy IDE and PATA)

         [*]ATA BDMA Support

        <*>NVIDIA SATA Support

        <*>Silicon Image SATA Support

        <*>AMD/NVidia PATA Support

```

Here are my file system kernel settings -

```

File Systems --->

    <*>Second extended fs support

    <*>The Extended 4 (ext4) filesystem

         [*]Use ext4 for ext2/ext3 file systems

         [*]Ext4 POSIX Access Control Lists

         [*]Ext4 Security Labels

    <*>Reiserfs support

    <*>JFS filesystem support

```

My drive as the installation kernel sees it is /dev/sda1 and is partitioned as follows -

```

/dev/sda1          2M      EFI (FAT-12/16/32)

/dev/sda2      128M      Linux (formatted ext2)

/dev/sda3          4G     Linux Swap

/dev/sda4     53.1G      Linux (formatted ext4)

```

Any ideas?Last edited by Jon Wilder on Wed Jun 17, 2015 2:19 am; edited 1 time in total

----------

## NeddySeagoon

Jon Wilder,

Welcome to Gentoo.

```
unknown-block(8,4) 
```

 (8,4) is the kernel major and minor device IDs for /dev/sda4.

That you hawe 8,4 and not 0,0 tells that the kernel can find your root partition but not read what it finds there.

As well as the unknown-block(8,4) message the kernel should have listed all the block devices it can see, along the lines of ...

```
Unable to find root block device in

<list of devices - one per line>

.
```

When the device list is empty, it reads 

```
Unable to find root block device in .
```

which is misleading if you don't know that there is supposed te be a device list there.

What did it say for you?

Did you use a GPT or MSDOS partition table?

What partition table drivers are on in your kernel.

Everything in your post looks correct.

----------

## Jon Wilder

 *NeddySeagoon wrote:*   

> 
> 
> When the device list is empty, it reads 
> 
> ```
> ...

 

Here is a link to a photo of the screen output on boot -

https://dl.dropboxusercontent.com/u/16771514/20150612_000529.jpg

 *NeddySeagoon wrote:*   

> 
> 
> Did you use a GPT or MSDOS partition table?

 

I used MSDOS partition table. Wasn't sure if I should use GPT/UEFI since my computer is a BIOS-based machine. Although, my motherboard features a boot menu that I can call during POST by pressing F8, which would allow me to still be able to have a dual OS machine without having to chainload Windows via Grub. So I could try GPT if this would be better than MBR.

 *NeddySeagoon wrote:*   

> 
> 
> What partition table drivers are on in your kernel.

 

I have PC BIOS partition table drivers compiled in as shown in the photo links below -

https://dl.dropboxusercontent.com/u/16771514/20150612_001132.jpg

https://dl.dropboxusercontent.com/u/16771514/20150611_235709.jpg

----------

## NeddySeagoon

Jon Wilder,

That all looks good, it just doesn't work and it should.

Get back into your chroot and 

```
emerge wgetpaste
```

. 

Use wgetpaste to put the following things on the web and post the URLs you get back.

The output of 

```
lspci -k
```

The content of 

```
/usr/src/linux/.config
```

The output of 

```
ls -l /boot
```

The content of 

```
/boot/grub/grub.cfg
```

There is no advantage to GPT over MSDOS partition tables until your HDD is bigger that 2TiB. Then an MSDOS portition table connot describe it all.

To make BIOS and GPT boot, together you may need some extra steps.

Tell how you built your kernel and initrd, if you have an initrd.

----------

## Jon Wilder

Here are the outputs you requested -

LSPCI - http://pastebin.ca/3027633

Kernel Config - http://pastebin.ca/3027634

Boot Directory - http://pastebin.ca/3027635

Grub.cfg File - http://pastebin.ca/3027636

I do not have initrd and I manually configured my kernel via menuconfig and make && make modules_install.

----------

## NeddySeagoon

Jon Wilder,

Looking through your kernel first, the must haves to boot with no initrd are your partition code

```
CONFIG_MSDOS_PARTITION=y

# CONFIG_EFI_PARTITION is not set
```

You need CONFIG_EFI_PARTITION on if you use a GPT partition table.

Yor high level disk drive setup

```
# CONFIG_IDE is not set

CONFIG_SCSI=y

CONFIG_BLK_DEV_SD=y

CONFIG_ATA=y
```

is good.

Looking at the chipset drivers lspci

```
00:0c.0 IDE interface: NVIDIA Corporation MCP55 IDE (rev a1)

        Subsystem: ASUSTeK Computer Inc. Device cb84

        Kernel driver in use: pata_amd

00:0d.0 IDE interface: NVIDIA Corporation MCP55 SATA Controller (rev a2)

        Subsystem: ASUSTeK Computer Inc. Device cb84

        Kernel driver in use: sata_nv

03:00.0 Mass storage controller: Silicon Image, Inc. SiI 3132 Serial ATA Raid II Controller (rev 01)

        Subsystem: ASUSTeK Computer Inc. Device 819f

        Kernel driver in use: sata_sil24
```

tlanslates to

```
CONFIG_PATA_AMD=y

CONFIG_SATA_NV=y

CONFIG_SATA_SIL24=y
```

The other options you have on are harmless.

You have a good selection of filesystems built it too but I didn't ask about that. so I can't check that your root filesystem in built it.

Looking at grub.cfg

```
### BEGIN /etc/grub.d/10_linux ###

menuentry 'Gentoo GNU/Linux' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-011d101b-742d-4373-8711-2a9d285ff50a' {

        load_video

        if [ "x$grub_platform" = xefi ]; then

                set gfxpayload=keep

        fi

        insmod gzio

        insmod part_gpt

        insmod ext2

        set root='hd0,gpt3'

        if [ x$feature_platform_search_hint = xy ]; then

          search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt3 --hint-efi=hd0,gpt3 --hint-baremetal=ahci0,gpt3  5eef134e-e261-4dfe-b82c-c5e47cb6c6a6

        else

          search --no-floppy --fs-uuid --set=root 5eef134e-e261-4dfe-b82c-c5e47cb6c6a6

        fi

        echo    'Loading Linux 3.18.12-gentoo ...'

        linux   /vmlinuz-3.18.12-gentoo root=/dev/sda5 ro  
```

```
insmod part_gpt
```

is informative.  Grub thinks you are using a GPT partition table and with 

```
set root='hd0,gpt3'
```

too.

We knom that grub loads your kernel or it couldn't panic. This suggets that you are actually using a GPT partiton table, which grub can read but with 

```
# CONFIG_EFI_PARTITION is not set
```

the kernel cannot.

Try rebuilding your kernel with that option on.

----------

## Jon Wilder

Thank you for all your suggestions. I am actually using GPT (I was using MBR but ended up switching to GPT as something to try in the course of troubleshooting). I'm using ext4 on the root partition while using ext2 on the boot partition. I have both ext2 and ext4 enabled in the kernel as well.

I'll be trying it with the EFI boot enabled in the kernel here shortly.

----------

## Jon Wilder

So I decided to start from scratch. Same story...kernel panic, unable to mount root fs on unknown-block(8,4). Here is my latest kernel config. I intentionally did not compile a compact kernel in hopes of just getting a working kernel, but I remembered to compile in CONFIG_EFI_PARTITION this time.

http://pastebin.ca/3028460

----------

## krinn

What do you mean by "I decided to start from scratch", you redo the kernel from start or you have redo all the install?

I know for many users, doing it again from scratch looks a good strategy, but in real this is just the worst thing to do.

1/ doing something bad one time and the next time you redo it, you will certainly redo it the same way: bad. Why? Because if you know it is bad, you won't redo it, but the problem is that you just don't know what is good and what is bad, so anything you have done, you have done it thinking it was "good".

2/ now you are asking help from someone here, that's good, but the problem is that this person is looking and pointing you to something you have done "good" that is in real bad ; but minds are done this way, experience count more than words ; something you have done bad yourself will still be remember more than something someone has tell you, and the bad part you have done before would be more remembered as "good" for you because you have done it, even someone has already told you it wasn't "good".

3/ anyone trying to help you is lost now by your "from scrach". We just couldn't assume anymore what you have said is valid, and what everyone has told you is still valid. Your redo from scratch mean in real "redo also all the help from scratch", and really that's not a joy for anyone that wish help you, all that has been read/analyze and correct must be review again:

Instead of looking at other possible problem excluding ones NeddySeagoon has already look for, everyone must now re-ask you the same questions as NeddySeagoon...

I'm sorry, your redo from scratch has drain my faith, helping you doing something and you might just drop any help anyone is giving you down to 0 without any warning redoing again from scratch, like if redoing from scratch would magically gave you the solve to your problem.

So here's what i could said from a fast look at your paste: # CONFIG_FHANDLE is not set is already a "bad" thing. (in order to help your memory accepting FHANDLE should be set: without FHANDLE udev/eudev/systemd won't works, and it's safe to assume you are using one of them, so this must be set).

But really, if it's possible, step back to your previous state, so anyone wishing to help you know he need to goes futher what NeddySeaggon has done and not restarting from 0.

----------

## not a day goes by

just a very uneducated comment, since I've only installed gentoo twice, so take this as a guess, but I encountered the same problem when I, unintentionally, tried a gpt install on my bios laptop. back then, carefully following the installation guide to set things up for MBR made things work for me.

----------

## NeddySeagoon

not a day goes by,

GPT on BIOS works.  Its covered in the install guide on the wiki.

Jon Wilder,

As krinn says.  If you statred from scratch so must we.  Post the same things as I asked for last time from your current Gentoo.

As its not a binary distro, all you get with a restart on Gentoo is an oportunity to make different mistakes.

You learn much more from diagnosing and fixing procblems.

Anyway, we are where we are ... we need to work out hom to get to where we need to be.

----------

## Jon Wilder

Understood. I will post those up later tonight when I'm off work.

I will state that prior to compiling in drivers I ran lspci -k and noted which exact drivers the installation CD's kernel loaded, then ensured that I compiled those exact drivers in the kernel. I also made sure to compile in CONFIG_EFI_PARTITION this time. Also, when the kernel panics, it is still seeing the root partition as (8,4) just like before.

I'm not sure if fstab has anything to do with booting but I'm using the partition ID's rather than the /dev ID. I did this in case the system kernel was assigning a different /dev/sdx than the installation kernel.

----------

## Jon Wilder

I tried compiling in FHANDLE. No difference. 

Here are the current outputs of lspci, .config, /boot, and grub.cfg -

lspci -k http://pastebin.ca/3029232

/.config - http://pastebin.ca/3029233

/boot - http://pastebin.ca/3029234

grub.cfg - http://pastebin.ca/3029235

----------

## NeddySeagoon

Jon Wilder,

```

        insmod gzio

        insmod part_gpt

        insmod ext2
```

Still on GPT.  Don't you hate the grub.cfg black magic. Its turned your  *Quote:*   

> --fs-uuid --set=root 9a6e43b1-de56-403a-9600-29c136bbd513

 into 

```
root=/dev/sda4
```

Incidentally, that's the filesystem UUID, not the PARTUUID.

```

Kernel driver in use: pata_amd

Kernel driver in use: sata_nv

Kernel driver in use: sata_sil24
```

Thase drivers are required but not sufficient. You still neeh the rest of the SCSI stack.

```
CONFIG_MSDOS_PARTITION=y

CONFIG_EFI_PARTITION=y
```

That suits most things.

```
# CONFIG_IDE is not set

CONFIG_BLK_DEV_SD=y

CONFIG_BLK_DEV_SR=y

CONFIG_BLK_DEV_SR_VENDOR=y

CONFIG_CHR_DEV_SG=y

CONFIG_ATA=y
```

Thats the high level code for your HDD and Optical drives.

```
CONFIG_SATA_SIL24=y

CONFIG_SATA_NV=y

CONFIG_PATA_AMD=y
```

Thats what lspci -k said you needed.

```
CONFIG_EXT4_FS=y

CONFIG_EXT4_USE_FOR_EXT23=y

CONFIG_EXT4_FS_POSIX_ACL=y

CONFIG_EXT4_FS_SECURITY=y
```

Hmm, Im not sure about CONFIG_EXT4_FS_SECURITY=y.  I don't use it.

Its not a boot issue but next time you are configuring your kernel turn off

```
CONFIG_NTFS_FS=m

# CONFIG_NTFS_DEBUG is not set

CONFIG_NTFS_RW=y
```

 Use FUSE and ntfs-3g.  You really won't like kernel ntfs support.

So far so good.  /etc/fstab is not involved in booting until after the root filesystem is mounted any your install does not get that far, so even if its wrong, it not related to this issue.

```

drwx------ 2 root root   12288 Jun 14 14:50 lost+found
```

tells that you have a real boot partition. That ties in nicely with 

```
linux   /vmlinuz-3.18.12-gentoo
```

```
CONFIG_TMPFS=y

CONFIG_DEVTMPFS=y

CONFIG_DEVTMPFS_MOUNT=y
```

provides your /dev filesystem.

So it all looks OK, it just doesn't work.

Try the following ...

Boot to the grub menu.  press the 'e' key.  Grub will let you edit the commands its about to execute before you allow the boot to continue.

We know that 

```
set root='hd0,gpt2'
```

is correct. Thats where the kernel is loaded from. If it wasn't loaded, it couldn't panic.

That leaves the

```
 linux   /vmlinuz-3.18.12-gentoo root=/dev/sda4 ro
```

, specifically, the sda part.as a target.

You have tried sda, try sdb, sdc and so on, for all the installed hard drives you have installed.  Attached USB storage devices count too.

----------

## Jon Wilder

OK...we got a booting kernel!

I tried exactly what you suggested. I got to root=/dev/sdd4 and still kernel panic. I thought "But I only have 4 drives connected including the Gentoo Installation USB stick!

Just for kicks, I went for root=/dev/sde4 and WALA! Booting kernel!

When I ran blkid once I got into the system, for some reason it skipped sdb altogether and sees my drives as follows -

/dev/sda1 - USB Installation Stick

/dev/sdc1 - Windows 7 OS Drive

/dev/sdd - NTFS Data Storage Drive

/dev/sde1-4 - Gentoo Drive

Not sure why it skipped sdb altogether and I've had this issue before where the installation kernel sees the drives differently from the system kernel. I wish I knew how to get it to stop doing that but alas...she's up and running.

Once I got into the system, I edited root= in grub.cfg to root=/dev/sde4, then did a reboot and it fired right up with no issues.

Thanks again for all your help. One quick question...you stated above that I needed the SCSI stack in my kernel. Can you guide me on which exact kernel settings to compile in for that?

----------

## Jon Wilder

In playing with my new system, I've got it booting flawlessly and have learned a few things. I was successful at getting the proprietary drivers for my nVidia GeForce 610 installed along with getting them working with the console frame buffer, but had to go back into the kernel and enable UVESA framebuffer support as well as initramfs support and set a path to the initramfs source file (/usr/share/v86d/initramfs).

In /etc/default/grub, I've set up the Grub framebuffer and also had to GRUB_DISABLE_LINUX_UUID=true as generating a new grub.cfg wrote the root partition's UUID to grub.cfg and they system did not like that one bit.

In any event, thank you all for all of your help.

----------

## NeddySeagoon

Jon Wilder,

The vesa framebuffer used to work with the nVidia binary blob and it does not need an initrd. 

Be careful with UUID.  

```
# blkid

/dev/sdb1: UUID="d678d02e-28ab-84e0-c44c-77eb7ee19756" TYPE="linux_raid_member" PARTLABEL="primary" PARTUUID="7c45fc11-9a4b-4580-b008-4b9718e86d87"
```

notice that there are two different UUIDs listed in that sample.

UUID="d678d02e-28ab-84e0-c44c-77eb7ee19756"  is the UUID of the filesystem on /dev/sdb1.  To pass the filesystem UUID as a kernel parameter as in 

```
root=UUID=d678d02e-28ab-84e0-c44c-77eb7ee19756
```

requires the use of an initrd containing the userspace mount utility, as the kernel knows nothing of filesystem UUIDs.  However, the kernel is happy with 

```
root=PARTUUID=7c45fc11-9a4b-4580-b008-4b9718e86d87
```

as it understands PARTUUID itself.  These are not the same block objects. The PARTUUID is a property of a partition. The UUID is a property of a filesysem that is stored on some other block device, in this case, a partition.

I don't know how you correctly tell grub2 to use a PARTUUID.  You can edit grub.cfg to test.

The SCSI stack is the same given to the complete SCSI driver selections you need in your kernel.  Its called a stack as it is put together like layers of a cake, to make maintainance and extensions easy.  From the bottom up.

At the very bottom in your disk controller hardware. This is listed by lspci.

```
00:0c.0 IDE interface: NVIDIA Corporation MCP55 IDE (rev a1)

00:0d.0 IDE interface: NVIDIA Corporation MCP55 SATA Controller (rev a2)

03:00.0 Mass storage controller: Silicon Image, Inc. SiI 3132 Serial ATA Raid II Controller (rev 01)
```

The next layer are the drivers for these chipsets.

```
CONFIG_PATA_AMD=y

CONFIG_SATA_NV=y

CONFIG_SATA_SIL24=y
```

These present a common interface to the next layer up so that coping with a new chipset only requires a new chipset driver that uses all the code further up the stack.

In some cases the menu items add in some common code, in other cases, turning off a kernel menu item just turns off all the sub items too.

The top layer is 

```
# CONFIG_IDE is not set

CONFIG_SCSI=y

CONFIG_BLK_DEV_SD=y

CONFIG_ATA=y
```

IDE support must be off as there is an old depreciated driver for your PATA interface here and the old and new drivers will fight if they are both on.

```
CONFIG_SCSI=y

CONFIG_BLK_DEV_SD=y
```

together provide support for SCSI Discs.  You don't have any real SCSI discs but  CONFIG_ATA=y makes PATA and SATA devices appear to be SCSI.

A bit of history. When Compaq produced a 286 PC with a hard dre which had Integrated Drive Electronics (IDE), they took a 16 bit ISA slot and cut it down.  The 16 data bits were retained. Only one Address bit out of 24 was kept and it was renamed to drive select. Only one IRQ was retained and it all fitted into a 40 pin connector. So PATA=IDE=cut down ISA.  So much for the electrical interface.

The IDE data transfer protocol was adapted from SCSI by dropping all the hard bits from SCSI, so SCSI and IDE have always been related. e.g. commands to different devices on the same SCSI bus can be overlapped, but not on IDE where a command on the bus must complete before a new command can be issued.

Over the years the SCSI data transfer protocol has been implemented over several different electrical interfaces. IDE, SATA, USB and Firewire to name a few.

Around kernel 2.26 IDE was merged back into SCSI and the IDE drivers were depreciated.

You will find the concept of stacks all over software design.  There are others in the kernel and like the competing IDE/SATA drivers for your disks, you must only choose one.  WiFi comes to mind.

----------

## Jon Wilder

Thanks for all the info! That's some rather interesting history. I'm actually an embedded programmer of sorts, specializing in PICmicro and Intel MCS-51. So a lot of the stuff like software stacks, address/data bus, multiplexed address/data, etc etc...I understand. Just not yet quite familiar with the low level side of the Linux kernel as of yet. But I'm learning.

I've installed Xorg Server so far, but trying to figure out how to configure displays as it's giving me a "no screens found" error. But I'll start another thread for that if I can't figure it out.

The beautiful thing about my system is that it's dual boot, but I didn't have to chainload Windows through Grub. My motherboard has a firmware boot loader that I can call during POST by pressing F8. It will boot to Windows by default if I don't press F8, but to boot to Linux I just press F8 and select the Linux drive. Kind of a neat feature that makes things simpler as I don't have to bother doing it through Grub.

----------

