# Kernel panic - not syncing VFS: unable to mount root fs

## Ludovico

i got an error vfs unable to mount root fs on unknown block (0,0).

here's the picture :

https://i.imgur.com/7Nf7d3Th.jpg

my fstab :

```
#LABEL=boot      /boot      ext4      noauto,noatime   1 2

#UUID=58e72203-57d1-4497-81ad-97655bd56494      /      ext4   noatime      0 1

#LABEL=swap      none      swap      sw      0 0

#/dev/cdrom      /mnt/cdrom   auto      noauto,ro   0 0

UUID=CC95-F8AC      /boot      vfat      defaults,noatime 0 2

UUID=7aee0598-e0f6-438d-a1f4-cd0acafc0ca7   none   swap   sw   0 0

UUID=e256d95d-6fad-4ca7-a1d1-c7f51f788fa6   /   btrfs   defaults,noatime0 0

UUID=da62c465-051b-4a5f-ade9-9aece15ffb01   /home   btrfs   defaults,noatime0 0

```

my .config : 

https://dpaste.com/B94LEGXQU

i don't know what else to add in this post.

----------

## Ludovico

my lspci -k :

```
00:00.0 Host bridge: Advanced Micro Devices, Inc. [AMD] Raven/Raven2 Root Complex

   Subsystem: Acer Incorporated [ALI] Device 134d

lspci: Unable to load libkmod resources: error -2

00:00.2 IOMMU: Advanced Micro Devices, Inc. [AMD] Raven/Raven2 IOMMU

   Subsystem: Acer Incorporated [ALI] Device 134d

00:01.0 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 00h-1fh) PCIe Dummy Host Bridge

00:01.1 PCI bridge: Advanced Micro Devices, Inc. [AMD] Raven/Raven2 PCIe GPP Bridge [6:0]

   Kernel driver in use: pcieport

00:01.6 PCI bridge: Advanced Micro Devices, Inc. [AMD] Raven/Raven2 PCIe GPP Bridge [6:0]

   Kernel driver in use: pcieport

00:01.7 PCI bridge: Advanced Micro Devices, Inc. [AMD] Raven/Raven2 PCIe GPP Bridge [6:0]

   Kernel driver in use: pcieport

00:08.0 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 00h-1fh) PCIe Dummy Host Bridge

00:08.1 PCI bridge: Advanced Micro Devices, Inc. [AMD] Raven/Raven2 Internal PCIe GPP Bridge 0 to Bus A

   Kernel driver in use: pcieport

00:08.2 PCI bridge: Advanced Micro Devices, Inc. [AMD] Raven/Raven2 Internal PCIe GPP Bridge 0 to Bus B

   Kernel driver in use: pcieport

00:14.0 SMBus: Advanced Micro Devices, Inc. [AMD] FCH SMBus Controller (rev 61)

   Subsystem: Acer Incorporated [ALI] Device 134d

   Kernel driver in use: piix4_smbus

00:14.3 ISA bridge: Advanced Micro Devices, Inc. [AMD] FCH LPC Bridge (rev 51)

   Subsystem: Acer Incorporated [ALI] Device 134d

00:18.0 Host bridge: Advanced Micro Devices, Inc. [AMD] Raven/Raven2 Device 24: Function 0

00:18.1 Host bridge: Advanced Micro Devices, Inc. [AMD] Raven/Raven2 Device 24: Function 1

00:18.2 Host bridge: Advanced Micro Devices, Inc. [AMD] Raven/Raven2 Device 24: Function 2

00:18.3 Host bridge: Advanced Micro Devices, Inc. [AMD] Raven/Raven2 Device 24: Function 3

   Kernel driver in use: k10temp

00:18.4 Host bridge: Advanced Micro Devices, Inc. [AMD] Raven/Raven2 Device 24: Function 4

00:18.5 Host bridge: Advanced Micro Devices, Inc. [AMD] Raven/Raven2 Device 24: Function 5

00:18.6 Host bridge: Advanced Micro Devices, Inc. [AMD] Raven/Raven2 Device 24: Function 6

00:18.7 Host bridge: Advanced Micro Devices, Inc. [AMD] Raven/Raven2 Device 24: Function 7

02:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 15)

   Subsystem: Acer Incorporated [ALI] Device 134d

   Kernel driver in use: r8169

03:00.0 Network controller: Qualcomm Atheros QCA9377 802.11ac Wireless Network Adapter (rev 31)

   Subsystem: Lite-On Communications Inc Qualcomm Atheros QCA9377 802.11ac Wireless Network Adapter

   Kernel driver in use: ath10k_pci

04:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Picasso/Raven 2 [Radeon Vega Series / Radeon Vega Mobile Series] (rev c4)

   Subsystem: Acer Incorporated [ALI] Device 134d

   Kernel driver in use: amdgpu

04:00.1 Audio device: Advanced Micro Devices, Inc. [AMD/ATI] Raven/Raven2/Fenghuang HDMI/DP Audio Controller

   Subsystem: Acer Incorporated [ALI] Device 134d

   Kernel driver in use: snd_hda_intel

04:00.2 Encryption controller: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 10h-1fh) Platform Security Processor

   Subsystem: Acer Incorporated [ALI] Device 134d

   Kernel driver in use: ccp

04:00.3 USB controller: Advanced Micro Devices, Inc. [AMD] Raven2 USB 3.1

   Subsystem: Acer Incorporated [ALI] Device 134d

   Kernel driver in use: xhci_hcd

04:00.5 Multimedia controller: Advanced Micro Devices, Inc. [AMD] Raven/Raven2/FireFlight/Renoir Audio Processor

   Subsystem: Acer Incorporated [ALI] Device 134d

   Kernel driver in use: snd_pci_acp3x

04:00.6 Audio device: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 10h-1fh) HD Audio Controller

   Subsystem: Acer Incorporated [ALI] Device 134d

   Kernel driver in use: snd_hda_intel

05:00.0 SATA controller: Advanced Micro Devices, Inc. [AMD] FCH SATA Controller [AHCI mode] (rev 61)

   Subsystem: Acer Incorporated [ALI] Device 134d

   Kernel driver in use: ahci

```

----------

## grknight

 *Ludovico wrote:*   

> i got an error vfs unable to mount root fs on unknown block (0,0).

 

How is the storage device attached to the system? SATA? NVMe? other?

The "unknown block (0,0)" bit indicates there is no drive controller, drive, partition or volume found that matches the specified root device.

----------

## Ludovico

 *grknight wrote:*   

> How is the storage device attached to the system? SATA? NVMe? other?

 

It's using SATA.

 *grknight wrote:*   

> The "unknown block (0,0)" bit indicates there is no drive controller, drive, partition or volume found that matches the specified root device.

 

I don't know how to fix that.

----------

## pietinger

I see some possible reasons. First of all: Are you really sure you are using this configuration ?

You have some screen output from EVM, but your config says:

```
# CONFIG_EVM is not set
```

Second: You must have enabled this:

```
# CONFIG_MSDOS_PARTITION is not set
```

Third: IF you are using a boot manager, it is possible to overwrite your root partition settings in your kernel config WHEN you dont forbid it. Therefore I recommend to ENABLE this also:

```
CONFIG_CMDLINE="root=UUID=e256d95d-6fad-4ca7-a1d1-c7f51f788fa6"

# CONFIG_CMDLINE_OVERRIDE is not set
```

P.S.: AND dont use root=UUID; this does not work ! You need root=PARTUUID=.....Last edited by pietinger on Mon Mar 21, 2022 3:27 pm; edited 1 time in total

----------

## grknight

 *pietinger wrote:*   

> 
> 
> Third: IF you are using a boot manager, it is possible to overwrite your root partition settings in your kernel config WHEN you dont forbid it. Therefore I recommend to ENABLE this also:
> 
> ```
> ...

 

This is unlikely to work as expected at this time since UUID= requires an initramfs.  An initramfs is not currently present since it panics.

----------

## grknight

 *Ludovico wrote:*   

>  *grknight wrote:*   How is the storage device attached to the system? SATA? NVMe? other? 
> 
> It's using SATA.
> 
>  *grknight wrote:*   The "unknown block (0,0)" bit indicates there is no drive controller, drive, partition or volume found that matches the specified root device. 
> ...

 

What are you using as a loader?

Are you specifying the root= parameter yourself or using something like grub-mkconfig?

----------

## Ludovico

 *pietinger wrote:*   

> I see some possible reasons. First of all: Are you really sure you are using this configuration ?

 

Yes, this is my latest .config

 *pietinger wrote:*   

> "Second: You must have enabled this:
> 
> ```
> Code:   
> 
> ...

 

Ok, i will enable it.

And, i will change the root=UUID to root=PARTUUID

----------

## Ludovico

 *grknight wrote:*   

> What are you using as a loader?
> 
> Are you specifying the root= parameter yourself or using something like grub-mkconfig?

 

I'm using GRUB2 as a loader, and i added root= parameter by myself.

----------

## grknight

 *Ludovico wrote:*   

>  *grknight wrote:*   What are you using as a loader?
> 
> Are you specifying the root= parameter yourself or using something like grub-mkconfig? 
> 
> I'm using GRUB2 as a loader, and i added root= parameter by myself.

 

If you are using grub-mkconfig for configuring grub, then do not put root= into the config yourself.  It should figure this out and add it automatically if running from inside the chroot.

----------

## NeddySeagoon

Ludovico,

Are you actually loading the kernel you think you are?

Your .config looks like it should see your HDD but unknown-block(0,0) suggests its not.

Look at the timestamp on /usr/src/linux/arch/x86/bzImage, which should be your newest kernel.

Now look in /boot. There should be a kernel with a matching timestamp. If not, you are not using the kernel your think you are.

You must mount /boot for the kernel install and timestamp checking.

----------

## Ludovico

 *NeddySeagoon wrote:*   

> Ludovico,
> 
> Are you actually loading the kernel you think you are?
> 
> Your .config looks like it should see your HDD but unknown-block(0,0) suggests its not.
> ...

 

Ok, so this is what i did after doing make menuconfig. I run make -j4 && make modules_install && make install. And then i reboot to my gentoo.

----------

## NeddySeagoon

Ludovico,

A few details are missing.

When did you mount /boot ?

Is the kernel in /boot named in such a way that grub will see it?

Look in /boot/grub/grub.cfg.

Do you see the kernel named in /boot there?

Where is is in grubs boot order, new kernels are not always first?

What you describe is correct but incomplete.

----------

## Ludovico

 *NeddySeagoon wrote:*   

> Ludovico,
> 
> A few details are missing.
> 
> When did you mount /boot ?
> ...

 

Oh yeah, i forgot to say this. I mount /boot after i chroot to my gentoo,

----------

## NeddySeagoon

Ludovico,

OK, what about the other details?

----------

## Ludovico

 *NeddySeagoon wrote:*   

> Ludovico,
> 
> OK, what about the other details?

 

this is my ls -l /usr/src/linux/arch/x86_64/boot/ :

```
lrwxrwxrwx 1 root root 22 Mar 22 06:48 bzImage -> ../../x86/boot/bzImage

```

my ls -l /boot :

```
total 54402

-rwxr-xr-x 1 root root  6562115 Mar 22 06:48 System.map-5.16.16-gentoo

-rwxr-xr-x 1 root root  4978914 Mar 21 20:23 System.map-5.16.16-gentoo-x86_64

-rwxr-xr-x 1 root root  6561822 Mar 22 05:43 System.map-5.16.16-gentoo.old

-rwxr-xr-x 1 root root   135314 Mar 22 06:48 config-5.16.16-gentoo

-rwxr-xr-x 1 root root   135222 Mar 22 05:43 config-5.16.16-gentoo.old

drwxr-xr-x 4 root root      512 Mar 21 07:42 efi

drwxr-xr-x 6 root root      512 Mar 22 03:45 grub

-rwxr-xr-x 1 root root 13823104 Mar 22 06:48 vmlinuz-5.16.16-gentoo

-rwxr-xr-x 1 root root  9685664 Mar 21 20:23 vmlinuz-5.16.16-gentoo-x86_64

-rwxr-xr-x 1 root root 13821792 Mar 22 05:43 vmlinuz-5.16.16-gentoo.old

```

this is my /boot/grub/grub.cfg :

```
#

# DO NOT EDIT THIS FILE

#

# It is automatically generated by grub-mkconfig using templates

# from /etc/grub.d and settings from /etc/default/grub

#

### BEGIN /etc/grub.d/00_header ###

if [ -s $prefix/grubenv ]; then

  load_env

fi

if [ "${next_entry}" ] ; then

   set default="${next_entry}"

   set next_entry=

   save_env next_entry

   set boot_once=true

else

   set default="0"

fi

if [ x"${feature_menuentry_id}" = xy ]; then

  menuentry_id_option="--id"

else

  menuentry_id_option=""

fi

export menuentry_id_option

if [ "${prev_saved_entry}" ]; then

  set saved_entry="${prev_saved_entry}"

  save_env saved_entry

  set prev_saved_entry=

  save_env prev_saved_entry

  set boot_once=true

fi

function savedefault {

  if [ -z "${boot_once}" ]; then

    saved_entry="${chosen}"

    save_env saved_entry

  fi

}

function load_video {

  if [ x$feature_all_video_module = xy ]; then

    insmod all_video

  else

    insmod efi_gop

    insmod efi_uga

    insmod ieee1275_fb

    insmod vbe

    insmod vga

    insmod video_bochs

    insmod video_cirrus

  fi

}

if [ x$feature_default_font_path = xy ] ; then

   font=unicode

else

insmod part_gpt

insmod btrfs

set root='hd0,gpt7'

if [ x$feature_platform_search_hint = xy ]; then

  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt7 --hint-efi=hd0,gpt7 --hint-baremetal=ahci0,gpt7  e256d95d-6fad-4ca7-a1d1-c7f51f788fa6

else

  search --no-floppy --fs-uuid --set=root e256d95d-6fad-4ca7-a1d1-c7f51f788fa6

fi

    font="/usr/share/grub/unicode.pf2"

fi

if loadfont $font ; then

  set gfxmode=auto

  load_video

  insmod gfxterm

  set locale_dir=$prefix/locale

  set lang=POSIX

  insmod gettext

fi

terminal_output gfxterm

if [ x$feature_timeout_style = xy ] ; then

  set timeout_style=menu

  set timeout=5

# Fallback normal timeout code in case the timeout_style feature is

# unavailable.

else

  set timeout=5

fi

### END /etc/grub.d/00_header ###

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

menuentry 'Gentoo GNU/Linux' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-e256d95d-6fad-4ca7-a1d1-c7f51f788fa6' {

   load_video

   set gfxpayload=keep

   insmod gzio

   insmod part_gpt

   insmod fat

   set root='hd0,gpt5'

   if [ x$feature_platform_search_hint = xy ]; then

     search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt5 --hint-efi=hd0,gpt5 --hint-baremetal=ahci0,gpt5  CC95-F8AC

   else

     search --no-floppy --fs-uuid --set=root CC95-F8AC

   fi

   echo   'Loading Linux 5.16.16-gentoo-x86_64 ...'

   linux   /vmlinuz-5.16.16-gentoo-x86_64 root=/dev/sda7 ro  

}

submenu 'Advanced options for Gentoo GNU/Linux' $menuentry_id_option 'gnulinux-advanced-e256d95d-6fad-4ca7-a1d1-c7f51f788fa6' {

   menuentry 'Gentoo GNU/Linux, with Linux 5.16.16-gentoo-x86_64' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-5.16.16-gentoo-x86_64-advanced-e256d95d-6fad-4ca7-a1d1-c7f51f788fa6' {

      load_video

      set gfxpayload=keep

      insmod gzio

      insmod part_gpt

      insmod fat

      set root='hd0,gpt5'

      if [ x$feature_platform_search_hint = xy ]; then

        search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt5 --hint-efi=hd0,gpt5 --hint-baremetal=ahci0,gpt5  CC95-F8AC

      else

        search --no-floppy --fs-uuid --set=root CC95-F8AC

      fi

      echo   'Loading Linux 5.16.16-gentoo-x86_64 ...'

      linux   /vmlinuz-5.16.16-gentoo-x86_64 root=/dev/sda7 ro  

   }

   menuentry 'Gentoo GNU/Linux, with Linux 5.16.16-gentoo-x86_64 (recovery mode)' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-5.16.16-gentoo-x86_64-recovery-e256d95d-6fad-4ca7-a1d1-c7f51f788fa6' {

      load_video

      set gfxpayload=keep

      insmod gzio

      insmod part_gpt

      insmod fat

      set root='hd0,gpt5'

      if [ x$feature_platform_search_hint = xy ]; then

        search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt5 --hint-efi=hd0,gpt5 --hint-baremetal=ahci0,gpt5  CC95-F8AC

      else

        search --no-floppy --fs-uuid --set=root CC95-F8AC

      fi

      echo   'Loading Linux 5.16.16-gentoo-x86_64 ...'

      linux   /vmlinuz-5.16.16-gentoo-x86_64 root=/dev/sda7 ro single 

   }

   menuentry 'Gentoo GNU/Linux, with Linux 5.16.16-gentoo' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-5.16.16-gentoo-advanced-e256d95d-6fad-4ca7-a1d1-c7f51f788fa6' {

      load_video

      set gfxpayload=keep

      insmod gzio

      insmod part_gpt

      insmod fat

      set root='hd0,gpt5'

      if [ x$feature_platform_search_hint = xy ]; then

        search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt5 --hint-efi=hd0,gpt5 --hint-baremetal=ahci0,gpt5  CC95-F8AC

      else

        search --no-floppy --fs-uuid --set=root CC95-F8AC

      fi

      echo   'Loading Linux 5.16.16-gentoo ...'

      linux   /vmlinuz-5.16.16-gentoo root=/dev/sda7 ro  

   }

   menuentry 'Gentoo GNU/Linux, with Linux 5.16.16-gentoo (recovery mode)' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-5.16.16-gentoo-recovery-e256d95d-6fad-4ca7-a1d1-c7f51f788fa6' {

      load_video

      set gfxpayload=keep

      insmod gzio

      insmod part_gpt

      insmod fat

      set root='hd0,gpt5'

      if [ x$feature_platform_search_hint = xy ]; then

        search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt5 --hint-efi=hd0,gpt5 --hint-baremetal=ahci0,gpt5  CC95-F8AC

      else

        search --no-floppy --fs-uuid --set=root CC95-F8AC

      fi

      echo   'Loading Linux 5.16.16-gentoo ...'

      linux   /vmlinuz-5.16.16-gentoo root=/dev/sda7 ro single 

   }

   menuentry 'Gentoo GNU/Linux, with Linux 5.16.16-gentoo.old' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-5.16.16-gentoo.old-advanced-e256d95d-6fad-4ca7-a1d1-c7f51f788fa6' {

      load_video

      set gfxpayload=keep

      insmod gzio

      insmod part_gpt

      insmod fat

      set root='hd0,gpt5'

      if [ x$feature_platform_search_hint = xy ]; then

        search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt5 --hint-efi=hd0,gpt5 --hint-baremetal=ahci0,gpt5  CC95-F8AC

      else

        search --no-floppy --fs-uuid --set=root CC95-F8AC

      fi

      echo   'Loading Linux 5.16.16-gentoo.old ...'

      linux   /vmlinuz-5.16.16-gentoo.old root=/dev/sda7 ro  

   }

   menuentry 'Gentoo GNU/Linux, with Linux 5.16.16-gentoo.old (recovery mode)' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-5.16.16-gentoo.old-recovery-e256d95d-6fad-4ca7-a1d1-c7f51f788fa6' {

      load_video

      set gfxpayload=keep

      insmod gzio

      insmod part_gpt

      insmod fat

      set root='hd0,gpt5'

      if [ x$feature_platform_search_hint = xy ]; then

        search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt5 --hint-efi=hd0,gpt5 --hint-baremetal=ahci0,gpt5  CC95-F8AC

      else

        search --no-floppy --fs-uuid --set=root CC95-F8AC

      fi

      echo   'Loading Linux 5.16.16-gentoo.old ...'

      linux   /vmlinuz-5.16.16-gentoo.old root=/dev/sda7 ro single 

   }

}

### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_linux_xen ###

### END /etc/grub.d/20_linux_xen ###

### BEGIN /etc/grub.d/30_os-prober ###

### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/30_uefi-firmware ###

menuentry 'UEFI Firmware Settings' $menuentry_id_option 'uefi-firmware' {

   fwsetup

}

### END /etc/grub.d/30_uefi-firmware ###

### BEGIN /etc/grub.d/40_custom ###

# This file provides an easy way to add custom menu entries.  Simply type the

# menu entries you want to add after this comment.  Be careful not to change

# the 'exec tail' line above.

### END /etc/grub.d/40_custom ###

### BEGIN /etc/grub.d/41_custom ###

if [ -f  ${config_directory}/custom.cfg ]; then

  source ${config_directory}/custom.cfg

elif [ -z "${config_directory}" -a -f  $prefix/custom.cfg ]; then

  source $prefix/custom.cfg

fi

### END /etc/grub.d/41_custom ###

```

----------

## NeddySeagoon

Ludovico,

Your newest kernel is 

```
-rwxr-xr-x 1 root root 13823104 Mar 22 06:48 vmlinuz-5.16.16-gentoo 
```

The default boot stanza says

```
menuentry 'Gentoo GNU/Linux' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-e256d95d-6fad-4ca7-a1d1-c7f51f788fa6' {

   load_video

   set gfxpayload=keep

   insmod gzio

   insmod part_gpt

   insmod fat

   set root='hd0,gpt5'

   if [ x$feature_platform_search_hint = xy ]; then

     search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt5 --hint-efi=hd0,gpt5 --hint-baremetal=ahci0,gpt5  CC95-F8AC

   else

     search --no-floppy --fs-uuid --set=root CC95-F8AC

   fi

   echo   'Loading Linux 5.16.16-gentoo-x86_64 ...'

   linux   /vmlinuz-5.16.16-gentoo-x86_64 root=/dev/sda7 ro 
```

} 

It loads  vmlinuz-5.16.16-gentoo-x86_64 which is from 21-Mar.

```
 -rwxr-xr-x 1 root root  9685664 Mar 21 20:23 vmlinuz-5.16.16-gentoo-x86_64
```

To boot your newest kernel, you need to go into the 

```
Advanced options for Gentoo GNU/Linux
```

on the grub menu.

Where you will see

```
Gentoo GNU/Linux, with Linux 5.16.16-gentoo-x86_64

Gentoo GNU/Linux, with Linux 5.16.16-gentoo-x86_64 (recovery mode)

Gentoo GNU/Linux, with Linux 5.16.16-gentoo                <<----  Boot this one                   

Gentoo GNU/Linux, with Linux 5.16.16-gentoo (recovery mode)

Gentoo GNU/Linux, with Linux 5.16.16-gentoo.old

Gentoo GNU/Linux, with Linux 5.16.16-gentoo.old (recovery mode)
```

Boot the kernel I've highlighted and post back.

----------

## Ludovico

 *NeddySeagoon wrote:*   

> 
> 
> ```
> Gentoo GNU/Linux, with Linux 5.16.16-gentoo-x86_64
> 
> ...

 

I still got kernel panic after doing this.

----------

## NeddySeagoon

Ludovico,

What in the panic message now?

If its ... unknown-block(x,y), tell us what x and y are.

(0,0) means the kernel cannot see your HDD still. (8,7) would mean that the kernel can see  /dev/sda7 but not read what it finds there.

There are other numbers too.

There are other panic messages, so we need to know how the error is reported now,

----------

## Ludovico

 *NeddySeagoon wrote:*   

> Ludovico,
> 
> What in the panic message now?
> 
> If its ... unknown-block(x,y), tell us what x and y are.
> ...

 

It's still (0,0)

----------

## NeddySeagoon

Ludovico,

Pastebin your kernel .config again please. I'm old and cynical and want to know I'm working with the latest information.

Oh, Rule 1 is assume nothing. Its not personal, its the way I work.

----------

## Ludovico

 *NeddySeagoon wrote:*   

> Ludovico,
> 
> Pastebin your kernel .config again please. I'm old and cynical and want to know I'm working with the latest information.
> 
> Oh, Rule 1 is assume nothing. Its not personal, its the way I work.

 

Here, https://dpaste.com/AX3VJB47J

----------

## NeddySeagoon

Ludovico,

```
CONFIG_MSDOS_PARTITION=y

CONFIG_EFI_PARTITION=y
```

Good, the kernel can read your partition tables.

```
CONFIG_BLOCK=y

# SCSI device support

#

CONFIG_SCSI_MOD=y

# CONFIG_RAID_ATTRS is not set

CONFIG_SCSI_COMMON=y

CONFIG_SCSI=y

CONFIG_SCSI_DMA=y

CONFIG_SCSI_PROC_FS=y

CONFIG_BLK_DEV_SD=y
```

Good that's the high level SCSI things.

```
# CONFIG_BLK_DEV_SR is not set
```

 is required for optical drives but its not a problem now.

```
CONFIG_SCSI_LOWLEVEL=y
```

is not required at all. It only hides all the options in the menu.

```
CONFIG_ATA=y

CONFIG_SATA_AHCI=y
```

Thats the driver for your HDD chip set. Good.

```
CONFIG_ATA_VERBOSE_ERROR=y
```

 gets you logspam but is otherwise harmless.

```
CONFIG_SATA_PMP=y
```

is not required but its harmless.

That's enough to not get unknown-block(0,0)

So we have a contradiction. The .config should not produce the result that it does.

Let's follow the timestamp trail, to make sure we are seeing what we think we are.

The kernel build process starts with 

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

Use ls -l to see its timestamp.

In must be older than all of the derived files.

It produces the kernel binary, which is at 

```
/usr/src/linux/arch/x86/bzImage
```

It must be newer that the .config or the kernel was not made with that config file.

A kernel file with a different name and a very close timestamp must be in /boot. 

That's your 

```
Mar 22 06:48 vmlinuz-5.16.16-gentoo
```

There are several copies of the kernel binary is the build tree. vmlinuz in one, vmlinux another. I don't know which one make install copies.

They may have slightly different timestamps.

If that timestamp trace fails, rebuild your kernel again but start with 

```
make clean
```

so that everything is rebuilt.

Take care to boot the right kernel too.

----------

## Ludovico

 *NeddySeagoon wrote:*   

> Ludovico,
> 
> ```
> CONFIG_MSDOS_PARTITION=y
> 
> ...

 

Now it's stuck on Loading Linux 5.16.16-gentoo... 

Maybe i will do a fresh install tomorrow.

----------

## pietinger

 *Ludovico wrote:*   

> I run make -j4 && make modules_install && make install. And then i reboot to my gentoo.

 

For the future: IF you are using grub2 you must do this after EVERY new kernel (AFTER your correct commands). Maybe you thought its done with the initial installation; NO, you must do it allways:

```
# grub-mkconfig -o /boot/grub/grub.cfg
```

This is needed to get a new and correct entry in grub menu. See more here: https://wiki.gentoo.org/wiki/Handbook:AMD64/Installation/Bootloader

----------

## pietinger

 *Ludovico wrote:*   

> Now it's stuck on Loading Linux 5.16.16-gentoo... 

 

I think your kernel boots now, but you dont see it because of wrong frame buffer devices:

Change this:

```
CONFIG_FB_VGA16=m

# CONFIG_FB_UVESA is not set

# CONFIG_FB_VESA is not set

CONFIG_FB_EFI=y
```

Dont use modules here ! You need only CONFIG_FB_VESA. Enable this static into your kernel and disable CONFIG_FB_VGA16

----------

## NeddySeagoon

pietinger,

CONFIG_FB_EFI=y will be preferred and amddrmfb will take over from that.

VGA16 will never be used, its harmless bloat.

----------

## pietinger

Neddy,

are you sure, when booting with grub2 ? I am not an expert for grub2; but I think FB_EFI is used only if you do an UEFI-boot directly into a stub-kernel.

(https://wiki.gentoo.org/wiki/EFI_stub)

If nothing helps, I would try to enable this:

```
# CONFIG_SYSFB_SIMPLEFB is not set
```

----------

## NeddySeagoon

pietinger,

The console was fixed in a previous topic.

The problem now is a kernel panic with unknown-block(0,0) so the kernel cannot see the SATA controller.

----------

## NeddySeagoon

Ludovico,

Reinstalling Gentoo will not fix your kernel problem. 

You can sidestep the kernel build until you have more time if you wish.

There is a ready made kernel and initrd that you can use as a get-U-going and there is genkernel, that by default, builds the same kernel as is provided on the install media.

That gives you the opportunity to change the configuration if you want to.

Meanwhile, look for your kernel in /boot

Delete them all except the newest one. That way you can be sure that you are not starting one of the kernel you know does not work.

We fixed your console problem in another topic, so I'm surprised that its back. 

```
make clean
```

does not harm the config file.

pietinger, 

I was too hasty replying to you. I missed the response to my post about rebuilding from make clean.

My apologies.

----------

## Ludovico

Here are some updates that I did, so I did a fresh install of gentoo with gentoo-kernel-bin because I gave up configuring it manually.  :Crying or Very sad: 

Maybe i will configure it manually when i have another free time   :Cool: 

----------

## NeddySeagoon

Ludovico,

That's fine. Making your own kernel the way you want it takes as much or more of your time than the rest of the Gentoo install.

When you approach Gentoo, first make it work as that gives you a baseline to go back to when (not if) you add something and it fails.

Build on what you know works. Make it leaner, meaner, faster, shinier later.

You can have several kernels installed as long as they have different names as shown by 

```
uname -r
```

There was no need to do a new install 

```
emerge gentoo-kernel-bin
```

 in the chroot and a grub.cfg update was all that was needed.

----------

## Ludovico

Btw, in this installation I didn't build initramfs. Is that why this problem occurs?

----------

## NeddySeagoon

Ludovico,

No. gentoo-kernel-bin will have provided an initrd if it needed one.

Lets look at the boot process, with and without an initrd.

At power up, the only code available to the CPU is the firmware. It doesn't matter at this level if its BIOS or EFI. It does its thing, loads the boot loader and the boot loader shows you a menu. Lets say that the boot loader is Grub but in could be another boot loader.

All that is in RAM now in Grub. Grub can make calls to the firmware but that's it. There is no kernel yet, no initrd and no kernel filesystem tree. They all come later.

You choose the kernel entry to boot, which may include a matching initrd. Grub loads the kernel, optionally the initrd and leave the kernel command line where the kernel will find it.

Grub exits by jumping to the kernel start address.

Now we have the kernel and optional initrd in RAM and the kernel command line. If there is no initrd, its just the kernel. Without any outside help, the kernel mush be able to mount the root filesystem ash start the init script. That's no quite true the kernel cannot find the root filesystem on its own as root is not mounted, so /etc/fstab cannot be read. 

That's a circular dependency. The kernel parameter root=/dev/... breaks the circular dependency.

As the kernel is alone until root is mounted, all the required code to mount root must be configured as <*> for built in. Loadable modules <M> are stored in /lib/modules/`uname -r` which is on the root filesystem, which cannot be read until root is mounted. Its a very bad thing to need to read /lib/modules/ to load a module required to mount root to read  /lib/modules/, if you see what I mean. Making things built in avoids that circular dependency.

The initrd can help here. An initrd is a small root filesystem in a file that if the kernel is configured to support an initrd, it knows how to mount and read.

If there is an initrd, the kernel will mount it and use it as a temporary root filesystem. The initrd can contain whatever you like. Kernel modules, user space tools, anything you like at all.  If it contains kernel modules, the initrd is tied to the kernel build because the kernel will check for bits of itself.

The use of an initrd is only compulsory if user space tools are required to make the root filesystem visible to the kernel.

e.g. root on raid, where mdadm is required to start the raid. Root in a logical volume, root in LUKS ... and all the combinations.

Mounting root by filesystem UUID requires the user space mount command.

You were advised against UUID fairly early on and you have not mentioned any of the other things so I expect you can make your system boot with no initrd,

----------

## Ludovico

 *NeddySeagoon wrote:*   

> No. gentoo-kernel-bin will have provided an initrd if it needed one.
> 
> 

 

No, i mean the installation before which use gentoo-source

----------

## Ludovico

 *NeddySeagoon wrote:*   

> At power up, the only code available to the CPU is the firmware. It doesn't matter at this level if its BIOS or EFI. It does its thing, loads the boot loader and the boot loader shows you a menu. Lets say that the boot loader is Grub but in could be another boot loader.
> 
> All that is in RAM now in Grub. Grub can make calls to the firmware but that's it. There is no kernel yet, no initrd and no kernel filesystem tree. They all come later.
> 
> You choose the kernel entry to boot, which may include a matching initrd. Grub loads the kernel, optionally the initrd and leave the kernel command line where the kernel will find it.
> ...

 

Thank you so much for your explanation. I really learned a lot from you.  :Cool: 

----------

## Zucca

Also fix your fstab too. Last two lines have noatime0. You're missing space before "0" there. ;)

----------

## Ludovico

 *Zucca wrote:*   

> Also fix your fstab too. Last two lines have noatime0. You're missing space before "0" there. 

 

noatime0 only happen when i cat the /etc/fstab, but when i use nano it has a space.   :Crying or Very sad: 

----------

## NeddySeagoon

Ludovico,

Its probably a tab character.

----------

