1SYNC(8)                    Linux Programmer's Manual                   SYNC(8)
2
3
4

NAME

6       sync - synchronize data on disk with memory
7

SYNOPSIS

9       sync [--help] [--version]
10

DESCRIPTION

12       sync  writes any data buffered in memory out to disk.  This can include
13       (but is not limited to)  modified  superblocks,  modified  inodes,  and
14       delayed  reads and writes.  This must be implemented by the kernel; The
15       sync program does nothing but exercise the sync(2) system call.
16
17       The kernel keeps data in memory to avoid doing (relatively  slow)  disk
18       reads  and  writes.   This  improves  performance,  but if the computer
19       crashes, data may be lost or the  filesystem  corrupted  as  a  result.
20       sync ensures that everything in memory is written to disk.
21
22       sync should be called before the processor is halted in an unusual man‐
23       ner (e.g., before causing a kernel  panic  when  debugging  new  kernel
24       code).   In  general,  the  processor  should be halted using the shut‐
25       down(8) or reboot(8) or halt(8) commands, which will attempt to put the
26       system in a quiescent state before calling sync(2).  (Various implemen‐
27       tations of these commands exist; consult your  documentation;  on  some
28       systems one should not call reboot(8) and halt(8) directly.)
29

GNU STANDARD OPTIONS

31       --help Print a usage message on standard output and exit successfully.
32
33       --version
34              Print version information on standard output, then exit success‐
35              fully.
36
37       --     Terminate option list.
38

ENVIRONMENT

40       The variables LANG, LC_ALL, LC_CTYPE, and LC_MESSAGES  have  the  usual
41       meaning.
42

CONFORMING TO

44       POSIX.2
45

NOTES

47       On  Linux,  sync  is  only  guaranteed to schedule the dirty blocks for
48       writing; it can actually take a short time before all  the  blocks  are
49       finally  written.   The  reboot(8)  and halt(8) commands take this into
50       account by sleeping for a few seconds after calling sync(2).
51
52       This page describes sync as found in the fileutils-4.0  package;  other
53       versions may differ slightly.
54

SEE ALSO

56       sync(2), halt(8), reboot(8), update(8)
57
58
59
60GNU fileutils 4.0                   1998-11                            SYNC(8)
Impressum