# not syncing: vfs: unable to mount root on uknown-block(0,0)

## Adel Ahmed

I get a kernel panic when i try to boot my newly installed system:

https://drive.google.com/open?id=1-kG-GqjCMNgZ3fWQEabl4rq2tqk5uFdn

here's my kernel config:

https://pastebin.com/NVbshNQH

lspci -k:

```
00:00.0 Host bridge: Intel Corporation Atom/Celeron/Pentium Processor x5-E8000/J3xxx/N3xxx Series SoC Transaction Register (rev 36)

   Subsystem: Intel Corporation Atom/Celeron/Pentium Processor x5-E8000/J3xxx/N3xxx Series SoC Transaction Register

   Kernel driver in use: iosf_mbi_pci

00:02.0 VGA compatible controller: Intel Corporation Atom/Celeron/Pentium Processor x5-E8000/J3xxx/N3xxx Series PCI Configuration Registers (rev 36)

   DeviceName:  Onboard IGD

   Subsystem: Intel Corporation Atom/Celeron/Pentium Processor x5-E8000/J3xxx/N3xxx Series PCI Configuration Registers

   Kernel driver in use: i915

   Kernel modules: i915

00:03.0 Multimedia controller: Intel Corporation Atom/Celeron/Pentium Processor x5-E8000/J3xxx/N3xxx Series Imaging Unit (rev 36)

   Subsystem: Intel Corporation Atom/Celeron/Pentium Processor x5-E8000/J3xxx/N3xxx Series Imaging Unit

00:0b.0 Signal processing controller: Intel Corporation Atom/Celeron/Pentium Processor x5-E8000/J3xxx/N3xxx Series Power Management Controller (rev 36)

   Subsystem: Intel Corporation Atom/Celeron/Pentium Processor x5-E8000/J3xxx/N3xxx Series Power Management Controller

   Kernel driver in use: proc_thermal

   Kernel modules: processor_thermal_device

00:14.0 USB controller: Intel Corporation Atom/Celeron/Pentium Processor x5-E8000/J3xxx/N3xxx Series USB xHCI Controller (rev 36)

   Subsystem: Intel Corporation Atom/Celeron/Pentium Processor x5-E8000/J3xxx/N3xxx Series USB xHCI Controller

   Kernel driver in use: xhci_hcd

   Kernel modules: xhci_pci

00:1a.0 Encryption controller: Intel Corporation Atom/Celeron/Pentium Processor x5-E8000/J3xxx/N3xxx Series Trusted Execution Engine (rev 36)

   Subsystem: Intel Corporation Atom/Celeron/Pentium Processor x5-E8000/J3xxx/N3xxx Series Trusted Execution Engine

   Kernel driver in use: mei_txe

   Kernel modules: mei_txe

00:1f.0 ISA bridge: Intel Corporation Atom/Celeron/Pentium Processor x5-E8000/J3xxx/N3xxx Series PCU (rev 36)

   Subsystem: Intel Corporation Atom/Celeron/Pentium Processor x5-E8000/J3xxx/N3xxx Series PCU

   Kernel driver in use: lpc_ich

   Kernel modules: lpc_ich
```

blkid:

/dev/sda1: LABEL="root" UUID="da1c39d1-54af-4a5a-a29d-d44b89944dbf" UUID_SUB="c075b6be-c77e-494a-b2a5-4c92c0b0c167" TYPE="btrfs" PARTUUID="a0507899-01"

fstab:

```
LABEL="root"      /      btrfs      defaults
```

grub.cfg:

```
set timeout=10

set default=0

set fallback=1

set pager=1

# Display settings

if loadfont /boot/grub/font.pf2 ; then

   set gfxmode=auto

   insmod efi_gop

   insmod efi_uga

   insmod gfxterm

   insmod all_video

   insmod videotest

   insmod videoinfo

   terminal_output gfxterm

fi

menuentry "Gentoo" {

   set gfxpayload=keep

   linux /boot/kernel2 root=/dev/sda1 ro init=/lib/systemd/systemd rootfstype=btrfs

#   initrd /boot/initrd

}

menuentry "Boot SystemRescueCd and copy system to RAM" {

   set gfxpayload=keep

   linux /boot/vmlinuz archisobasedir=sysresccd archisolabel=SYSRCD603 copytoram

   initrd /boot/sysresccd.img 

}

```

Last edited by Adel Ahmed on Sat Nov 09, 2019 5:29 pm; edited 1 time in total

----------

## Adel Ahmed

Bump

----------

## molletts

Can you post the dmesg from sysrescuecd, or whatever you used initially to install the system? That should show which driver is actually needed for the root storage device. The panic message suggests that the storage driver is missing from your kernel, although you've got AHCI, which is the obvious one for modern SATA disks, plus the older Intel ICH legacy PATA/SATA and 1990s-era PIIX IDE drivers installed.

----------

## fturco

@Adel Ahmed: do you need an initramfs image for booting? I noticed you commented it out in your GRUB configuration...

----------

## NeddySeagoon

Adel Ahmed,

Your lspci shows no block device hardware.

I was expecting something IDE/SATA/NVMe and its all missing.

The unknown-block(0,0) means that the kernel cannot talk to any block devices, which since you don't have any, is expected.

Have you disabled them all in the BIOS?

----------

## Adel Ahmed

Sorry everyone

I forgot to mention im booting from a usb flash storage.

And i have xhci_pci and xhci_hcd and mass storage in the kernel

And im trying to do this without and initramfs

----------

## fturco

Did you install Gentoo inside a btrfs subvolume? If so, you probably need to add the rootflags=subvol=@name kernel parameter.

----------

## NeddySeagoon

Adel Ahmed,

That its USB matters a lot.

The kernel normally mounts root before the USB subsystem is started.

That's a verybadthing for root on USB.

For debug, add rootdelay=30 to the kernel command line. Now the kernel will wait 30 seconds for root to appear then go on to panic if it doesn't

Once it works, use rootwait. That will be faster than 30 seconds when it works but it will wait forever if it has to. 

You cannot use LABEL= or UUID= without an initrd. The kernel does not understand them. You must use root=/dev/... or root=PARTUUID=...

As I don't use btrfs, I have no idea how you tell the kernel about a subvolume.

----------

## fturco

@Adel Ahmed

I forgot to say that if you installed Gentoo in a btrfs subvolume you also need to specify that in /etc/fstab. For example:

```
LABEL="root" / btrfs defaults,subvol=@name 0 0
```

----------

## Adel Ahmed

 *NeddySeagoon wrote:*   

> Adel Ahmed,
> 
> That its USB matters a lot.
> 
> The kernel normally mounts root before the USB subsystem is started.
> ...

 

Yup that was it, adding root delay changed the kernel panic to (8,1) .

at least we are past the controllers and usb sticks, I'm trying to figure out why it is unable to mount a btrfs filesystem.

----------

## NeddySeagoon

Adel Ahmed,

(8,1)  is sda1. It that what you expected?

The kernel can find the block device but not read what it finds there.

----------

## Adel Ahmed

Correct, sda1 is the only device

Im trying to figure out why it is unable to read the filesystem there.

----------

## Adel Ahmed

In case it's relevant:

The system esp partition is on the system hard disk(a memory card, /dev/mmcblk0p1)

I dont know if my system can read  that partition or not

The usb is formatted in mbr not gpt

The usb has only one btrfa partition for the root filesystem with no subvolumes.

----------

## NeddySeagoon

Adel Ahmed,

If you are looking for a btrfs sub volume, there is no filesystem on sda1.

Like I've said, you may not use root=LABEL or root=UUID without an initrd.

The kernel only understands root=/dev/sda1 or root=PARTUUID=... which both describe entire partitions.

LABEL and UUID required the userspace mount command and you can't get at that until root is mounted.

Hence you need an initrd to go that route.

A few posts ago fturco mentioned that you would need 

```
rootflags=subvol=@name kernel parameter
```

I don't know if that is something the kernel understands or passes to userspace tools.

----------

## Adel Ahmed

I do not have subvolumes

I have xhanged my grub entry to root=/dev/sda1 and i get the same error

I converted the partition to ext4, reinstalled grub and editted the fstab and i still get a kernel panic

My new fstab:

/Dev/sda1 / ext4 defaults

----------

## molletts

 *Adel Ahmed wrote:*   

> ... I have changed my grub entry to root=/dev/sda1 and i get the same error
> 
> I converted the partition to ext4, reinstalled grub and editted the fstab and i still get a kernel panic

 

This suggests that maybe the USB stick isn't /dev/sda for some reason. Is there any other USB storage device attached, such as a USB card reader, that may be detected first?

The most reliable way is to use root=PARTUUID=whatever, using the value reported by blkid. This is what I do for my bootable USB stick that I use for diagnostics, combined with rootwait. That way, no matter what other block devices get detected via the SCSI subsystem, the right device always gets used as root.

Incidentally, if the stick is a USB3 one, you may benefit from enabling USB Attached SCSI (UAS) support in the USB storage configuration, once you get the system working.

----------

## NeddySeagoon

Adel Ahmed,

Until root is mounted, /etc/fstab cannot be read. Its on the root filesystem. 

Its just your kernel and kernel command line.

That's all there is in memory as you don't have an initrd.

-- edit --

```
# CONFIG_EXT4_FS is not set
```

----------

## Adel Ahmed

I have tries setting the root to /dev/sdb1

But the kernel just hangs because of the rootwait parameter

I assume that means this is the only device?

Thanks for the uas advice

I have compiled ext4 support in the kernel, ihavent posted the new configuration

----------

## molletts

 *Adel Ahmed wrote:*   

> I have tries setting the root to /dev/sdb1
> 
> But the kernel just hangs because of the rootwait parameter
> 
> I assume that means this is the only device?

 

That's probably a correct assumption.

 *Adel Ahmed wrote:*   

> I have compiled ext4 support in the kernel, ihavent posted the new configuration

 

Did you remember to a) copy the new kernel into /boot (the number of times I've forgotten to do this then wondered why my system still doesn't work...) and b) update the rootfstype parameter?

----------

## NeddySeagoon

Adel Ahmed,

Rule One: Assume Nothing.

Go back to rootdelay. The Panic message will be useful.

The kernel will even list the block devices that it can see. Watch out for the empty list.

----------

## Adel Ahmed

I have copied the kernel again, same result

I never used the rootfstype but i set it to rootfstype=ext4 and it didnt work either 

\

i cant see the list of devices in rootdelay, aybe because the screen is too small?

I cant see the available devices are: prompt

i copied the system over to the internal hard disk which is /dev/mmcblk0p2

rootwait hangs indeifintely

rootwait hangs with unable to ount root fs on unknown-block(0,0) 

still no avaiable devices

I'll check my kernel configuration for mmc support.

mean while i can't boot off of a usb or a meory card.

----------

## NeddySeagoon

Adel Ahmed,

Give us some up to date information to work with.

Booting from USB is easier than mmc as there are lots of different mmc drivers and only one will work.

Your (e)mmc controller is not on the PCIe bus.

If its not on USB either, it can get really challenging.

----------

## Adel Ahmed

Its just something i was trying

My aim at the moment is ti still install things on usb

----------

## NeddySeagoon

Adel Ahmed,

Go back to USB and ext4.

Use rootdelay=30, not rootwait.

After the timeout, the kernel will either boot or panic.

If it panics, we need the numbers in unknown-block(X,Y)

If the kernel says 

```
Unable to find root device in <device_list>. 
```

the device list will be useful.

<device_list> may be empty too. That's important.

Put that into a post.

Put the kernel .config that you think you were using onto a pastbin so we have an up to date self consistent set of data to work with.

----------

## Adel Ahmed

he's the new post:

https://forums.gentoo.org/viewtopic-p-8387784.html#8387784

 *Quote:*   

> I believe i have the correct kernel configuration to support ext4:
> 
> https://pastebin.com/hfBVUHuw

 

I made a pigs ear of that. I should have done a topic merge.

-- NeddySeagoon

----------

## NeddySeagoon

Adel Ahmed,

How is your USB stick partitioned GPT or MSDOS?

```
# CONFIG_MSDOS_PARTITION is not set

CONFIG_EFI_PARTITION=y
```

MSDOS is normal for USB Sticks and (e)mmc but your kernel can't read that.

```
CONFIG_BLOCK=y
```

I think SCSI is hidden if you don't have that.

```
CONFIG_SCSI=y

CONFIG_BLK_DEV_SD=y

CONFIG_CHR_DEV_SG=y
```

Good, they are all needed for USB block devices.

```
CONFIG_USB_STORAGE=y
```

You may as well have 

```
# CONFIG_USB_UAS is not set
```

on but its not essential.

For devices that support USB attached SCSI, you get DMA transfers and overlapped commands, unlike bulk mode, which is akin to IDE PIO. 

```
CONFIG_EXT4_FS=y

CONFIG_EXT4_USE_FOR_EXT2=y
```

Good.

Your lspci only shows USB xHCI Controller, that's USB3. It will also do all the lower USB standards.

```

CONFIG_USB_PCI=y

CONFIG_USB_XHCI_HCD=y

CONFIG_USB_XHCI_PCI=y
```

good.

The EHCI and OHCI options are not required. You don't have that hardware.

Before you rebuild your kernel with CONFIG_MSDOS_PARTITION=y what does fdisk say about your partition tables?

MSDOS or GPT?

----------

## Adel Ahmed

Yes

Enabling the msdos partitions fixed it

I have a bootable ext4 usb stick

Next steps will b e mmc and btrfs

Thank you very much  :Smile: 

----------

