0

I am trying to build a minimalistic kernel and initrd image which I want to use with qemu.

I am packing initrd image using cpio by,

find . | cpio -oHnewc | gzip > ../initrd.img

The kernel loads and mounts RAM disk image fine provided I don't keep anything in /lib/modules. The moment I keep the kernel modules in there the RAM disk image doesn't get mounted and fails with following error,

I1114 14:44:07.171914   30333 proxy.go:135] vmconsole: [    0.231680] RAMDISK: Couldn't find valid RAM disk image starting at 0.
I1114 14:44:07.172070   30333 proxy.go:135] vmconsole: [    0.231853] List of all partitions:
I1114 14:44:07.172100   30333 proxy.go:135] vmconsole: [    0.231877] 0100           65536 ram0  (driver?)
I1114 14:44:07.172131   30333 proxy.go:135] vmconsole: [    0.231907] 0101           65536 ram1  (driver?)
I1114 14:44:07.172162   30333 proxy.go:135] vmconsole: [    0.231937] 0102           65536 ram2  (driver?)
I1114 14:44:07.172188   30333 proxy.go:135] vmconsole: [    0.231967] 0103           65536 ram3  (driver?)
I1114 14:44:07.172218   30333 proxy.go:135] vmconsole: [    0.231995] 0104           65536 ram4  (driver?)
I1114 14:44:07.172252   30333 proxy.go:135] vmconsole: [    0.232026] 0105           65536 ram5  (driver?)
I1114 14:44:07.172278   30333 proxy.go:135] vmconsole: [    0.232057] 0106           65536 ram6  (driver?)
I1114 14:44:07.172309   30333 proxy.go:135] vmconsole: [    0.232085] 0107           65536 ram7  (driver?)
I1114 14:44:07.172337   30333 proxy.go:135] vmconsole: [    0.232114] 0108           65536 ram8  (driver?)
I1114 14:44:07.172367   30333 proxy.go:135] vmconsole: [    0.232143] 0109           65536 ram9  (driver?)
I1114 14:44:07.172398   30333 proxy.go:135] vmconsole: [    0.232173] 010a           65536 ram10  (driver?)
I1114 14:44:07.172423   30333 proxy.go:135] vmconsole: [    0.232201] 010b           65536 ram11  (driver?)
I1114 14:44:07.172452   30333 proxy.go:135] vmconsole: [    0.232230] 010c           65536 ram12  (driver?)
I1114 14:44:07.172482   30333 proxy.go:135] vmconsole: [    0.232259] 010d           65536 ram13  (driver?)
I1114 14:44:07.172513   30333 proxy.go:135] vmconsole: [    0.232288] 010e           65536 ram14  (driver?)
I1114 14:44:07.172542   30333 proxy.go:135] vmconsole: [    0.232319] 010f           65536 ram15  (driver?)
I1114 14:44:07.172622   30333 proxy.go:135] vmconsole: [    0.232348] No filesystem could mount root, tried:  ext3 ext2 ext4 squashfs vfat fuseblk
I1114 14:44:07.172665   30333 proxy.go:135] vmconsole: [    0.232429] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(1,0)
I1114 14:44:07.172701   30333 proxy.go:135] vmconsole: [    0.232472] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.4.87 #8
I1114 14:44:07.172714   30333 proxy.go:135] vmconsole: [    0.232506] Call Trace:
I1114 14:44:07.172762   30333 proxy.go:135] vmconsole: [    0.232523] [c00000000e3e3ae0] [c000000000b8a89c] dump_stack+0xb0/0xf0 (unreliable)
I1114 14:44:07.172807   30333 proxy.go:135] vmconsole: [    0.232571] [c00000000e3e3b20] [c000000000b8841c] panic+0x100/0x2c0
I1114 14:44:07.172856   30333 proxy.go:135] vmconsole: [    0.232614] [c00000000e3e3bb0] [c000000000f54890] mount_block_root+0x338/0x33c
I1114 14:44:07.172907   30333 proxy.go:135] vmconsole: [    0.232664] [c00000000e3e3c70] [c000000000f54c94] prepare_namespace+0x1f4/0x254
I1114 14:44:07.172956   30333 proxy.go:135] vmconsole: [    0.232714] [c00000000e3e3cf0] [c000000000f542b8] kernel_init_freeable+0x334/0x37c
I1114 14:44:07.173002   30333 proxy.go:135] vmconsole: [    0.232765] [c00000000e3e3dc0] [c00000000000be0c] kernel_init+0x2c/0x160
I1114 14:44:07.173049   30333 proxy.go:135] vmconsole: [    0.232808] [c00000000e3e3e30] [c000000000009538] ret_from_kernel_thread+0x5c/0xa4
I1114 14:44:07.174582   30333 proxy.go:135] vmconsole: [    0.234339] ---[ end Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(1,0)

I am able to understand how by just adding the modules in initrd leads to this behaviour?

Harshal Patil
  • 626
  • 1
  • 5
  • 11
  • 1
    could you post the complete boot log. also what is the initrd bootarg passed to the kernel is there sufficient memory allocated to it. – Prabhakar Lad Nov 14 '17 at 20:19
  • *"I am packing initrd image using cpio by..."* -- That's not an image, but a compressed archive. Are you confusing a ramdisk with ramfs? – sawdust Nov 14 '17 at 20:59
  • I am allocating sufficient memory. initrd is about 90MB and kernel is about 170MB. The VM I am trying to launch using qemu, I am allocating 512MB. – Harshal Patil Nov 15 '17 at 06:49
  • I have pasted the complete boot log here, https://pastebin.com/qBcpRgtC – Harshal Patil Nov 15 '17 at 06:58

0 Answers0