f2fs, sync, mopunt -o sync, power loss
I'm Paolo.
I'm integrating f2fs on an ARM board.
I do not have the power-off button.
The normal way to power-off is to cut-off the power.
I tried to mount in sync mode
mount -t f2fs -o sync /dev/mmcblk0 /data
echo Hello > /data/Hello.txt
I realize that if I cut-off the power after "echo" finishes, at the new boot I see that f2fs execute the recovery.
If I add the "sync" command
mount -t f2fs -o sync /dev/mmcblk0 /data
echo Hello > /data/Hello.txt
sync
I realize that if I cut-off the power after "sync" finishes, at the new boot I do not see the f2fs
recovery and the boot process is faster.
This means that -o sync is different that execute a sync command after each write.
Is there a solution to force sync automatically after each write ?
I would like avoid the following ...
while true
do
sync
sleep 1
done
Thanks for your time and for this great project
Paolo Minazzi
------------------------------------------------------------------------------