1
.TH SG_SYNC "8" "March 2009" "sg3_utils\-1.27" SG3_UTILS
1
.TH SG_SYNC "8" "May 2013" "sg3_utils\-1.36" SG3_UTILS
3
sg_sync \- send the scsi command synchronize cache
3
sg_sync \- send SCSI SYNCHRONIZE CACHE command
6
[\fI\-\-count=COUNT\fR] [\fI\-\-group=GROUP\fR] [\fI\-\-help\fR]
7
[\fI\-\-immed\fR] [\fI\-\-lba=LBA\fR] [\fI\-\-sync\-nv\fR]
8
[\fI\-\-verbose\fR] [\fI\-\-version\fR] \fIDEVICE\fR
6
[\fI\-\-16\fR] [\fI\-\-count=COUNT\fR] [\fI\-\-group=GN\fR]
7
[\fI\-\-help\fR] [\fI\-\-immed\fR] [\fI\-\-lba=LBA\fR] [\fI\-\-sync\-nv\fR]
8
[\fI\-\-timeout=SECS\fR] [\fI\-\-verbose\fR] [\fI\-\-version\fR] \fIDEVICE\fR
10
10
.\" Add any additional description here
12
Send SYNCHRONIZE CACHE (10) command to \fIDEVICE\fR. This command is
13
defined for SCSI block devices (see SBC\-2). If successful this command
14
makes sure that any blocks whose latest versions are held in (volatile)
15
cache are written to (also termed as "synchronized with") the medium. If
16
the \fI\-\-sync\-nv\fR option is given and the device has a non\-volatile
17
cache then any blocks whose latest versions are held in volatile cache are
18
written to non\-volatile cache.
12
Send SYNCHRONIZE CACHE(10) or SYNCHRONIZE CACHE(16) command to \fIDEVICE\fR.
13
These commands are defined for SCSI block devices (see SBC\-3). If successful
14
these commands make sure that any blocks whose latest versions are held in
15
cache are written to (also termed as "synchronized with") the medium.
20
17
If the \fILBA\fR and \fICOUNT\fR arguments are both zero (their defaults)
21
18
then all blocks in the cache are synchronized. If \fILBA\fR is greater than
28
25
Arguments to long options are mandatory for short options as well.
27
\fB\-S\fR, \fB\-\-16\fR
28
performs a SYNCHRONIZE CACHE(16) command. Default is to perform a
29
SYNCHRONIZE CACHE(10) command.
30
31
\fB\-c\fR, \fB\-\-count\fR=\fICOUNT\fR
31
32
where \fICOUNT\fR is the number of blocks to synchronize from and including
32
\fILBA\fR. Default value is 0. When 0 then all blocks in the (volatile) cache
33
from and including \fILBA\fR argument to the highest block address are
33
\fILBA\fR. Default value is 0. When 0 then all blocks in the cache from and
34
including \fILBA\fR argument to the highest block address are synchronized.
36
\fB\-g\fR, \fB\-\-group\fR=\fIGROUP\fR
37
where \fIGROUP\fR is the group number which can be between 0 and 31 inclusive.
36
\fB\-g\fR, \fB\-\-group\fR=\fIGN\fR
37
where \fIGN\fR is the group number which can be between 0 and 31 inclusive.
38
38
The default value is 0 . Group numbers are used to segregate data collected
39
39
within the device. This is a new feature in SBC\-2 and can probably be
40
40
ignored for the time being.
45
45
\fB\-i\fR, \fB\-\-immed\fR
46
46
sets the IMMED bit in the SYNCHRONIZE CACHE command. This instructs the
47
47
device, if the format of the command is acceptable, to return a GOOD
48
status immediately rather than wait for the blocks in the (volatile)
49
cache to be synchronized with (i.e. written to) the medium (or the
48
status immediately rather than wait for the blocks in the cache to be
49
synchronized with (i.e. written to) the medium.
52
51
\fB\-l\fR, \fB\-\-lba\fR=\fILBA\fR
53
where \fILBA\fR is the lowest logical block address in the (volatile)
54
cache to synchronize to the medium (or the non\-volatile cache). Default
52
where \fILBA\fR is the lowest logical block address in the cache to
53
synchronize to the medium. Default value is 0 .
57
\fB\-s\fR, \fB\-\-sync-nv\fR
55
\fB\-s\fR, \fB\-\-sync\-nv\fR
58
56
synchronize the (volatile) cache with the non\-volatile cache. Without this
59
57
option (or if there is no non\-volatile cache in the device) the
60
synchronization is with the medium.
58
synchronization is with the medium. The SYNC_NV bit was made obsolete in
61
\fB\-t\fR, \fB\-\-timeout\fR=\fISECS\fR
62
where \fISECS\fR is the number of seconds the OS allows the SYNCHRONIZE
63
CACHE(16) to complete before it tries to cancel the command. Cancelling
64
commands (typically with the task management function "abort task") is
65
best avoided. Note this option is only active together with the \fI\-\-16\fR
66
option. The default timeout is 60 seconds for both SYNCHRONIZE CACHE(10)
67
and SYNCHRONIZE CACHE(16). Note that timeout issues can be avoided with
68
the \fI\-\-immed\fR option.
62
70
\fB\-v\fR, \fB\-\-verbose\fR
63
71
increase the level of verbosity, (i.e. debug output).
65
73
\fB\-V\fR, \fB\-\-version\fR
66
74
print the version string and then exit.
76
With the SYNCHRONIZE CACHE(16) command \fILBA\fR can be up to 64 bits
77
in size and \fICOUNT\fR up to 32 bits in size. With the SYNCHRONIZ
78
CACHE(10) command \fILBA\fR can be up to 32 bits in size and \fICOUNT\fR
79
up to 16 bits in size.
68
81
Various numeric arguments (e.g. \fILBA\fR) may include multiplicative
69
82
suffixes or be given in hexadecimal. See the "NUMERIC ARGUMENTS" section
70
83
in the sg3_utils(8) man page.
76
89
.SH "REPORTING BUGS"
77
90
Report bugs to <dgilbert at interlog dot com>.
79
Copyright \(co 2004\-2009 Douglas Gilbert
92
Copyright \(co 2004\-2013 Douglas Gilbert
81
94
This software is distributed under a FreeBSD license. There is NO
82
95
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.