<div dir="ltr"><div class="gmail_quote">On 6 November 2011 08:12, Diego <span dir="ltr"><<a href="mailto:elcuco@kde.org">elcuco@kde.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hi list,<br>
<br>
I am trying to debug this problem in a system I am developing:<br>
<br>
at some point I need to write a number to a file, and then reboot via an<br>
external device the machine. That device will cut of the power for a moment,<br>
and the machine will power on again (this is to overcome a fault we could not<br>
overcome otherwise). Before the reboot, I "umount" the proper partition and<br>
then "sync".<br>
<br>
For some reason, on one machine we see that the data is not updated and the<br>
original data is kept in the file. I konw empirically that if I add a<br>
"sleep(5)" after the umount, and before the "reboot" the data is written to<br>
the disk.<br></blockquote><div><br>Disk write cache without battery backup is the first thing that comes to mind.<br>
Check your disk's specifications and how to control the cache.<br>
<br></div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<br>
Any tips how to debug this?<br>
* the system is a TI 2.6.32 kernel (OMAP)<br>
* the data is saved using fopen()<br>
* disk is umounted using system("umount /data"), and then I call from C to<br>
sync();<br></blockquote><div><br>Why not a direct umount(2) call?<br> <br></div>--Amos<br><br></div></div>