init: Add bdev fs printk if mount_block_root failed
PATCH 1/1 init: Add bdev fs printk if mount_block_root failed
Attempt to printk all bdev fstype as root gives the following kernel panic:
[ 1.729006] VFS: Cannot open root device "vda" or unknown-block(253,0): error -19 [ 1.730603] Please append a correct "root=" boot option; here are the available partitions: [ 1.732323] fd00 256000 vda [ 1.732329] driver: virtio_blk [ 1.734194] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(253,0) [ 1.734771] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 6.4.0-rc2+ #53 [ 1.735194] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.10.2-1ubuntu1 04/01/2014 [ 1.735772] Call Trace: [ 1.735950] <TASK> [ 1.736113] dump_stack_lvl+0x32/0x50 [ 1.736367] panic+0x108/0x310 [ 1.736570] mount_block_root+0x161/0x310 [ 1.736849] ? rdinit_setup+0x40/0x40 [ 1.737088] prepare_namespace+0x10c/0x180 [ 1.737393] kernel_init_freeable+0x354/0x450 [ 1.737707] ? rest_init+0xd0/0xd0 [ 1.737945] kernel_init+0x16/0x130 [ 1.738196] ret_from_fork+0x1f/0x30
QEMU command line:
"qemu-system-x86_64 -append root=/dev/vda rootfstype=ext4 ..."
This error is because ext4 is not buildin and request ext4 module fail.
As a hint, printk all the bdev fstype available for prompts.
--- init/do_mounts.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-)
init/do_mounts.c +12 -1
@@ -427,8 +427,19 @@ void __init mount_block_root(char *name, int flags)printk ("VFS: Cannot open root device \"%s\" or %s: error %d\n" , root_device_name, b, err);printk ("Please append a correct \"root=\" boot option; here are the available partitions:\n" ); -printk_all_partitions (); + +if (root_fs_names) + num_fs =list_bdev_fs_names (fs_names,PAGE_SIZE ); +if (!num_fs) +pr_err ("Can't find any bdev filesystem to be used for mount!\n" ); +else { +pr_err ("List of all bdev filesystem:\n" ); +for (i =0 , p = fs_names; i < num_fs; i++, p +=strlen (p)+1 ) +pr_err (" %s" , p); +pr_err ("\n" ); + } +panic ("VFS: Unable to mount root fs on %s" , b); }if (!(flags &SB_RDONLY )) {
Signature · 1 line
2.25.1
Quoted 21 lines · On Thu, 18 May 2023 11:53:21 +0800 Angus Chen <[email protected]>…
Attempt to printk all bdev fstype as root gives the following kernel panic:
[ 1.729006] VFS: Cannot open root device "vda" or unknown-block(253,0): error -19 [ 1.730603] Please append a correct "root=" boot option; here are the available partitions: [ 1.732323] fd00 256000 vda [ 1.732329] driver: virtio_blk [ 1.734194] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(253,0) [ 1.734771] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 6.4.0-rc2+ #53 [ 1.735194] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.10.2-1ubuntu1 04/01/2014 [ 1.735772] Call Trace: [ 1.735950] <TASK> [ 1.736113] dump_stack_lvl+0x32/0x50 [ 1.736367] panic+0x108/0x310 [ 1.736570] mount_block_root+0x161/0x310 [ 1.736849] ? rdinit_setup+0x40/0x40 [ 1.737088] prepare_namespace+0x10c/0x180 [ 1.737393] kernel_init_freeable+0x354/0x450 [ 1.737707] ? rest_init+0xd0/0xd0 [ 1.737945] kernel_init+0x16/0x130 [ 1.738196] ret_from_fork+0x1f/0x30
Quoted 7 lines
QEMU command line:
"qemu-system-x86_64 -append root=/dev/vda rootfstype=ext4 ..."This error is because ext4 is not buildin and request ext4 module fail.
As a hint, printk all the bdev fstype available for prompts.
Seems reasonable. I reworded the changelog a bit:
: Booting with the QEMU command line:
: "qemu-system-x86_64 -append root=/dev/vda rootfstype=ext4 ..." : will panic if ext4 is not builtin and a request to load the ext4 module : fails.
:
: [ 1.729006] VFS: Cannot open root device "vda" or unknown-block(253,0): error -19 : [ 1.730603] Please append a correct "root=" boot option; here are the available partitions: : [ 1.732323] fd00 256000 vda : [ 1.732329] driver: virtio_blk : [ 1.734194] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(253,0) : [ 1.734771] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 6.4.0-rc2+ #53 : [ 1.735194] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.10.2-1ubuntu1 04/01/2014 : [ 1.735772] Call Trace: : [ 1.735950] <TASK> : [ 1.736113] dump_stack_lvl+0x32/0x50 : [ 1.736367] panic+0x108/0x310 : [ 1.736570] mount_block_root+0x161/0x310 : [ 1.736849] ? rdinit_setup+0x40/0x40 : [ 1.737088] prepare_namespace+0x10c/0x180 : [ 1.737393] kernel_init_freeable+0x354/0x450 : [ 1.737707] ? rest_init+0xd0/0xd0 : [ 1.737945] kernel_init+0x16/0x130 : [ 1.738196] ret_from_fork+0x1f/0x30
:
: As a hint, print all the bdev fstypes which are available.
Quoted 13 lines
init/do_mounts.c +5
-1@@ -427,8 +427,19 @@ void __init mount_block_root(char *name, int flags)printk ("VFS: Cannot open root device \"%s\" or %s: error %d\n" , root_device_name, b, err);printk ("Please append a correct \"root=\" boot option; here are the available partitions:\n" ); -printk_all_partitions (); + +if (root_fs_names) + num_fs =list_bdev_fs_names (fs_names,PAGE_SIZE ); +if (!num_fs) +pr_err ("Can't find any bdev filesystem to be used for mount!\n" );
init/do_mounts.c void __init mount_block_root(char *name, int flags) · line 445
Quoted 10 lines
init/do_mounts.c +7
-0+else { +pr_err ("List of all bdev filesystem:\n" ); +for (i =0 , p = fs_names; i < num_fs; i++, p +=strlen (p)+1 ) +pr_err (" %s" , p); +pr_err ("\n" ); + } +panic ("VFS: Unable to mount root fs on %s" , b); }if (!(flags &SB_RDONLY )) {
And I added a little fix.
init/do_mounts.c renamed from init/do_mounts.c~init-add-bdev-fs-printk-if-mount_block_root-failed-fix +1 -1
@@ -434,7 +434,7 @@ retry:if (!num_fs)pr_err ("Can't find any bdev filesystem to be used for mount!\n" );else { -pr_err ("List of all bdev filesystem:\n" ); +pr_err ("List of all bdev filesystems:\n" );for (i =0 , p = fs_names; i < num_fs; i++, p +=strlen (p)+1 )pr_err (" %s" , p);pr_err ("\n" );
_
This function now uses a jumble of printk() and pr_err(). Perhaps someone will go through and rationalize all of this sometime.
Nick Desaulniers
Acked-byQuoted 24 lines · Andrew Morton
Quoted 21 lines · On Thu, 18 May 2023 11:53:21 +0800 Angus Chen <[email protected]>…
Attempt to printk all bdev fstype as root gives the following kernel panic:
[ 1.729006] VFS: Cannot open root device "vda" or unknown-block(253,0): error -19 [ 1.730603] Please append a correct "root=" boot option; here are the available partitions: [ 1.732323] fd00 256000 vda [ 1.732329] driver: virtio_blk [ 1.734194] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(253,0) [ 1.734771] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 6.4.0-rc2+ #53 [ 1.735194] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.10.2-1ubuntu1 04/01/2014 [ 1.735772] Call Trace: [ 1.735950] <TASK> [ 1.736113] dump_stack_lvl+0x32/0x50 [ 1.736367] panic+0x108/0x310 [ 1.736570] mount_block_root+0x161/0x310 [ 1.736849] ? rdinit_setup+0x40/0x40 [ 1.737088] prepare_namespace+0x10c/0x180 [ 1.737393] kernel_init_freeable+0x354/0x450 [ 1.737707] ? rest_init+0xd0/0xd0 [ 1.737945] kernel_init+0x16/0x130 [ 1.738196] ret_from_fork+0x1f/0x30
Quoted 4 lines
Quoted 4 lines
QEMU command line:
"qemu-system-x86_64 -append root=/dev/vda rootfstype=ext4 ..."This error is because ext4 is not buildin and request ext4 module fail.
Cool! I'm glad this got picked up; I personally find it confusing when trying to start from something like an allnoconfig build then start enabling configs then hitting this panic; it's unclear to users that they are missing the config for the FS they are trying to load and on first glance looks like something much worse is going wrong. In that sense, I view this as a win. Thanks for the patch!
I wish the commit message showed an example of the panic after the patch, to contrast the before vs. after.
Quoted 75 lines
Quoted 3 lines
As a hint, printk all the bdev fstype available for prompts.
Seems reasonable. I reworded the changelog a bit:
: Booting with the QEMU command line:
: "qemu-system-x86_64 -append root=/dev/vda rootfstype=ext4 ..." : will panic if ext4 is not builtin and a request to load the ext4 module : fails.
:: [ 1.729006] VFS: Cannot open root device "vda" or unknown-block(253,0): error -19 : [ 1.730603] Please append a correct "root=" boot option; here are the available partitions: : [ 1.732323] fd00 256000 vda : [ 1.732329] driver: virtio_blk : [ 1.734194] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(253,0) : [ 1.734771] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 6.4.0-rc2+ #53 : [ 1.735194] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.10.2-1ubuntu1 04/01/2014 : [ 1.735772] Call Trace: : [ 1.735950] <TASK> : [ 1.736113] dump_stack_lvl+0x32/0x50 : [ 1.736367] panic+0x108/0x310 : [ 1.736570] mount_block_root+0x161/0x310 : [ 1.736849] ? rdinit_setup+0x40/0x40 : [ 1.737088] prepare_namespace+0x10c/0x180 : [ 1.737393] kernel_init_freeable+0x354/0x450 : [ 1.737707] ? rest_init+0xd0/0xd0 : [ 1.737945] kernel_init+0x16/0x130 : [ 1.738196] ret_from_fork+0x1f/0x30:
: As a hint, print all the bdev fstypes which are available.Quoted 13 lines
init/do_mounts.c +5
-1@@ -427,8 +427,19 @@ void __init mount_block_root(char *name, int flags)printk ("VFS: Cannot open root device \"%s\" or %s: error %d\n" , root_device_name, b, err);printk ("Please append a correct \"root=\" boot option; here are the available partitions:\n" ); -printk_all_partitions (); + +if (root_fs_names) + num_fs =list_bdev_fs_names (fs_names,PAGE_SIZE ); +if (!num_fs) +pr_err ("Can't find any bdev filesystem to be used for mount!\n" );init/do_mounts.c void __init mount_block_root(char *name, int flags) · line 445
Quoted 10 lines
init/do_mounts.c +7
-0+else { +pr_err ("List of all bdev filesystem:\n" ); +for (i =0 , p = fs_names; i < num_fs; i++, p +=strlen (p)+1 ) +pr_err (" %s" , p); +pr_err ("\n" ); + } +panic ("VFS: Unable to mount root fs on %s" , b); }if (!(flags &SB_RDONLY )) {And I added a little fix.
init/do_mounts.c renamed from init/do_mounts.c~init-add-bdev-fs-printk-if-mount_block_root-failed-fix +1
-1@@ -434,7 +434,7 @@ retry:if (!num_fs)pr_err ("Can't find any bdev filesystem to be used for mount!\n" );else { -pr_err ("List of all bdev filesystem:\n" ); +pr_err ("List of all bdev filesystems:\n" );for (i =0 , p = fs_names; i < num_fs; i++, p +=strlen (p)+1 )pr_err (" %s" , p);pr_err ("\n" );_
This function now uses a jumble of
printk()andpr_err(). Perhaps someone will go through and rationalize all of this sometime.
Signature · 2 lines
Thanks, ~Nick Desaulniers
Quoted 46 lines
-----Original Message-----
From: Nick Desaulniers <[email protected]>
Sent: Friday, May 19, 2023 4:36 AM
To: Andrew Morton <[email protected]>; Angus Chen <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Al Viro <[email protected]>
Subject: Re: [PATCH] init: Add bdev fs printk ifmount_block_rootfailedQuoted 2 lines · Andrew Morton
On Thu, 18 May 2023 11:53:21 +0800 Angus Chen
Quoted 4 lines · <[email protected]> wrote:
Quoted 4 lines
Attempt to printk all bdev fstype as root gives the following kernel panic:
[ 1.729006] VFS: Cannot open root device "vda" orunknown-block(253,0): error -19
Quoted 1 line
Quoted 1 line
[ 1.730603] Please append a correct "root=" boot option; here are theavailable partitions:
Quoted 3 lines
Quoted 3 lines
[ 1.732323] fd00 256000 vda [ 1.732329] driver: virtio_blk [ 1.734194] Kernel panic - not syncing: VFS: Unable to mount root fs onunknown-block(253,0)
Quoted 2 lines
Quoted 2 lines
[ 1.734771] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 6.4.0-rc2+ #53 [ 1.735194] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009),BIOS 1.10.2-1ubuntu1 04/01/2014
Quoted 15 lines
Quoted 15 lines
[ 1.735772] Call Trace: [ 1.735950] <TASK> [ 1.736113] dump_stack_lvl+0x32/0x50 [ 1.736367] panic+0x108/0x310 [ 1.736570] mount_block_root+0x161/0x310 [ 1.736849] ? rdinit_setup+0x40/0x40 [ 1.737088] prepare_namespace+0x10c/0x180 [ 1.737393] kernel_init_freeable+0x354/0x450 [ 1.737707] ? rest_init+0xd0/0xd0 [ 1.737945] kernel_init+0x16/0x130 [ 1.738196] ret_from_fork+0x1f/0x30QEMU command line:
"qemu-system-x86_64 -append root=/dev/vda rootfstype=ext4 ..."
Quoted 8 lines
Quoted 1 line
Quoted 1 line
This error is because ext4 is not buildin and request ext4 module fail.
Cool! I'm glad this got picked up; I personally find it confusing when trying to start from something like an allnoconfig build then start enabling configs then hitting this panic; it's unclear to users that they are missing the config for the FS they are trying to load and on first glance looks like something much worse is going wrong. In that sense, I view this as a win. Thanks for the patch!
Thank you, you are welcome.
Quoted 5 lines
Acked-by Nick Desaulniers <[email protected]>I wish the commit message showed an example of the panic after the patch, to contrast the before vs. after.
en ,Did a need to send a v2 or just let it go this time? The information is print:
[ 1.570841] VFS: Cannot open root device "vda" or unknown-block(253,0): error -19 [ 1.571513] Please append a correct "root=" boot option; here are the available partitions: [ 1.572056] fd00 256000 vda [ 1.572058] driver: virtio_blk [ 1.572525] List of all bdev filesystem: [ 1.572780] ext2 [ 1.572781] [ 1.573027] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(253,0)
Or:
[ 1.510467] VFS: Cannot open root device "vda" or unknown-block(253,0): error -19 [ 1.512033] Please append a correct "root=" boot option; here are the available partitions: [ 1.513724] fd00 256000 vda [ 1.513731] driver: virtio_blk [ 1.514280] Can't find any bdev filesystem! [ 1.514540] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(253,0)
Quoted 93 lines
Quoted 5 lines
Quoted 4 lines
As a hint, printk all the bdev fstype available for prompts.
Quoted 8 lines
Seems reasonable. I reworded the changelog a bit:
: Booting with the QEMU command line:
: "qemu-system-x86_64 -append root=/dev/vda rootfstype=ext4 ..." : will panic if ext4 is not builtin and a request to load the ext4 module : fails.
:
: [ 1.729006] VFS: Cannot open root device "vda" or unknown-block(253,0):error -19
Quoted 1 line
: [ 1.730603] Please append a correct "root=" boot option; here are the
available partitions:
Quoted 3 lines
: [ 1.732323] fd00 256000 vda : [ 1.732329] driver: virtio_blk : [ 1.734194] Kernel panic - not syncing: VFS: Unable to mount root fs onunknown-block(253,0)
Quoted 2 lines
: [ 1.734771] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 6.4.0-rc2+ #53
: [ 1.735194] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009),BIOS 1.10.2-1ubuntu1 04/01/2014
Quoted 11 lines
: [ 1.735772] Call Trace: : [ 1.735950] <TASK> : [ 1.736113] dump_stack_lvl+0x32/0x50 : [ 1.736367] panic+0x108/0x310 : [ 1.736570] mount_block_root+0x161/0x310 : [ 1.736849] ? rdinit_setup+0x40/0x40 : [ 1.737088] prepare_namespace+0x10c/0x180 : [ 1.737393] kernel_init_freeable+0x354/0x450 : [ 1.737707] ? rest_init+0xd0/0xd0 : [ 1.737945] kernel_init+0x16/0x130 : [ 1.738196] ret_from_fork+0x1f/0x30Quoted 6 lines
:
: As a hint, print all the bdev fstypes which are available.init/do_mounts.c void __init mount_block_root(char *name, int
Quoted 3 lines
init/do_mounts.c +0
-0@@ -427,8 +427,19 @@ void __init mount_block_root(char *name, intflags)
Quoted 1 line
init/do_mounts.c void __init mount_block_root(char *name, int · line 427
Quoted 1 line
init/do_mounts.c +0
-0printk("VFS: Cannot open root device \"%s\" or %s:error %d\n",
Quoted 2 lines
init/do_mounts.c void __init mount_block_root(char *name, int · line 429
Quoted 2 lines
init/do_mounts.c +0
-0root_device_name, b, err); printk("Please append a correct \"root=\" boot option;here are the available partitions:\n");
Quoted 5 lines
init/do_mounts.c void __init mount_block_root(char *name, int · line 433
Quoted 5 lines
init/do_mounts.c +3
-1-printk_all_partitions (); + +if (root_fs_names) + num_fs = list_bdev_fs_names(fs_names,
PAGE_SIZE);Quoted 2 lines
init/do_mounts.c void __init mount_block_root(char *name, int · line 435
Quoted 2 lines
init/do_mounts.c +2
-0+if (!num_fs) + pr_err("Can't find any bdev filesystem to be usedfor mount!\n");
Quoted 3 lines
init/do_mounts.c void __init mount_block_root(char *name, int · line 438
Quoted 3 lines
init/do_mounts.c +3
-0+ else { + pr_err("List of all bdev filesystem:\n"); + for (i = 0, p = fs_names; i < num_fs; i++, p +=strlen(p)+1)
Quoted 13 lines
init/do_mounts.c void __init mount_block_root(char *name, int · line 445
Quoted 7 lines
init/do_mounts.c +4
-0+pr_err (" %s" , p); +pr_err ("\n" ); + } +panic ("VFS: Unable to mount root fs on %s" , b); }if (!(flags &SB_RDONLY )) {And I added a little fix.
init/do_mounts.c retry: · line 435
Quoted 2 lines
init/do_mounts.c renamed from init/do_mounts.c~init-add-bdev-fs-printk-if-mount_block_root-failed-fix +0
-0@@ -434,7 +434,7 @@ retry:if (!num_fs) pr_err("Can't find any bdev filesystem to beused for mount!\n");
init/do_mounts.c retry:
Quoted 4 lines
init/do_mounts.c renamed from init/do_mounts.c~init-add-bdev-fs-printk-if-mount_block_root-failed-fix +1
-1else { - pr_err("List of all bdev filesystem:\n"); + pr_err("List of all bdev filesystems:\n"); for (i = 0, p = fs_names; i < num_fs; i++, p +=strlen(p)+1)
Quoted 8 lines
init/do_mounts.c renamed from init/do_mounts.c~init-add-bdev-fs-printk-if-mount_block_root-failed-fix +0
-0pr_err (" %s" , p);pr_err ("\n" );_
This function now uses a jumble of
printk()andpr_err(). Perhaps someone will go through and rationalize all of this sometime.--
Thanks,
~Nick Desaulniers
Quoted 13 lines · Angus Chen
Quoted 13 lines
-----Original Message-----
From: Nick Desaulniers <[email protected]>
Sent: Friday, May 19, 2023 4:36 AM
To: Andrew Morton <[email protected]>; Angus Chen <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Al Viro <[email protected]>
Subject: Re: [PATCH] init: Add bdev fs printk ifmount_block_rootfailed
Quoted 3 lines
Quoted 2 lines
I wish the commit message showed an example of the panic after the patch, to contrast the before vs. after.
en ,Did a need to send a v2 or just let it go this time?
Nah, it's fine. LGTM
Quoted 17 lines
The information is print:
[ 1.570841] VFS: Cannot open root device "vda" or unknown-block(253,0): error -19 [ 1.571513] Please append a correct "root=" boot option; here are the available partitions: [ 1.572056] fd00 256000 vda [ 1.572058] driver: virtio_blk [ 1.572525] List of all bdev filesystem: [ 1.572780] ext2 [ 1.572781] [ 1.573027] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(253,0)Or:
[ 1.510467] VFS: Cannot open root device "vda" or unknown-block(253,0): error -19 [ 1.512033] Please append a correct "root=" boot option; here are the available partitions: [ 1.513724] fd00 256000 vda [ 1.513731] driver: virtio_blk [ 1.514280] Can't find any bdev filesystem! [ 1.514540] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(253,0)
Signature · 2 lines
Thanks, ~Nick Desaulniers
Quoted 76 lines
-----Original Message-----
From: Andrew Morton <[email protected]>
Sent: Friday, May 19, 2023 4:02 AM
To: Angus Chen <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Al Viro <[email protected]>
Subject: Re: [PATCH] init: Add bdev fs printk ifmount_block_rootfailedQuoted 3 lines · On Thu, 18 May 2023 11:53:21 +0800 Angus Chen <[email protected]>…
Attempt to printk all bdev fstype as root gives the following kernel panic:
[ 1.729006] VFS: Cannot open root device "vda" or unknown-block(253,0):error -19
Quoted 1 line
[ 1.730603] Please append a correct "root=" boot option; here are theavailable partitions:
Quoted 3 lines
[ 1.732323] fd00 256000 vda [ 1.732329] driver: virtio_blk [ 1.734194] Kernel panic - not syncing: VFS: Unable to mount root fs onunknown-block(253,0)
Quoted 2 lines
[ 1.734771] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 6.4.0-rc2+ #53 [ 1.735194] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009),BIOS 1.10.2-1ubuntu1 04/01/2014
Quoted 12 lines
[ 1.735772] Call Trace: [ 1.735950] <TASK> [ 1.736113] dump_stack_lvl+0x32/0x50 [ 1.736367] panic+0x108/0x310 [ 1.736570] mount_block_root+0x161/0x310 [ 1.736849] ? rdinit_setup+0x40/0x40 [ 1.737088] prepare_namespace+0x10c/0x180 [ 1.737393] kernel_init_freeable+0x354/0x450 [ 1.737707] ? rest_init+0xd0/0xd0 [ 1.737945] kernel_init+0x16/0x130 [ 1.738196] ret_from_fork+0x1f/0x30Quoted 7 lines
QEMU command line:
"qemu-system-x86_64 -append root=/dev/vda rootfstype=ext4 ..."This error is because ext4 is not buildin and request ext4 module fail.
As a hint, printk all the bdev fstype available for prompts.
Seems reasonable. I reworded the changelog a bit:
: Booting with the QEMU command line:
: "qemu-system-x86_64 -append root=/dev/vda rootfstype=ext4 ..." : will panic if ext4 is not builtin and a request to load the ext4 module : fails.
:
: [ 1.729006] VFS: Cannot open root device "vda" or unknown-block(253,0):
error -19
: [ 1.730603] Please append a correct "root=" boot option; here are the
available partitions:: [ 1.732323] fd00 256000 vda : [ 1.732329] driver: virtio_blk : [ 1.734194] Kernel panic - not syncing: VFS: Unable to mount root fs onunknown-block(253,0)
: [ 1.734771] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 6.4.0-rc2+ #53
: [ 1.735194] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS
1.10.2-1ubuntu1 04/01/2014: [ 1.735772] Call Trace: : [ 1.735950] <TASK> : [ 1.736113] dump_stack_lvl+0x32/0x50 : [ 1.736367] panic+0x108/0x310 : [ 1.736570] mount_block_root+0x161/0x310 : [ 1.736849] ? rdinit_setup+0x40/0x40 : [ 1.737088] prepare_namespace+0x10c/0x180 : [ 1.737393] kernel_init_freeable+0x354/0x450 : [ 1.737707] ? rest_init+0xd0/0xd0 : [ 1.737945] kernel_init+0x16/0x130 : [ 1.738196] ret_from_fork+0x1f/0x30
Quoted 2 lines
:
: As a hint, print all the bdev fstypes which are available.
Thank you for your reply. more readable now.
Quoted 42 lines
init/do_mounts.c void __init mount_block_root(char *name, int flags) · line 429
Quoted 7 lines
init/do_mounts.c +0
-0@@ -427,8 +427,19 @@ void __init mount_block_root(char *name, int flags)printk ("VFS: Cannot open root device \"%s\" or %s: error %d\n" , root_device_name, b, err); printk("Please append a correct \"root=\" boot option; here are theavailable partitions:\n");
Quoted 7 lines
init/do_mounts.c +5
-1-printk_all_partitions (); + +if (root_fs_names) + num_fs =list_bdev_fs_names (fs_names,PAGE_SIZE ); +if (!num_fs) +pr_err ("Can't find any bdev filesystem to be used for mount!\n" );init/do_mounts.c void __init mount_block_root(char *name, int flags) · line 445
Quoted 10 lines
init/do_mounts.c +7
-0+else { +pr_err ("List of all bdev filesystem:\n" ); +for (i =0 , p = fs_names; i < num_fs; i++, p +=strlen (p)+1 ) +pr_err (" %s" , p); +pr_err ("\n" ); + } +panic ("VFS: Unable to mount root fs on %s" , b); }if (!(flags &SB_RDONLY )) {And I added a little fix.
init/do_mounts.c renamed from init/do_mounts.c~init-add-bdev-fs-printk-if-mount_block_root-failed-fix +1
-1@@ -434,7 +434,7 @@ retry:if (!num_fs)pr_err ("Can't find any bdev filesystem to be used for mount!\n" );else { -pr_err ("List of all bdev filesystem:\n" ); +pr_err ("List of all bdev filesystems:\n" );for (i =0 , p = fs_names; i < num_fs; i++, p +=strlen (p)+1 )pr_err (" %s" , p);pr_err ("\n" );_
Quoted 2 lines
This function now uses a jumble of
printk()andpr_err(). Perhaps someone will go through and rationalize all of this sometime.
Yes, I took the printk first but got a warning from checkpatch.pl. Thanks.