Peter Gervai wrote:
[Tried to search archieves, found nothing, probably my keywords are bad.
What is the recommended way to make sure that a file is written
physically to the disk? (apart from the cache of the disk.)
This problem seem to have arisen in grub bootloader under Debian linux
(and most probably everywhere else): it must be sure that the copied
files are there, and can be addressed by C/H/S and modified there, at
the given sector address.
My educated guess would be
but I give a large chance to be wrong about it.
Please cc on me if possible. Thanks.
Call the sync before you freeze the file system, not after. You can't
write to the file system when it is frozen, so it makes no sense to call
sync after a freeze.
I don't think you have any control of whether the data is written
physically to the disk or is still in the disk(s) buffer, the buffer you
can flush is on the software side. Call sync and freeze.
Geir A. Myrestrand