On a running linux box, cached content in a filesystem, should be written to disk.
- "sync": with the command line sync and related system call, it can be made that data is persisted/written out to the storage device
- "fsfreeze": the command fsfreeze, seems on the other hand:
fsfreeze halts new access to the filesystem and creates a stable image on disk.
So it seems that with either command a "stable on-disk" representation of the data at the time of issueing the command is achieved.
Clearly the fsfreeze, is described as -additionally- suspending further "new access".
Now this question seeks information if for the purpose of having a coherent disk image (i.e. for the backing copying the on disk filesystem data), is there any difference between using sync and fsfreeze.
I assume that to answer this, question it might be necessary to consider the filesystem used, because different filesystems have different ways of assuring (or not) that intermediate states are atomicly commited to disk.
Personal testing has shown, that fsfreeze and btrfs filesystem did always end up in a unresponsive console, requiring a hard reset. Sync on the other hand did not (no irony intented) freeze the system.