This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Filesystem is corrupted when sharing files from host to the Virtual Platform

I am making tests within the FVP and used the below steps to copy files into the FVP

To "bake" files into the target filesystem the following steps need to be followed:

  1. Mount the filesystem image on a local host directory
  2. Edit the mounted filesystem to include the desired files
  3. Unmount it and boot the target as usual

When i create a new file or copy a folder into the filesystem. I get the following error. This error doesn't occur when the existing files are recompiled or changed.

Is there any solution to overcome this issue?

Parents
  • Hello Toshihisa,


    Thank you for your reply.
    I tried the sync command, and various other solutions to this problem and unable to fix this issue yet.

    Below you can find the steps I used to copy the files to the VP, that created this filesystem issue.

    1) Create a new image from the grub-buildroot.img using dd
    dd if=$PWD/buildroot_fvp_cca/output/rdfremont/grub-buildroot.img of=$PWD/buildroot_fvp_cca/output/rdfremont/grub-buildroot.img2 ibs=512 skip=43008 count=409600

    2) Mount using fuse-ext2
    fuse-ext2 $PWD/buildroot_fvp_cca/output/rdfremont/grub-buildroot.img2 $PWD/tmp/buildroot_mount -o rw+,uid=$UID

    3) copy new files c files to kvm unit tests and do cross compilation
    ./configure
    make all

    (Note that all the object files are generated again, which is not reflected properly within the VP)

    4)Unmount using fuermount
    fusermount -u tmp/buildroot_mount

    5) copy the filesystem back into grub-buildroot.img using dd
    dd if=$PWD/buildroot_fvp_cca/output/rdfremont/grub-buildroot.img2 of=$PWD/buildroot_fvp_cca/output/rdfremont/grub-buildroot.img bs=512 seek=43008 count=409600 conv=notrunc

    6)start the VP
    Then the ext4-fs problem shows up within the VP

    Any hint at the solution is greatly appreciated.

    Best Regards,
    Pooja

Reply
  • Hello Toshihisa,


    Thank you for your reply.
    I tried the sync command, and various other solutions to this problem and unable to fix this issue yet.

    Below you can find the steps I used to copy the files to the VP, that created this filesystem issue.

    1) Create a new image from the grub-buildroot.img using dd
    dd if=$PWD/buildroot_fvp_cca/output/rdfremont/grub-buildroot.img of=$PWD/buildroot_fvp_cca/output/rdfremont/grub-buildroot.img2 ibs=512 skip=43008 count=409600

    2) Mount using fuse-ext2
    fuse-ext2 $PWD/buildroot_fvp_cca/output/rdfremont/grub-buildroot.img2 $PWD/tmp/buildroot_mount -o rw+,uid=$UID

    3) copy new files c files to kvm unit tests and do cross compilation
    ./configure
    make all

    (Note that all the object files are generated again, which is not reflected properly within the VP)

    4)Unmount using fuermount
    fusermount -u tmp/buildroot_mount

    5) copy the filesystem back into grub-buildroot.img using dd
    dd if=$PWD/buildroot_fvp_cca/output/rdfremont/grub-buildroot.img2 of=$PWD/buildroot_fvp_cca/output/rdfremont/grub-buildroot.img bs=512 seek=43008 count=409600 conv=notrunc

    6)start the VP
    Then the ext4-fs problem shows up within the VP

    Any hint at the solution is greatly appreciated.

    Best Regards,
    Pooja

Children
  • Hi Pooja,

    Thank you for the details. Can I assume the steps from 1 to 5 are run on the host? If yes, the issue is unrelated to the FVP.

    Can you please:

    1. Check if the grub-buildroot.img at step 1 is identical to the one created by step 5 without running step 3?

    2. Verify if the img created by step 5 is valid? (Do you see all the object files generated by step 3 if you mount the img at step 5 by fuse-ext2?)

    3. Check if the size of the object files generated by step 3 can be held in the ext2 file partition? (In other words, is the size less than 409600 * 512 bytes?)

    Kind regards,

    Toshi

  • Hi Toshihisa,

    Thank you for your reply. 
    1) Yes the images without the compilation step are the same.
    2) I can mount the files any number of times on the host without any missing files.
    3) I have solved this problem by creating extending the size of the image and copying the files into a new ext3 partition without touching the existing one. I am now able to see the files inside the VP without any issues.

    The original problem remains unsolved, yet we have a solution for test setup.  :) 

    Best Regards,
    Pooja