The role of the Unix/linux Sync command

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.