The sync system call writes dirty buffers to the file system or disk.

The progress of sync can be viewed indirectly by:

# grep -e Dirty: -e Writeback: /proc/meminfo

If something is wonky with your disk or network share, sync may hang. If a reboot is issued, the reboot will also hang when attempting to call sync. In such circumstances, it might be desirable to do a force reboot (reboot -f -f) or by rebooting using Sysrq both of which foregoes syncing.