how to sync / commit data to disk?

Peter Gervai
2007-01-23T15:44:36Z

Hello,

[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
xfs_freeze -f
sync
xfs_freeze -u

but I give a large chance to be wrong about it.

Ideas?

Please cc on me if possible. Thanks.

--
byte-byte,
grin