Linux Sync Command

Source: Internet
Author: User

The Linux Sync command is used for data synchronization, and the Sync command is used when shutting down the Linux system.

The Linux system to write to the hard disk data sometimes will be more efficient, will write to filesystem buffer, this buffer is a memory space, if you want to write to the hard disk data in this buffer, and the system suddenly power down, then the data will be lost, The sync command forces the data stored in buffer to be written to the hard disk.


Grammar sync (option)

Buffer and Cache

Buffer: To solve the efficiency of writing disk

Cache: To solve the efficiency of read disk


In order to improve the efficiency of reading and writing disks, the Linux system will first put the data in a buffer. Writing a disk does not immediately write the data to disk, but instead writes it to the buffer first. This can result in data loss if the system is restarted. The sync command is used to flush the file system buffer so that the data is actually written to the disk and buffer is released, flush is used to empty the buffer. The sync command forces the data to be written to disk and releases the buffer corresponding to the data, so it is common to enter the sync command after the disk is written to actually write the data to disk. If you do not manually enter the sync command to actually write to the disk, the Linux system will periodically go to sync data.



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.