Blob


1 .TH VENTI-FMT 8
2 .SH NAME
3 buildindex,
4 checkarenas,
5 checkindex,
6 conf,
7 fmtarenas,
8 fmtindex,
9 fmtisect,
10 syncindex \- prepare and maintain a venti server
11 .SH SYNOPSIS
12 .PP
13 .B venti/fmtarenas
14 [
15 .B -Z
16 ]
17 [
18 .B -a
19 .I arenasize
20 ]
21 [
22 .B -b
23 .I blocksize
24 ]
25 .I name
26 .I file
27 .PP
28 .B venti/fmtisect
29 [
30 .B -1Z
31 ]
32 [
33 .B -b
34 .I blocksize
35 ]
36 .I name
37 .I file
38 .PP
39 .B venti/fmtindex
40 [
41 .B -a
42 ]
43 .I venti.conf
44 .PP
45 .B venti/conf
46 [
47 .B -w
48 ]
49 .I partition
50 [
51 .I configfile
52 ]
53 .if t .sp 0.5
54 .PP
55 .B venti/buildindex
56 [
57 .B -B
58 .I blockcachesize
59 ]
60 [
61 .B -Z
62 ]
63 .I venti.conf
64 .I tmp
65 .PP
66 .B venti/checkindex
67 [
68 .B -f
69 ]
70 [
71 .B -B
72 .I blockcachesize
73 ]
74 .I venti.conf
75 .I tmp
76 .PP
77 .B venti/checkarenas
78 [
79 .B -afv
80 ]
81 .I file
82 .PP
83 .B venti/copy
84 [
85 .B -f
86 ]
87 .I src
88 .I dst
89 .I score
90 [
91 .I type
92 ]
93 .SH DESCRIPTION
94 These commands aid in the setup, maintenance, and debugging of
95 venti servers.
96 See
97 .IR venti (7)
98 for an overview of the venti system and
99 .IR venti (8)
100 for an overview of the data structures used by the venti server.
101 .PP
102 Note that the units for the various sizes in the following
103 commands can be specified by appending
104 .LR k ,
105 .LR m ,
106 or
107 .LR g
108 to indicate kilobytes, megabytes, or gigabytes respectively.
109 .SS Formatting
110 To prepare a server for its initial use, the arena partitions and
111 the index sections must be formatted individually, with
112 .I fmtarenas
113 and
114 .IR fmtisect .
115 Then the
116 collection of index sections must be combined into a venti
117 index with
118 .IR fmtindex .
119 .PP
120 .I Fmtarenas
121 formats the given
122 .IR file ,
123 typically a disk partition, into an arena partition.
124 The arenas in the partition are given names of the form
125 .IR name%d ,
126 where
127 .I %d
128 is replaced with a sequential number starting at 0.
129 .PP
130 Options to
131 .I fmtarenas
132 are:
133 .TP
134 .BI -a " arenasize
135 The arenas are of
136 .I arenasize
137 bytes. The default is
138 .BR 512M ,
139 which was selected to provide a balance
140 between the number of arenas and the ability to copy an arena to external
141 media such as recordable CDs and tapes.
142 .TP
143 .BI -b " blocksize
144 The size, in bytes, for read and write operations to the file.
145 The size is recorded in the file, and is used by applications that access the arenas.
146 The default is
147 .BR 8k .
148 .TP
149 .B -4
150 Create a `version 4' arena partition for backwards compatibility with old servers.
151 The default is version 5, used by the current venti server.
152 .TP
153 .B -Z
154 Do not zero the data sections of the arenas.
155 Using this option reduces the formatting time
156 but should only be used when it is known that the file was already zeroed.
157 (Version 4 only; version 5 sections are not and do not need to be zeroed.)
158 .PD
159 .PP
160 .I Fmtisect
161 formats the given
162 .IR file ,
163 typically a disk partition, as a venti index section with the specified
164 .IR name .
165 Each of the index sections in a venti configuration must have a unique name.
166 .PP
167 Options to
168 .I fmtisect
169 are:
170 .TP
171 .BI -b " bucketsize
172 The size of an index bucket, in bytes.
173 All the index sections within a index must have the same bucket size.
174 The default is
175 .BR 8k .
176 .TP
177 .B -1
178 Create a `version 1' index section for backwards compatibility with old servers.
179 The default is version 2, used by the current venti server.
180 .TP
181 .B -Z
182 Do not zero the index.
183 Using this option reduces the formatting time
184 but should only be used when it is known that the file was already zeroed.
185 (Version 1 only; version 2 sections are not and do not need to be zeroed.)
186 .PD
187 .I Fmtindex
188 reads the configuration file
189 .I venti.conf
190 and initializes the index sections to form a usable index structure.
191 The arena files and index sections must have previously been formatted
192 using
193 .I fmtarenas
194 and
195 .I fmtisect
196 respectively.
197 .PP
198 The function of a venti index is to map a SHA1 fingerprint to a location
199 in the data section of one of the arenas. The index is composed of
200 blocks, each of which contains the mapping for a fixed range of possible
201 fingerprint values.
202 .I Fmtindex
203 determines the mapping between SHA1 values and the blocks
204 of the collection of index sections. Once this mapping has been determined,
205 it cannot be changed without rebuilding the index.
206 The basic assumption in the current implementation is that the index
207 structure is sufficiently empty that individual blocks of the index will rarely
208 overflow. The total size of the index should be about 2% to 10% of
209 the total size of the arenas, but the exact percentage depends both on the
210 index block size and the compressed size of blocks stored.
211 See the discussion in
212 .IR venti (8)
213 for more.
214 .PP
215 .I Fmtindex
216 also computes a mapping between a linear address space and
217 the data section of the collection of arenas. The
218 .B -a
219 option can be used to add additional arenas to an index.
220 To use this feature,
221 add the new arenas to
222 .I venti.conf
223 after the existing arenas and then run
224 .I fmtindex
225 .BR -a .
226 .PP
227 A copy of the above mappings is stored in the header for each of the index sections.
228 These copies enable
229 .I buildindex
230 to restore a single index section without rebuilding the entire index.
231 .PP
232 To make it easier to bootstrap servers, the configuration
233 file can be stored in otherwise empty space
234 at the beginning of any venti partitions using
235 .IR conf .
236 A partition so branded with a configuration file can
237 be used in place of a configuration file when invoking any
238 of the venti commands.
239 By default,
240 .I conf
241 prints the configuration stored in
242 .IR partition .
243 When invoked with the
244 .B -w
245 flag,
246 .I conf
247 reads a configuration file from
248 .I configfile
249 (or else standard input)
250 and stores it in
251 .IR partition .
252 .SS Checking and Rebuilding
253 .PP
254 .I Buildindex
255 populates the index for the Venti system described in
256 .IR venti.conf .
257 The index must have previously been formatted using
258 .IR fmtindex .
259 This command is typically used to build a new index for a Venti
260 system when the old index becomes too small, or to rebuild
261 an index after media failure.
262 Small errors in an index can usually be fixed with
263 .IR checkindex .
264 .PP
265 The
266 .I tmp
267 file, usually a disk partition, must be large enough to store a copy of the index.
268 This temporary space is used to perform a merge sort of index entries
269 generated by reading the arenas.
270 .PP
271 Options to
272 .I buildindex
273 are:
274 .TP
275 .BI -B " blockcachesize
276 The amount of memory, in bytes, to use for caching raw disk accesses while running
277 .IR buildindex .
278 (This is not a property of the created index.)
279 The default is 8k.
280 .TP
281 .B -Z
282 Do not zero the index.
283 This option should only be used when it is known that the index was already zeroed.
284 (Version 1 indexes only; see the discussion in
285 .I fmtindex
286 above.)
287 .PD
288 .PP
289 .I Checkindex
290 examines the Venti index described in
291 .IR venti.conf .
292 The program detects various error conditions including:
293 blocks that are not indexed, index entries for blocks that do not exist,
294 and duplicate index entries.
295 If requested, an attempt can be made to fix errors that are found.
296 .PP
297 The
298 .I tmp
299 file, usually a disk partition, must be large enough to store a copy of the index.
300 This temporary space is used to perform a merge sort of index entries
301 generated by reading the arenas.
302 .PP
303 Options to
304 .I checkindex
305 are:
306 .TP
307 .BI -B " blockcachesize
308 The amount of memory, in bytes, to use for caching raw disk accesses while running
309 .IR checkindex .
310 The default is 8k.
311 .TP
312 .B -f
313 Attempt to fix any errors that are found.
314 .PD
315 .PP
316 .I Checkarenas
317 examines the Venti arenas contained in the given
318 .IR file .
319 The program detects various error conditions, and optionally attempts
320 to fix any errors that are found.
321 .PP
322 Options to
323 .I checkarenas
324 are:
325 .TP
326 .B -a
327 For each arena, scan the entire data section.
328 If this option is omitted, only the end section of
329 the arena is examined.
330 .TP
331 .B -f
332 Attempt to fix any errors that are found.
333 .TP
334 .B -v
335 Increase the verbosity of output.
336 .PD
337 .SH SOURCE
338 .B \*9/src/cmd/venti/srv
339 .SH SEE ALSO
340 .IR venti (7),
341 .IR venti (8)
342 .SH BUGS
343 .I Buildindex
344 should allow an individual index section to be rebuilt.
345 The merge sort could be performed in the space used to store the
346 index rather than requiring a temporary file.