1SG_SYNC(8)                         SG3_UTILS                        SG_SYNC(8)
2
3
4

NAME

6       sg_sync - send SCSI SYNCHRONIZE CACHE command
7

SYNOPSIS

9       sg_sync   [--16]   [--count=COUNT]   [--group=GN]   [--help]  [--immed]
10       [--lba=LBA] [--sync-nv] [--timeout=SECS] [--verbose] [--version] DEVICE
11

DESCRIPTION

13       Send SYNCHRONIZE CACHE(10) or SYNCHRONIZE CACHE(16) command to  DEVICE.
14       These  commands are defined for SCSI block devices (see SBC-3). If suc‐
15       cessful these commands make sure that any blocks whose latest  versions
16       are  held  in cache are written to (also termed as "synchronized with")
17       the medium.
18
19       If the LBA and COUNT arguments are both zero (their defaults) then  all
20       blocks in the cache are synchronized. If LBA is greater than zero while
21       COUNT is zero then blocks in the cache whose  addresses  are  from  and
22       including  LBA  to  the  highest lba on the device are synchronized. If
23       both LBA and COUNT  are  non  zero  then  blocks  in  the  cache  whose
24       addresses  lie  in  the range LBA to LBA+COUNT-1 inclusive are synchro‐
25       nized with the medium.
26

OPTIONS

28       Arguments to long options are mandatory for short options as well.
29
30       -S, --16
31              performs a SYNCHRONIZE CACHE(16) command. Default is to  perform
32              a SYNCHRONIZE CACHE(10) command.
33
34       -c, --count=COUNT
35              where  COUNT  is  the  number  of blocks to synchronize from and
36              including LBA. Default value is 0. When 0 then all blocks in the
37              cache  from  and  including  LBA  argument  to the highest block
38              address are synchronized.
39
40       -g, --group=GN
41              where GN is the group number which  can  be  between  0  and  31
42              inclusive.   The  default value is 0 . Group numbers are used to
43              segregate data collected within the device. This is a  new  fea‐
44              ture in SBC-2 and can probably be ignored for the time being.
45
46       -h, --help
47              output the usage message then exit.
48
49       -i, --immed
50              sets  the  IMMED  bit  in  the  SYNCHRONIZE  CACHE command. This
51              instructs the device, if the format of the  command  is  accept‐
52              able,  to  return a GOOD status immediately rather than wait for
53              the blocks in the cache to be synchronized  with  (i.e.  written
54              to) the medium.
55
56       -l, --lba=LBA
57              where  LBA  is  the lowest logical block address in the cache to
58              synchronize to the medium. Default value is 0 .
59
60       -s, --sync-nv
61              synchronize the (volatile) cache with  the  non-volatile  cache.
62              Without this option (or if there is no non-volatile cache in the
63              device) the synchronization is with the medium. The SYNC_NV  bit
64              was made obsolete in SBC-3 revision 35d.
65
66       -t, --timeout=SECS
67              where  SECS  is the number of seconds the OS allows the SYNCHRO‐
68              NIZE CACHE(16) to complete before it tries to  cancel  the  com‐
69              mand.  Cancelling  commands  (typically with the task management
70              function "abort task") is best avoided. Note this option is only
71              active  together with the --16 option. The default timeout is 60
72              seconds  for  both   SYNCHRONIZE   CACHE(10)   and   SYNCHRONIZE
73              CACHE(16).  Note  that  timeout  issues  can be avoided with the
74              --immed option.
75
76       -v, --verbose
77              increase the level of verbosity, (i.e. debug output).
78
79       -V, --version
80              print the version string and then exit.
81

NOTES

83       With the SYNCHRONIZE CACHE(16) command LBA can be up to 64 bits in size
84       and  COUNT up to 32 bits in size. With the SYNCHRONIZ CACHE(10) command
85       LBA can be up to 32 bits in size and COUNT up to 16 bits in size.
86
87       Various numeric arguments (e.g. LBA) may  include  multiplicative  suf‐
88       fixes  or  be given in hexadecimal. See the "NUMERIC ARGUMENTS" section
89       in the sg3_utils(8) man page.
90

EXIT STATUS

92       The exit status of sg_sync is 0 when it is  successful.  Otherwise  see
93       the sg3_utils(8) man page.
94

AUTHORS

96       Written by Douglas Gilbert.
97

REPORTING BUGS

99       Report bugs to <dgilbert at interlog dot com>.
100
102       Copyright © 2004-2013 Douglas Gilbert
103       This  software is distributed under a FreeBSD license. There is NO war‐
104       ranty; not even for MERCHANTABILITY or FITNESS FOR  A  PARTICULAR  PUR‐
105       POSE.
106

SEE ALSO

108       sg_start(sg3_utils)
109
110
111
112sg3_utils-1.37                     July 2013                        SG_SYNC(8)
Impressum