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

NAME

6       sg_sync - send the scsi command synchronize cache
7

SYNOPSIS

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

DESCRIPTION

13       Send SYNCHRONIZE CACHE (10) command to DEVICE. This command is  defined
14       for  SCSI  block  devices (see SBC-2). If successful this command makes
15       sure that any blocks whose latest versions are held in (volatile) cache
16       are  written to (also termed as "synchronized with") the medium. If the
17       --sync-nv option is given and the device has a non-volatile cache  then
18       any blocks whose latest versions are held in volatile cache are written
19       to non-volatile cache.
20
21       If the LBA and COUNT arguments are both zero (their defaults) then  all
22       blocks in the cache are synchronized. If LBA is greater than zero while
23       COUNT is zero then blocks in the cache whose  addresses  are  from  and
24       including  LBA  to  the  highest lba on the device are synchronized. If
25       both LBA and COUNT  are  non  zero  then  blocks  in  the  cache  whose
26       addresses  lie  in  the range LBA to LBA+COUNT-1 inclusive are synchro‐
27       nized with the medium.
28

OPTIONS

30       Arguments to long options are mandatory for short options as well.
31
32       -c, --count=COUNT
33              where COUNT is the number of  blocks  to  synchronize  from  and
34              including LBA. Default value is 0. When 0 then all blocks in the
35              (volatile) cache from and including LBA argument to the  highest
36              block address are synchronized.
37
38       -g, --group=GROUP
39              where  GROUP  is  the group number which can be between 0 and 31
40              inclusive.  The default value is 0 . Group numbers are  used  to
41              segregate  data  collected within the device. This is a new fea‐
42              ture in SBC-2 and can probably be ignored for the time being.
43
44       -h, --help
45              output the usage message then exit.
46
47       -i, --immed
48              sets the IMMED  bit  in  the  SYNCHRONIZE  CACHE  command.  This
49              instructs  the  device,  if the format of the command is accept‐
50              able, to return a GOOD status immediately rather than  wait  for
51              the blocks in the (volatile) cache to be synchronized with (i.e.
52              written to) the medium (or the non-volatile cache).
53
54       -l, --lba=LBA
55              where LBA is the lowest logical block address in the  (volatile)
56              cache  to synchronize to the medium (or the non-volatile cache).
57              Default value is 0 .
58
59       -s, --sync-nv
60              synchronize the (volatile) cache with  the  non-volatile  cache.
61              Without this option (or if there is no non-volatile cache in the
62              device) the synchronization is with the medium.
63
64       -v, --verbose
65              increase the level of verbosity, (i.e. debug output).
66
67       -V, --version
68              print the version string and then exit.
69

NOTES

71       The COUNT, GROUP and LBA arguments may be followed by one of these mul‐
72       tiplicative  suffixes:  c  C  *1;  w W *2; b B *512; k K KiB *1,024; KB
73       *1,000; m M MiB *1,048,576; MB *1,000,000 . This pattern continues  for
74       "G", "T" and "P". Also a suffix of the form "x<n>" multiplies the lead‐
75       ing number by <n>. The "T" and "P" suffixes can only be used for  COUNT
76       and LBA.
77
78       Alternatively  numerical values can be given in hexadecimal preceded by
79       either "0x" or "0X" (or with a trailing "h" or "H"). When  hex  numbers
80       are given, multipliers cannot be used.
81

EXIT STATUS

83       The  exit  status  of sg_sync is 0 when it is successful. Otherwise see
84       the sg3_utils(8) man page.
85

AUTHORS

87       Written by Douglas Gilbert.
88

REPORTING BUGS

90       Report bugs to <dgilbert at interlog dot com>.
91
93       Copyright © 2004-2006 Douglas Gilbert
94       This software is distributed under a FreeBSD license. There is NO  war‐
95       ranty;  not  even  for MERCHANTABILITY or FITNESS FOR A PARTICULAR PUR‐
96       POSE.
97

SEE ALSO

99       sg_start(sg3_utils)
100
101
102
103sg3_utils-1.22                   December 2006                      SG_SYNC(8)
Impressum