15 write \- Venti maintenance and debugging commands
141 These commands aid in the setup, maintenance, and debugging of
147 for an overview of the data structures stored by Venti.
149 Note that the units for the various sizes in the following
150 commands can be specified by appending
155 to indicate kilobytes, megabytes, or gigabytes respectively.
158 populates the index for the Venti system described in
160 The index must have previously been formatted using
162 This command is typically used to build a new index for a Venti
163 system when the old index becomes too small, or to rebuild
164 an index after media failure.
165 Small errors in an index can usually be fixed with
170 file, usually a disk partition, must be large enough to store a copy of the index.
171 This temporary space is used to perform a merge sort of index entries
172 generated by reading the arenas.
178 .BI -B " blockcachesize
179 The amount of memory, in bytes, to use for caching raw disk accesses while running
181 (This is not a property of the created index.)
185 Do not zero the index.
186 This option should only be used when it is known that the index was already zeroed.
190 examines the Venti arenas contained in the given
192 The program detects various error conditions, and optionally attempts
193 to fix any errors that are found.
200 For each arena, scan the entire data section.
201 If this option is omitted, only the end section of
202 the arena is examined.
205 Attempt to fix any errors that are found.
208 Increase the verbosity of output.
212 examines the Venti index described in
214 The program detects various error conditions including:
215 blocks that are not indexed, index entries for blocks that do not exist,
216 and duplicate index entries.
217 If requested, an attempt can be made to fix errors that are found.
221 file, usually a disk partition, must be large enough to store a copy of the index.
222 This temporary space is used to perform a merge sort of index entries
223 generated by reading the arenas.
229 .BI -B " blockcachesize
230 The amount of memory, in bytes, to use for caching raw disk accesses while running
235 Attempt to fix any errors that are found.
241 typically a disk partition, into a number of
244 The arenas are given names of the form
248 is replaced with a sequential number starting at 0.
257 bytes. The default is 512 megabytes, which was selected to provide a balance
258 between the number of arenas and the ability to copy an arena to external
259 media such as recordable CDs and tapes.
262 The size, in bytes, for read and write operations to the file.
263 The size is recorded in the file, and is used by applications that access the arenas.
267 Do not zero the data sections of the arenas.
268 Using this option reduces the formatting time
269 but should only be used when it is known that the file was already zeroed.
276 and initializes the index sections to form a usable index structure.
277 The arena files and index sections must have previously been formatted
284 The function of a Venti index is to map a SHA1 fingerprint to a location
285 in the data section of one of the arenas. The index is composed of
286 blocks, each of which contains the mapping for a fixed range of possible
289 determines the mapping between SHA1 values and the blocks
290 of the collection of index sections. Once this mapping has been determined,
291 it cannot be changed without rebuilding the index.
292 The basic assumption in the current implementation is that the index
293 structure is sufficiently empty that individual blocks of the index will rarely
294 overflow. The total size of the index should be about 2% to 10% of
295 the total size of the arenas, but the exact depends both the index block size
296 and the compressed size of block stored to Venti.
299 also computes a mapping between a linear address space and
300 the data section of the collection of arenas. The
302 option can be used to add additional arenas to an index.
304 add the new arenas to
306 after the existing arenas and then run
310 A copy of the above mappings is stored in the header for each of the index sections.
313 to restore a single index section without rebuilding the entire index.
318 typically a disk partition, as a Venti index section with the specified
320 One or more formatted index sections are combined into a Venti
323 Each of the index sections within an index must have a unique name.
330 The size, in bytes, for read and write operations to the file.
331 All the index sections within a index must have the same block size.
335 Do not zero the index.
336 Using this option reduces the formatting time
337 but should only be used when it is known that the file was already zeroed.
343 from the arena partition
345 and writes this arena to standard output.
346 This command is typically used to back up an arena to external media.
349 option generates more verbose output on standard error.
352 writes the blocks contained in the arena
354 (typically, the output of
357 It is typically used to reinitialize a Venti server from backups of the arenas.
361 venti/rdarena /dev/sdC0/arenas arena.0 >external.media
362 venti/wrarena -h venti2 external.media
365 writes the blocks contained in
369 (typically not the one using
370 .BR /dev/sdC0/arenas ).
374 option specifies that the arena starts at byte
380 This is useful for reading directly from
381 the Venti arena partition:
384 venti/wrarena -h venti2 -o 335872 /dev/sdC0/arenas
387 (In this example, 335872 is the offset shown in the Venti
388 server's index list (344064) minus one block (8192).
389 You will need to substitute your own arena offsets
392 Finally, the optional
394 argument specifies that the writing should begin with the
399 prints the offset it stopped at (because there were no more data blocks).
400 This could be used to incrementally back up a Venti server
401 to another Venti server:
405 venti/wrarena -h venti2 -o 335872 /dev/sdC0/arenas $last >output
406 awk '/^end offset/ { print $3 }' offset >last
409 Of course, one would need to add wrapper code to keep track
410 of which arenas have been processed.
412 .B /sys/src/cmd/venti/backup.example
413 for a version that does this.
418 read and write blocks from a running Venti server.
419 They are intended to ease debugging of the server.
422 is the environment variable
424 followed by the network metaname
428 is the decimal type of block to be read or written.
433 all types are tried, and a command-line is printed to
434 show the type that eventually worked.
443 reads the block named by
446 from the Venti server and writes it to standard output.
448 reads a block from standard input and attempts to write
449 it to the Venti server.
450 If successful, it prints the score of the block on the server.
453 walks the entire tree of blocks rooted at
455 copying all the blocks visited during the walk from
456 the Venti server at network address
458 to the Venti server at network address
462 (a decimal block type for
464 is omitted, all types will be tried in sequence
465 until one is found that works.
468 flag runs the copy in ``fast'' mode: if a block is already on
470 the walk does not descend below it, on the assumption that all its
471 children are also already on
473 Without this flag, the copy often transfers many times more
476 To make it easier to bootstrap servers, the configuration
477 file can be stored at the beginning of any Venti partitions using
479 A partition so branded with a configuration file can
480 be used in place of a configuration file when invoking any
481 of the venti commands.
484 prints the configuration stored in
486 When invoked with the
490 reads a configuration file from
492 (or else standard input)
496 .B /sys/src/cmd/venti
502 should allow an individual index section to be rebuilt.
503 The merge sort could be performed in the space used to store the
504 index rather than requiring a temporary file.