VFS: Cannot open root device "sda"

1,479 views
Skip to first unread message

Xingyun Du

unread,
Apr 25, 2021, 4:43:38 PM4/25/21
to syzkaller
Hi,
I'm trying to use QEMU to run a linux-5.10.32 kernel on my computer. I created a stretch.img by executing https://raw.githubusercontent.com/google/syzkaller/master/tools/create-image.sh.

I used the following command to launch qemu:
qemu-system-x86_64 \
    -m 2048M \
    -gdb tcp::1234 \
    -net nic -net user,hostfwd=tcp:127.0.0.1:2222-:22 \
    -display none -serial stdio -no-reboot \
    -hda ./stretch.img \
    -kernel ./linux-5.10.32/arch/x86_64/boot/bzImage \
    -append "root=/dev/sda console=ttyS0"

Here's the error message I got:
[    1.779084] VFS: Cannot open root device "sda" or unknown-block(0,0): error -6
[    1.779177] Please append a correct "root=" boot option; here are the available partitions:
[    1.779501] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
[    1.779884] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.8.18 #3
[    1.779957] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.14.0-2 04/01/2014
[    1.780277] Call Trace:
[    1.780957]  dump_stack+0x6b/0x88
[    1.781073]  panic+0x101/0x2d7
[    1.781165]  mount_block_root+0x2a0/0x31a
[    1.781311]  prepare_namespace+0x136/0x165
[    1.781405]  kernel_init_freeable+0x23c/0x266
[    1.781483]  ? rest_init+0xaa/0xaa
[    1.781541]  kernel_init+0xa/0x106
[    1.781598]  ret_from_fork+0x22/0x30
[    1.781987] Kernel Offset: 0xaa00000 from 0xffffffff81000000 (relocation range: 0xffffffff80000000-0xffffffffbfffffff)
[    1.782331] ---[ end Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0) ]---

Could someone give some advice please?

Here's the full QEMU output: https://pastebin.ubuntu.com/p/Qn2tyNrKbY/.
Here's the kernel make config: https://pastebin.ubuntu.com/p/CNfzWrqM5g/.
My QEMU version is 5.2.0 (Debian 1:5.2+dfsg-9).
My Host OS is Linux 5.10.0-6-amd64 #1 SMP Debian 5.10.28-1 (2021-04-09) x86_64 GNU/Linux.

Thanks for any help!

Dmitry Vyukov

unread,
Apr 26, 2021, 2:12:49 AM4/26/21
to Xingyun Du, syzkaller
Hi Xingyun,

It seems the kernel config does have support for the right block
device/partition type, the list is empty:

> [ 1.779177] Please append a correct "root=" boot option; here are the available partitions:
> [ 1.779501] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)

Try a config that is known to work:
https://github.com/google/syzkaller/blob/master/dashboard/config/linux/upstream-apparmor-kasan.config

Xingyun Du

unread,
Apr 28, 2021, 2:53:30 PM4/28/21
to syzkaller
Hi Dmitry,

Thank you for your reply. I followed your suggestion and successfully booted the kernel.

Many thanks!
Reply all
Reply to author
Forward
0 new messages