The role of Unix/linux Sync command __linux

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 properly. After careful examination of system files, and the initial correct backup to compare, found that some files are indeed corrupted, toss and turn to find the cause of the file is destroyed, and finally thought of the write Cache command--sync, reboot before running sync command, resulting in the system file changes and does not work properly.


The sync command runs the Sync subroutine. If the system must be stopped, run the sync command to ensure the integrity of the file system. The Sync command writes all of the system buffers that are not written to disk, including modified I-node, deferred block I/O, and read-write mapping files.


The sync command is to send the memory resident information about the file system into the physical media. Before pausing the system, for example, to reboot the machine, be sure to perform the sync command. Unix system experience shows that, to ensure reliability, you should perform the two sync command because the Sync command does not guarantee that the information is actually written to disk, although the command 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 indicator), and then really suspend the machine or start the machine.

Damage to the 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.

Related Article

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.