update filesystems to match cached data (UNIX)
Syntax:
sync [node]
Options:
- node
- The node to synchronize.
Examples:
Synchronize the local filesystem:
sync
Synchronize the filesystem on node 61:
sync 61
Description:
The sync utility forces the Filesystem Manger (Fsys) to
begin flushing all modified in-memory inodes and all previously unwritten
system buffers to disk. This ensures that all file modifications up to that
point are scheduled to be saved.
Pending data for all disks on the specified node, whether mounted or
unmounted, will be queued for draining. If a node isn't specified, the node
on which sync is run will be synchronized.
The sync utility usually returns before the operation is complete.
After executing sync, you must allow sufficient time for the driver
queues to drain before you may assume that the data is safely on disk. This
delay depends on the speed of your disk(s), the number of buffers that must be
drained, and how active your system is at the time.
It is unusual for the operation to take more than
four to five seconds with typical IDE drives and a
large (2 megabyte) cache, if a large portion of the cache needs to be flushed. With
faster disks (e.g. SCSI), it usually completes in under two
seconds. If significant amounts of data are being flushed to a floppy disk, it
could take many tens of seconds.
See also:
- shutdown utility (Shut down and reboot the system)