Skip to contentSkip to conversation

ALLFF blocks seems to be added to erase pending list at booting-time

DISCUSSION Rey Cheng 1 participant 1 message Aug 20, 2006 Memory technology devices (MTD)

lore
Share & tools
lore

Rey Cheng

author
#0 lore raw

Hi all,

I have two machine.

In machine #1,
I use mkfs.jffs2 to create its flash file system image.

# mkfs.jffs2 -r /mnt/flash -o jffs2.img

To burn the image on machine #2,
I erase machine #2's flash file system.
And write the image on machine #2.

I use mtd_debug to erase the flash, the flash is 1MB and the image is about 700K.

# mtd_debug erase /dev/mtd1 0 0x100000
# mtd_debug write /dev/mtd1 0 705136 ./jffs2.img

Then I reboot the system.
Because I erased the entire flash memory, and only 700K bytes were written. The "ALLFF" blocks are added to erase pending list, and jffs2 tries to mark the blocks clean at boot time.
But I put the system init scripts in the flash file system. Therefore the "erasing" and "reading" occurs in the same time. Looks like a race condition.

I solve the problem by umount and mount the flash file system after witting image on machine #2.
Then the "ALLFF" blocks will be erased before rebooting the system.

Is there any other solution?
Thank you.

Rey.