umount and data is lost?

umount and data is lost?

Ori Berger linux-il at orib.net
Sun Nov 6 02:03:27 IST 2011


On 11/05/2011 05:12 PM, Diego wrote:
> Hi list,
>
> I am trying to debug this problem in a system I am developing:
>
> at some point I need to write a number to a file, and then reboot via an
> external device the machine. That device will cut of the power for a moment,
> and the machine will power on again (this is to overcome a fault we could not
> overcome otherwise). Before the reboot, I "umount" the proper partition and
> then "sync".

Have you tried a sync() before the umount? I have experienced (on older 
Ubuntus, may or may not be relevant to your system) that "sync" after 
unmount doesn't actually do anything, whereas a "sync" before unmount 
does -- perhaps it only syncs the list of mounted filesystems.



More information about the Linux-il mailing list