QEMU-system-ppc64 ram disk give error as RAMDISK: incomplete write (22321 != 32768)

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

QEMU-system-ppc64 ram disk give error as RAMDISK: incomplete write (22321 != 32768)

5,632 Views
abhinavbipnesh
Contributor I

Hi,

While trying to start the QEMU emulation using qemu-system-ppc64 I am getting error as below from the boot log

. . . .

Trying to unpack rootfs image as initramfs...

rootfs image is not initramfs (no cpio magic); looks like an initrd

Freeing initrd memory: 81324K (c3000000 - c7f6b000)

audit: initializing netlink socket (disabled)

type=2000 audit(0.592:1): initialized

HugeTLB registered 1 MB page size, pre-allocated 0 pages

HugeTLB registered 4 MB page size, pre-allocated 0 pages

HugeTLB registered 16 MB page size, pre-allocated 0 pages

HugeTLB registered 64 MB page size, pre-allocated 0 pages

HugeTLB registered 256 MB page size, pre-allocated 0 pages

HugeTLB registered 1 GB page size, pre-allocated 0 pages

. . .

RAMDISK: gzip image found at block 0

RAMDISK: incomplete write (22321 != 32768)

write error

VFS: Mounted root (ext2 filesystem) on device 1:0.

devtmpfs: mounted

Freeing unused kernel memory: 288K (c08a4000 - c08ec000)

attempt to access beyond end of device

ram0: rw=0, want=454704, limit=262144

Buffer I/O error on device ram0, logical block 227351

attempt to access beyond end of device

ram0: rw=0, want=455366, limit=262144

Buffer I/O error on device ram0, logical block 227682

attempt to access beyond end of device

ram0: rw=0, want=463142, limit=262144

Buffer I/O error on device ram0, logical block 231570

attempt to access beyond end of device

ram0: rw=0, want=454704, limit=262144

Buffer I/O error on device ram0, logical block 227351

attempt to access beyond end of device

ram0: rw=0, want=455366, limit=262144

Buffer I/O error on device ram0, logical block 227682

attempt to access beyond end of device

ram0: rw=0, want=463142, limit=262144

Buffer I/O error on device ram0, logical block 231570

attempt to access beyond end of device

ram0: rw=0, want=418868, limit=262144

Buffer I/O error on device ram0, logical block 209433

attempt to access beyond end of device

ram0: rw=0, want=424160, limit=262144

Buffer I/O error on device ram0, logical block 212079

attempt to access beyond end of device

ram0: rw=0, want=427966, limit=262144

Buffer I/O error on device ram0, logical block 213982

attempt to access beyond end of device

ram0: rw=0, want=418868, limit=262144

Buffer I/O error on device ram0, logical block 209433

attempt to access beyond end of device

ram0: rw=0, want=424160, limit=262144

attempt to access beyond end of device

ram0: rw=0, want=427966, limit=262144

attempt to access beyond end of device

ram0: rw=0, want=418868, limit=262144

attempt to access beyond end of device

ram0: rw=0, want=424160, limit=262144

attempt to access beyond end of device

ram0: rw=0, want=427966, limit=262144

Kernel panic - not syncing: No init found.  Try passing init= option to kernel. See Linux Documentation/init.txt for guidance.

CPU: 0 PID: 1 Comm: swapper/0 Not tainted 3.12.19-rt30-QorIQ-SDK-V1.6+gc29fe1a #2

Call Trace:

[ce033e80] [c0007190] show_stack+0x40/0x150 (unreliable)

[ce033ec0] [c06cc978] dump_stack+0x78/0xa0

[ce033ed0] [c06cacb8] panic+0xd8/0x1fc

[ce033f20] [c0002b9c] kernel_init+0x16c/0x170

[ce033f40] [c000ff20] ret_from_kernel_thread+0x5c/0x64

Rebooting in 180 seconds..Connection closed by foreign host.

The command which I fired for bring up the machine is given below

sudo ~/QorIQ-SDK-V1.6-20140619-yocto/build_t1040rdb_release/tmp/sysroots/x86_64-linux/usr/bin/qemu-system-ppc64 -kernel uImage  -net nic,model=e1000 -net tap,ifname=tap0,script=no,downscript=no -cpu e5500 -M ppce500 -initrd fsl-image-virt-t1040rdb-20150105132202.rootfs.ext2.gz -no-reboot -show-cursor -no-reboot -m 256 --append "root=/dev/ram rw console=ttyS0,115200 ip=192.168.7.2::192.168.7.1:255.255.255.0 mem=256M " -serial tcp::4444,server,telnet -drive file=mydisk,cache=none,if=virtio -nographic

Now when we try to pass -hda option for below command

sudo ~/QorIQ-SDK-V1.6-20140619-yocto/build_t1040rdb_release/tmp/sysroots/x86_64-linux/usr/bin/qemu-system-ppc64 -kernel uImage  -net nic,model=e1000 -net tap,ifname=tap0,script=no,downscript=no -cpu e5500 -M ppce500 -hda fsl-image-virt-t1040rdb-20150105132202.rootfs.ext2.gz -no-reboot -show-cursor -no-reboot -m 256 --append "root=/dev/hda rw console=ttyS0,115200 ip=192.168.7.2::192.168.7.1:255.255.255.0 mem=256M " -serial tcp::4444,server,telnet -drive file=mydisk,cache=none,if=virtio -nographic

The error being reported is given below

VFS: Cannot open root device "hda" or unknown-block(0,0): error -6

Please append a correct "root=" boot option; here are the available partitions:

fe00         1048576 vda  driver: virtio_blk

  fe01         1047552 vda1 0f1cd4fc-01

Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)

CPU: 0 PID: 1 Comm: swapper/0 Not tainted 3.12.19-rt30-QorIQ-SDK-V1.6+gc29fe1a #2

Call Trace:

[ce03bda0] [c0007190] show_stack+0x40/0x150 (unreliable)

[ce03bde0] [c06cc978] dump_stack+0x78/0xa0

[ce03bdf0] [c06cacb8] panic+0xd8/0x1fc

[ce03be40] [c08a4ce4] mount_block_root+0x1b0/0x248

[ce03bea0] [c08a4fb0] mount_root+0xfc/0x110

[ce03bed0] [c08a514c] prepare_namespace+0x188/0x1d0

[ce03bef0] [c08a4958] kernel_init_freeable+0x1bc/0x1d0

[ce03bf20] [c0002a48] kernel_init+0x18/0x170

[ce03bf40] [c000ff20] ret_from_kernel_thread+0x5c/0x64

Rebooting in 180 seconds..Connection closed by foreign host.

So any thoughts how to make system boot using a -hda and not using -initrd as we want to have IMAGE_ROOT_FS=1G so that we can have some space for working with application and other dependent library.

Please let me know if you need more information.

Thanks,

Abhinav

Tags (2)
0 Kudos
6 Replies

3,011 Views
yipingwang
NXP TechSupport
NXP TechSupport

Hello Abhinav Bipnesh,

For ramdisk boot, please specify "ramdisk_size=700000" in bootargs, and check whether using "fsl-image-minimal-t1040rdb.ext2.gz.u-boot" would be better.

For harddisk boot, please specify the exact harddisk block, for example --append "root=/dev/sda1 rw console=ttyS0,115200", please try whether it could work without specifying -hda.


Thanks,

Yiping

0 Kudos

3,011 Views
abhinavbipnesh
Contributor I

Hi Yiping,

I have tried as suggested below are the output of the same

sudo ~/QorIQ-SDK-V1.6-20140619-yocto/build_t1040rdb_release/tmp/sysroots/x86_64-linux/usr/bin/qemu-system-ppc64 -kernel uImage  -net nic,model=e1000 -net tap,ifname=tap0,script=no,downscript=no -cpu e5500 -M ppce500  fsl-image-core-t1040rdb-20150106083454.rootfs.ext2.gz -no-reboot -show-cursor -no-reboot -m 384 --append "root=/dev/sda1 console=ttyS0 console=tty ip=192.168.7.2::192.168.7.1:255.255.255.0 mem=256M " -nographic -serial tcp::4444,server,telnet

Boot output:

VFS: Cannot open root device "sda1" or unknown-block(0,0): error -6

Please append a correct "root=" boot option; here are the available partitions:

Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)

CPU: 0 PID: 1 Comm: swapper/0 Not tainted 3.12.19-rt30-QorIQ-SDK-V1.6+gc29fe1a #1

Using ramdisk_size option:

sudo ~/QorIQ-SDK-V1.6-20140619-yocto/build_t1040rdb_release/tmp/sysroots/x86_64-linux/usr/bin/qemu-system-ppc64 -kernel uImage  -net nic,model=e1000 -net tap,ifname=tap0,script=no,downscript=no -cpu e5500 -M ppce500 fsl-image-core-t1040rdb-20150106083454.rootfs.ext2.gz.u-boot -no-reboot -show-cursor -no-reboot -m 384 --append "root=/dev/ram console=ttyS0 console=tty ip=192.168.7.2::192.168.7.1:255.255.255.0 mem=256M ramdisk_size=700000" -nographic -serial tcp::4444,server,telnet

Boot output:

List of all partitions:

No filesystem could mount root, tried:  ext3 ext2 cramfs vfat ntfs

Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(1,0)

CPU: 0 PID: 1 Comm: swapper/0 Not tainted 3.12.19-rt30-QorIQ-SDK-V1.6+gc29fe1a #1


So it seems the root file system are not properly created as it didn't identify sda1 or hda etc as I have tried such option. I have used below command for building up the things

$bitbake fsl-image-core

and below are the local.conf contains extra configuration

IMAGE_INSTALL_append += "boost-dev util-linux curl"

CORE_IMAGE_EXTRA_INSTALL += "boost-dev"

CORE_IMAGE_EXTRA_INSTALL += "util-linux"

CORE_IMAGE_EXTRA_INSTALL += "curl"

TOOLCHAIN_TARGET_TASK += "boost-dev"

TOOLCHAIN_TARGET_TASK += "util-linux"

TOOLCHAIN_TARGET_TASK += "curl"

IMAGE_INSTALL_append = " qemu"

IMAGE_FSTYPES += "ext2 ext3"

Please let me know if you need more information.

Thanks,

Abhinav

0 Kudos

3,011 Views
abhinavbipnesh
Contributor I

Also when I tried as below

sudo ~/QorIQ-SDK-V1.6-20140619-yocto/build_t1040rdb_release/tmp/sysroots/x86_64-linux/usr/bin/qemu-system-ppc64 -kernel uImage  -net nic,model=e1000 -net tap,ifname=tap0,script=no,downscript=no -cpu e5500 -M ppce500 -initrd fsl-image-core-t1040rdb.ext2.gz -no-reboot -show-cursor -no-reboot -m 384 --append "root=/dev/ram console=ttyS0 console=tty ip=192.168.7.2::192.168.7.1:255.255.255.0 mem=256M ramdisk_size=700000" -nographic -serial tcp::4444,server,telnet QEMU 1.7.0 monitor - type 'help' for more information

Boot output for the same is given below

RAMDISK: gzip image found at block 0

swapper/0 invoked oom-killer: gfp_mask=0x10200d0, order=0, oom_score_adj=0

CPU: 0 PID: 1 Comm: swapper/0 Not tainted 3.12.19-rt30-QorIQ-SDK-V1.6+gc29fe1a #1

Call Trace:

[ce033a60] [c0006f50] show_stack+0x40/0x150 (unreliable)

[ce033aa0] [c0694d2c] dump_stack+0x78/0xa0

[ce033ab0] [c0693a3c] dump_header.isra.11+0x54/0x160

[ce033af0] [c00b3d80] out_of_memory+0x290/0x2a0

[ce033b30] [c00b80a8] __alloc_pages_nodemask+0x6c8/0x720

[ce033be0] [c00b0be4] grab_cache_page_write_begin+0x74/0xe0

[ce033c10] [c012b9cc] block_write_begin+0x3c/0xa0

[ce033c30] [c00b0574] generic_file_buffered_write+0x194/0x270

[ce033cb0] [c00b2050] __generic_file_aio_write+0x1d0/0x480

[ce033d10] [c01315a0] blkdev_aio_write+0x70/0xc0

[ce033d50] [c00f6e50] do_sync_write+0x70/0xd0

[ce033db0] [c00f77c8] vfs_write+0xc8/0x1e0

[ce033dd0] [c00f7ecc] SyS_write+0x4c/0xc0

[ce033e00] [c0862380] compr_flush+0x30/0x78

[ce033e10] [c0879124] gunzip+0x2b4/0x36c

[ce033e50] [c08626e8] rd_load_image+0x320/0x5e8

[ce033ea0] [c0862ac8] initrd_load+0x50/0x2dc

[ce033ed0] [c08620a4] prepare_namespace+0xe0/0x1d0

[ce033ef0] [c0861958] kernel_init_freeable+0x1bc/0x1d0

[ce033f20] [c0002808] kernel_init+0x18/0x170

[ce033f40] [c000fce0] ret_from_kernel_thread+0x5c/0x64

Mem-Info:

DMA per-cpu:

CPU    0: hi:   42, btch: 7 usd:   6

active_anon:0 inactive_anon:0 isolated_anon:0

active_file:0 inactive_file:0 isolated_file:0

unevictable:11906 dirty:7 writeback:0 unstable:0

free:494 slab_reclaimable:205 slab_unreclaimable:436

mapped:0 shmem:0 pagetables:0 bounce:0

free_cma:0

DMA free:1976kB min:2000kB low:2500kB high:3000kB active_anon:0kB inactive_anon:0kB active_file:0kB inactive_file:0kB unevictable:47624kB isolated(anon):0kB isolated(file):0kB present:262144kB managed:250064kB mlocked:0kB dirty:28kB writeback:0kB mapped:0kB shmem:0kB slab_reclaimable:820kB slab_unreclaimable:1744kB kernel_stack:224kB pagetables:0kB unstable:0kB bounce:0kB free_cma:0kB writeback_tmp:0kB pages_scanned:0 all_unreclaimable? yes

lowmem_reserve[]: 0 0 0 0

DMA: 0*4kB 1*8kB (R) 1*16kB (R) 1*32kB (R) 0*64kB 1*128kB (R) 1*256kB (R) 1*512kB (R) 1*1024kB (R) 0*2048kB 0*4096kB 0*8192kB 0*16384kB = 1976kB

Node 0 hugepages_total=0 hugepages_free=0 hugepages_surp=0 hugepages_size=1024kB

Node 0 hugepages_total=0 hugepages_free=0 hugepages_surp=0 hugepages_size=4096kB

Node 0 hugepages_total=0 hugepages_free=0 hugepages_surp=0 hugepages_size=16384kB

Node 0 hugepages_total=0 hugepages_free=0 hugepages_surp=0 hugepages_size=65536kB

Node 0 hugepages_total=0 hugepages_free=0 hugepages_surp=0 hugepages_size=262144kB

Node 0 hugepages_total=0 hugepages_free=0 hugepages_surp=0 hugepages_size=1048576kB

11915 total pagecache pages

0 pages in swap cache

Swap cache stats: add 0, delete 0, find 0/0

Free swap  = 0kB

Total swap = 0kB

65536 pages RAM

0 pages HighMem/MovableOnly

3020 pages reserved

[ pid ]   uid  tgid total_vm      rss nr_ptes swapents oom_score_adj name

Kernel panic - not syncing: Out of memory and no killable processes...

I have tried even with ramdisk_size= 307200 but similar output we get at boot time. I am looking for an option through which I can make QEMU to use hard drive as boot device and not RAMFS as the application we want to test will require storage and it should not go into RAM as it will bloat at sometime.

Please let me know if you need more information.

Thanks,

Abhinav

0 Kudos

3,011 Views
scottwood
NXP Employee
NXP Employee

You need to give the VM enough memory to comfortably fit the ramdisk.  Why are you giving the VM 384 MiB and then telling guest Linux to only use 256?

As for /dev/sda1, you need to tell QEMU to create that device and what to back it up with.  I recommend using a virtio block device instead: "-drive file=<image>,index=0,if=virtio" with guest Linux seeing /dev/vdaN.  Make sure virtio PCI and virtio block are enabled in the guest kernel.

0 Kudos

3,011 Views
abhinavbipnesh
Contributor I

Finally I am able to boot through NFS and skipped booting using ramfs.

Thanks for providing inputs.

0 Kudos

3,011 Views
abhinavbipnesh
Contributor I

Along with that I was trying to do a NFS boot for the same but getting below error, seems I am messing up with options. The steps follow to make NFS stuff is given below

  1. tar -C "/home/<username>/rootfs/" --numeric-owner -xzf "fsl-image-core-t1040rdb-20150106174259.rootfs.tar.gz"
  2. Started NFS server and did a configuration in exportfs /home/<username>/rootfs   192.168.7.100(rw,sync) (Directory has 755 mode)
  3. Fire below command for QEMU

     sudo ~/QorIQ-SDK-V1.6-20140619-yocto/build_t1040rdb_release/tmp/sysroots/x86_64-linux/usr/bin/qemu-system-ppc64 -kernel uImage  -net nic,model=e1000 -net tap,ifname=tap0,script=no,downscript=no -cpu e5500 -M ppce500  -no-reboot -show-cursor -no-reboot -m 384 --append "root=/dev/nfs rw nfsroot=192.168.7.100:/home/vmprodev/rootfs,nfsvers=3 rw console=ttyS0 console=tty ip=192.168.7.2::192.168.7.1:255.255.255.0 mem=256M" -nographic -serial tcp::4444,server,telnet

     Boot log error

I

IP-Config: Complete:

     device=eth0, hwaddr=52:54:00:12:34:56, ipaddr=192.168.7.2, mask=255.255.255.0, gw=192.168.7.1

     host=192.168.7.2, domain=, nis-domain=(none)

     bootserver=255.255.255.255, rootserver=192.168.7.100, rootpath=

VFS: Mounted root (nfs filesystem) on device 0:19.

devtmpfs: mounted

Freeing unused kernel memory: 284K (c0861000 - c08a8000)

klogd[631]: unhandled signal 11 at 00000046 nip 0fedaaec lr 0ffed064 code 30001

So any thoughts where I am messing up with the things.

Thanks,

Abhinav

0 Kudos