|Subject:||RE: end Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(1, 0) while booting linux on qemu|
|Date:||Fri, 19 Feb 2021 19:28:10 +0900|
I figured out what was wrong in this case.
I found several lines above this error message, there was another error saying something like it doesn’t have ram block device.
So I checked the kernel configuration and found BLK_DEV_RAM was set to =n.
Using menucnofig, under device drivers -> block devices, I changed RAM block device support(CONFIG_BLK_DEV_RAM) to =y and added associated configs
(Default number of RAM disks (CONFIG_BLK_DEV_RAM_COUNT) to 1, and Default RAM disk size (kbytes) (CONFIG_BLK_DEV_SIZE) to 131072. (=128MB).
I had to set the size big because I made ‘myinitrd.img’ bigger than 64MB. (unnecesarrily).
After this change, I built the kernel and ran as before,
../build/aarch64-softmmu/qemu-system-aarch64 -M virt -cpu cortex-a72 -kernel ../../../LinuxDevDrv/linux-5.4.21/arch/arm64/boot/Image -initrd testinitrd/myinitrd.img --append "root=/dev/ram init=/init nokaslr" -m 2048M -nographic
And saw the right result. Hope this helps someone later.
[ 3.886104] uart-pl011 9000000.pl011: no DMA platform data
[ 3.904219] RAMDISK: ext2 filesystem found at block 0
[ 3.906344] RAMDISK: Loading 65536KiB [1 disk] into ram disk... /
[ 4.496400] /
[ 5.114023] /
[ 5.731097] /
[ 6.349303] /
[ 6.966083] /
[ 7.583881] /
[ 8.202495] /
[ 8.823923] done.
[ 11.530393] EXT4-fs (ram0): mounting ext3 file system using the ext4 subsystem
[ 11.629543] EXT4-fs (ram0): mounted filesystem with ordered data mode. Opts: (null)
[ 11.631033] VFS: Mounted root (ext3 filesystem) readonly on device 1:0.
[ 11.651897] devtmpfs: mounted
[ 11.759683] Freeing unused kernel memory: 5120K
[ 11.768919] Run /init as init process
|[Prev in Thread]||Current Thread||[Next in Thread]|