From 50ac89b779363774325c81157ec8b9a6bdb50a2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ciro=20Santilli=20=E5=85=AD=E5=9B=9B=E4=BA=8B=E4=BB=B6=20?= =?UTF-8?q?=E6=B3=95=E8=BD=AE=E5=8A=9F?= Date: Tue, 10 Dec 2019 00:00:00 +0000 Subject: [PATCH] not syncing: VFS: Unable to mount root fs on unknown-block(0,0) section --- README.adoc | 23 +++++++++++++++++++++++ linux_config/default | 2 ++ 2 files changed, 25 insertions(+) diff --git a/README.adoc b/README.adoc index 32ae070..eb1f372 100644 --- a/README.adoc +++ b/README.adoc @@ -6646,6 +6646,29 @@ Source: link:kernel_modules/warn_on.c[] Can also be activated with the `panic_on_warn` boot parameter. +[[not-syncing]] +==== not syncing: VFS: Unable to mount root fs on unknown-block(0,0) + +Let's learn how to diagnose problems with the root filesystem not being found. TODO add a sample panic error message for each error type: + +* https://askubuntu.com/questions/41930/kernel-panic-not-syncing-vfs-unable-to-mount-root-fs-on-unknown-block0-0/1048477#1048477 + +This is the diagnosis procedure: + +* does the filesystem appear on the list of filesystems? If not, then likely you are missing either: +** the driver for that hardware type, e.g. hard drive / SSD type. Here, Linux does not know how to communicate with a given hardware to get bytes from it at all. In simiulation, the most important often missing one is virtio which needs: ++ +.... +CONFIG_VIRTIO_PCI=y +CONFIG_VIRTIO_BLK=y +.... +** the driver for that filesystem type. Here, Linux can read bytes from the hardware, but cannot interpret them as a tree of files because it does not recognize the file system format. For example, to boot from <> we would need: ++ +.... +CONFIG_SQUASHFS=y +.... +* your filesystem of interest appears in the list, then you just need to set the `root` <> to point to that, e.g. `root=/dev/sda` + === Pseudo filesystems Pseudo filesystems are filesystems that don't represent actual files in a hard disk, but rather allow us to do special operations on filesystem-related system calls. diff --git a/linux_config/default b/linux_config/default index 47e5bd9..b34e4b6 100644 --- a/linux_config/default +++ b/linux_config/default @@ -7,6 +7,7 @@ CONFIG_MODULE_SRCVERSION_ALL=y # Filesystems. CONFIG_DEBUG_FS=y CONFIG_OVERLAY_FS=y +# https://cirosantilli.com/linux-kernel-module-cheat#squashfs CONFIG_SQUASHFS=y # GDB debugging. @@ -77,6 +78,7 @@ CONFIG_NET_9P_VIRTIO=y CONFIG_PCI=y CONFIG_PCI_HOST_COMMON=y CONFIG_PCI_HOST_GENERIC=y +# https://cirosantilli.com/linux-kernel-module-cheat#not-syncing CONFIG_VIRTIO_PCI=y CONFIG_VIRTIO_BLK=y