Write Cache command--sync
After starting the UNIX system with the reboot command, the system prompts for an error message and some applications do not work correctly. After careful examination of the system files, and compared with the initial correct backup, found that some files are really destroyed, and can not find the cause of the file corruption, and finally think of the write Cache command--sync, before reboot run Sync command, causing the system file changes and does not work properly.
The Sync command runs the Sync subroutine. If you must stop the system, run the Sync command to ensure the integrity of the file system. The Sync command writes all the non-writable system buffers to disk, including modified I-node, deferred block I/O, and read-write mapping files.
The sync command works by sending the memory resident information about the file system into the physical medium. Before pausing the system, such as restarting the machine, be sure to perform the sync command. UNIX system operating experience shows that to ensure reliability, the two-pass sync command should be performed because the sync command does not guarantee that the information is actually written to disk, although it has been executed once. After the sync command is executed, wait for the disk work light to go out (assuming there is a system operating light), and then to actually pause the machine or start the machine.
The destruction of a UNIX system is something that can happen at any time, so be sure to run the sync command before starting the machine or shutting down the machine. Remember that in any case, careful execution of the sync command will never do any harm.
The role of the Unix/linux Sync command