sync( ) problem on SD card
Hi we have a customer designed arm9 board,
it has a software reset button.
when i press it, it'll trigger a configuration backup function,
which will save all my running configuration from ram disk to SD/EMMC card, using "cp" command.
In the end of the cp commands, i run "sync()" to make sure all stuff put back to SD or EMMC. Then board reboots.
Now after i reboot, i copy my original config from SD/EMMC to ram disk.
Every once a while it says inode problem, asking me to run e2fsck.
If i put several sync() in the code back to back, problem happens less but still happens.
my guess is it didn't write info to SD/EMMC completely during soft reset.
so how to make sure sync() can really flush info to the SD ?
Any help appreciated.
Last edited by 5883; 02-11-2013 at 03:07 PM.