EXT4 partition corruption when writen from UBoot in Nano

Hi,

The ext4 partition gets curropted when written from uboot command line. We are writting the uboot env varibles to the eMMC partiton and the corruption is noticed when the partition is mounted after complete bootup. Kindly, let us know what might be the cause of the issue.

I probably can’t answer this, but you should give details about what was written and how it was written. For example, was U-Boot edited for this? If so, what was it edited to write? Was the content written as a regular file after mounting the ext4 partition? If your U-Boot was edited, are you certain the new U-Boot size fits withing the partition you wrote U-Boot itself to?

We have not modified the uboot. We use the standard uboot commands to load a file to memory from the eMMC ext4 partition and then write the same memory region to a new file in another ext4 partition. The commands used are ext4load and ext4write. The partition seems to work properly in uboot but the corrution error pops up when mounted in the console after complete boot up.

We are able to recover the partition by the e2fsck command but we want to know the exact cause of the issue which occurs when accessing from uboot.

I cannot tell much unless you provide helpful info.

  1. Which jetpack release is in use?

  2. What is your method to crash the partition?

  3. Any uart log to share?

I can’t answer (I am just making a guess), but there is a possibility that U-Boot read/write of ext4 does not update the journal (which would occur if it is using an ext2 driver…ext2 and ext4 are backwards compatible for read, but unless options are used for journal use, then I would think a write would corrupt). Quite often boot stages try to speed things up and may not be expecting a write, and so it might just mount as ext2 without using the journal (many ext2 commands allow options for using a journal and treating as ext4, but I have no idea if this is the case in the bootloader).

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.