HAMMER utilities:
[dragonfly.git] / sbin / hammer / hammer.8
1 .\" Copyright (c) 2007 The DragonFly Project.  All rights reserved.
2 .\" 
3 .\" This code is derived from software contributed to The DragonFly Project
4 .\" by Matthew Dillon <dillon@backplane.com>
5 .\" 
6 .\" Redistribution and use in source and binary forms, with or without
7 .\" modification, are permitted provided that the following conditions
8 .\" are met:
9 .\" 
10 .\" 1. Redistributions of source code must retain the above copyright
11 .\"    notice, this list of conditions and the following disclaimer.
12 .\" 2. Redistributions in binary form must reproduce the above copyright
13 .\"    notice, this list of conditions and the following disclaimer in
14 .\"    the documentation and/or other materials provided with the
15 .\"    distribution.
16 .\" 3. Neither the name of The DragonFly Project nor the names of its
17 .\"    contributors may be used to endorse or promote products derived
18 .\"    from this software without specific, prior written permission.
19 .\" 
20 .\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21 .\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22 .\" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
23 .\" FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE
24 .\" COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
25 .\" INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING,
26 .\" BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
27 .\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
28 .\" AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
29 .\" OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
30 .\" OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 .\" SUCH DAMAGE.
32 .\" 
33 .\" $DragonFly: src/sbin/hammer/hammer.8,v 1.58 2008/11/13 02:04:27 dillon Exp $
34 .\"
35 .Dd October 22, 2008
36 .Dt HAMMER 8
37 .Os
38 .Sh NAME
39 .Nm hammer
40 .Nd HAMMER file system utility
41 .Sh SYNOPSIS
42 .Nm
43 .Op Fl h2qrv
44 .Op Fl b Ar bandwidth
45 .Op Fl c Ar cyclefile
46 .Op Fl f Ar blkdev[:blkdev]*
47 .\" .Op Fl s Ar linkpath
48 .Op Fl i Ar delay
49 .Op Fl t Ar seconds
50 .Ar command
51 .Op Ar argument ...
52 .Sh DESCRIPTION
53 This manual page documents the
54 .Nm
55 utility which provides miscellaneous functions related to managing a
56 .Nm HAMMER
57 file system.
58 For a general introduction to the
59 .Nm HAMMER
60 file system, its features, and
61 examples on how to set up and maintain one, see
62 .Xr HAMMER 5 .
63 .Pp
64 The options are as follows:
65 .Bl -tag -width indent
66 .It Fl h
67 Get help.
68 .It Fl 2
69 Tell the mirror commands to use a 2-way protocol, which allows
70 automatic negotiation of transaction id ranges.
71 This option is automatically enabled by the
72 .Ar mirror-copy
73 command.
74 .It Fl b Ar bandwidth
75 Specify a bandwidth limit in bytes per second for mirroring streams.
76 This option is typically used to prevent batch mirroring operations from
77 loading down the machine.
78 The bandwidth may be suffixed with
79 .Sq k ,
80 .Sq m ,
81 or
82 .Sq g
83 to specify values in kilobytes, megabytes, and gigabytes per second.
84 .It Fl c Ar cyclefile
85 When pruning and reblocking you can instruction
86 .Nm
87 to start at the object id stored in the specified file.
88 If the file does not exist
89 .Nm
90 will start at the beginning.
91 If
92 .Nm
93 is told to run for a
94 specific period of time and is unable to complete the operation it will
95 write out the current object id so the next run can pick up where it left off.
96 If
97 .Nm
98 runs to completion it will delete
99 .Ar cyclefile .
100 .It Fl f Ar blkdev[:blkdev]*
101 Specify the volumes making up a
102 .Nm HAMMER
103 file system.
104 .It Fl i Ar delay
105 When maintaining a streaming mirroring this option specifies the
106 minimum delay after a batch ends before the next batch is allowed
107 to start.
108 The default is five seconds.
109 .It Fl q
110 Decrease verbosement.
111 May be specified multiple times.
112 .It Fl r
113 Specify recursion for those commands which support it.
114 .It Fl t Ar seconds
115 When pruning and reblocking you can tell the utility to stop after a
116 certain period of time.
117 This option is used along with the
118 .Fl c Ar cyclefile
119 option to prune or reblock a portion of the file system incrementally.
120 .It Fl v
121 Increase verboseness.
122 May be specified multiple times.
123 .El
124 .Pp
125 The commands are as follows:
126 .Bl -tag -width indent
127 .\" ==== synctid ====
128 .It Ar synctid Ar filesystem Op quick
129 Generates a guaranteed, formal 64 bit transaction id representing the
130 current state of the specified
131 .Nm HAMMER
132 file system.
133 The file system will be synced to the media.
134 .Pp
135 If the
136 .Ar quick
137 keyword is specified the file system will be soft-synced, meaning that a
138 crash might still undo the state of the file system as of the transaction
139 id returned but any new modifications will occur after the returned
140 transaction id as expected.
141 .\" ==== bstats ====
142 .It Ar bstats Op interval
143 Output
144 .Nm HAMMER
145 B-tree statistics until interrupted.
146 Pause
147 .Ar interval
148 seconds between each display.
149 The default interval is one second.
150 .\" ==== iostats ====
151 .It Ar iostats Op interval
152 Output
153 .Nm HAMMER
154 I/O statistics until interrupted.
155 Pause
156 .Ar interval
157 seconds between each display.
158 The default interval is one second.
159 .\" ==== history ====
160 .It Ar history Ar path ...
161 Show the modification history for
162 .Nm HAMMER
163 file's inode and data.
164 .\" ==== show ====
165 .It Ar show
166 Dump the B-tree.
167 This command needs the
168 .Fl f
169 flag.
170 .\" .It Ar blockmap
171 .\" Dump the B-tree, record, large-data, and small-data blockmaps, showing
172 .\" physical block assignments and free space percentages.
173 .\" ==== namekey ====
174 .It Ar namekey Ar filename
175 Generate a
176 .Nm HAMMER
177 64 bit directory hash for the specified file name.
178 The low 32 bits are used as an iterator for hash collisions and will be
179 output as 0.
180 .\" ==== namekey32 ====
181 .It Ar namekey32 Ar filename
182 Generate the top 32 bits of a
183 .Nm HAMMER
184 64 bit directory hash for the specified file name.
185 .\" ==== cleanup ====
186 .It Ar cleanup Op Ar filesystem ...
187 This is a meta-command which executes snapshot, pruning, and reblocking
188 commands on the specified
189 .Nm HAMMER
190 file system.
191 If no
192 .Ar filesystem
193 is specified this command will clean-up all
194 .Nm HAMMER
195 file systems in use, including PFS's.
196 To do this it will scan all
197 .Nm HAMMER
198 and
199 .Nm null
200 mounts, extract PFS id's, and clean-up each PFS found.
201 .Pp
202 This command will by default access a
203 .Pa snapshots
204 subdirectory and a
205 .Pa snapshots/config
206 file for each
207 .Ar filesystem ,
208 creating them if necessary.
209 The format of the configuration file is:
210 .Bd -literal -offset indent
211 snapshots  <period> <retensiontime>
212 prune      <period> <max-runtime>
213 reblock    <period> <1/3 max-runtime>
214 recopy     <period> <1/3 max-runtime>
215
216 Defaults are:
217 snapshots  1d 60d  # 0d 60d  for PFS /tmp, /var/tmp, /usr/obj
218 prune      1d 5m
219 reblock    1d 5m
220 recopy     30d 10m
221 .Ed
222 .Pp
223 Time is given with a suffix of
224 .Cm d ,
225 .Cm h ,
226 .Cm m
227 or
228 .Cm s
229 meaning day, hour, minute and second.
230 A snapshots period of 0 disables snapshot generation and prunes using
231 .Ar prune-everything ,
232 if no snapshots exists.
233 A prune max-runtime of 0 means unlimited.
234 .Pp
235 If period hasn't passed since the previous
236 .Ar cleanup
237 run nothing is done.
238 For example a day has passed when midnight is passed (localtime).
239 By default,
240 .Dx
241 is set up to run
242 .Nm Ar cleanup
243 nightly via
244 .Xr periodic 8 .
245 .Pp
246 The default configuration file will create a daily snapshot, do a daily
247 pruning and reblocking run and a monthly recopy run.
248 Reblocking is defragmentation with a level of 95%,
249 and recopy is full defragmentation.
250 .Pp
251 By default prune and reblock operations are limited to 5 minutes per function,
252 and recopy operations are limited to 10 minutes per function.
253 Reblocking and recopy runs are each broken down into three separate functions
254 (btree, inodes and data)
255 and are thus by default limited to 15 and 30 minutes respectively.
256 Also note that this directive will by default disable snapshots on
257 the following PFS's:
258 .Pa /tmp ,
259 .Pa /var/tmp
260 and
261 .Pa /usr/obj .
262 .Pp
263 The defaults may be adjusted by modifying the
264 .Pa config
265 file.
266 The pruning and reblocking commands automatically maintain a cyclefile
267 for incremental operation.
268 If you interrupt (^C) the program the cyclefile will be updated, but a sub-command
269 may continue to run in the background for a few seconds until the
270 .Nm HAMMER
271 ioctl detects the interrupt.
272 The
273 .Ar snapshots
274 PFS option can be set to use another location for the snapshots directory.
275 .Pp
276 Work on this command is still in progress.
277 Expected additions:  An ability to remove snapshots dynamically as the
278 file system becomes full.
279 .\" ==== snapshot ====
280 .It Ar snapshot Oo Ar filesystem Oc Ar snapshot-dir
281 Takes a snapshot of the file system either explicitly given by
282 .Ar filesystem
283 or implicitly derived from the
284 .Ar snapshot-dir
285 argument and creates a symlink in the directory provided by
286 .Ar snapshot-dir
287 pointing to the snapshot.
288 If
289 .Ar snapshot-dir
290 is not a directory, it is assumed to be a format string passed to
291 .Xr strftime 3
292 with the current time as parameter.
293 If
294 .Ar snapshot-dir
295 refers to an existing directory, a default format string of "snap-%Y%d%m-%H%M"
296 is assumed and used as name for the newly created symlink.
297 .Pp
298 Snapshot is a per PFS operation, so a
299 .Nm HAMMER
300 file system and each PFS in it have to be snapshot separately.
301 .Pp
302 Example, assuming that
303 .Pa /mysnapshots
304 is on file system
305 .Pa /
306 and that
307 .Pa /obj
308 is a file system on its own, the following invocations:
309 .Bd -literal -offset indent
310 hammer snapshot /mysnapshots
311
312 hammer snapshot /mysnapshots/%Y-%m-%d
313
314 hammer snapshot /obj /mysnapshots/obj-%Y-%m-%d
315 .Ed
316 .Pp
317 would create symlinks similar to:
318 .Bd -literal -offset indent
319 /mysnapshots/snap-20080627-1210 -> /@@0x10d2cd05b7270d16
320
321 /mysnapshots/2008-06-27 -> /@@0x10d2cd05b7270d16
322
323 /mysnapshots/obj-2008-06-27 -> /obj@@0x10d2cd05b7270d16
324 .Ed
325 .\" ==== prune ====
326 .It Ar prune Ar softlink-dir
327 Prune the file system based on previously created snapshot softlinks.
328 Pruning is the act of deleting file system history.
329 The
330 .Ar prune
331 command
332 will delete file system history such that
333 the file system state is retained for the given snapshots,
334 and all history after the latest snapshot,
335 but all other history is deleted.
336 .Pp
337 The target directory is expected to contain softlinks pointing to
338 snapshots of the file systems you wish to retain.
339 The directory is scanned non-recursively and the mount points and
340 transaction ids stored in the softlinks are extracted and sorted.
341 The file system is then explicitly pruned according to what is found.
342 Cleaning out portions of the file system is as simple as removing a softlink
343 and then running the
344 .Ar prune
345 command.
346 .Pp
347 As a safety measure pruning only occurs if one or more softlinks are found
348 containing the @@ snapshot id extension.
349 Currently the scanned softlink directory must contain softlinks pointing
350 to a single
351 .Nm HAMMER
352 mount.
353 The softlinks may specify absolute or relative paths.
354 Softlinks must use 20-character (@@0x%016llx) transaction ids,
355 as might be returned from
356 .Dq Nm Ar synctid filesystem .
357 .Pp
358 Pruning is a per PFS operation, so a
359 .Nm HAMMER
360 file system and each PFS in it have to be pruned separately.
361 .Pp
362 Note that pruning a file system may not immediately free-up space,
363 though typically some space will be freed if a large number of records are
364 pruned out.
365 The file system must be reblocked to completely recover all available space.
366 .Pp
367 Example, lets say your snapshot directory contains the following links:
368 .Bd -literal -offset indent
369 lrwxr-xr-x  1 root  wheel  29 May 31 17:57 snap1 ->
370 /usr/obj/@@0x10d2cd05b7270d16
371
372 lrwxr-xr-x  1 root  wheel  29 May 31 17:58 snap2 ->
373 /usr/obj/@@0x10d2cd13f3fde98f
374
375 lrwxr-xr-x  1 root  wheel  29 May 31 17:59 snap3 ->
376 /usr/obj/@@0x10d2cd222adee364
377 .Ed
378 .Pp
379 If you were to run the
380 .Ar prune
381 command on this directory, then the
382 .Nm HAMMER
383 .Pa /usr/obj
384 mount will be pruned to retain the above three snapshots.
385 In addition, history for modifications made to the file system older than
386 the oldest snapshot will be destroyed and history for potentially fine-grained
387 modifications made to the file system more recently than the most recent
388 snapshot will be retained.
389 .Pp
390 If you then delete the
391 .Pa snap2
392 softlink and rerun the
393 .Ar prune
394 command,
395 history for modifications pertaining to that snapshot would be destroyed.
396 .\" ==== prune-everything ====
397 .It Ar prune-everything Ar filesystem
398 This command will remove all historical records from the file system.
399 This directive is not normally used on a production system.
400 .\" ==== reblock ====
401 .It Ar reblock Ar filesystem Op Ar fill_percentage
402 .It Ar reblock-btree Ar filesystem Op Ar fill_percentage
403 .It Ar reblock-inodes Ar filesystem Op Ar fill_percentage
404 .It Ar reblock-dirs Ar filesystem Op Ar fill_percentage
405 .It Ar reblock-data Ar filesystem Op Ar fill_percentage
406 Attempt to defragment and free space for reuse by reblocking a live
407 .Nm HAMMER
408 file system.
409 Big blocks cannot be reused by
410 .Nm HAMMER
411 until they are completely free.
412 This command also has the effect of reordering all elements, effectively
413 defragmenting the file system.
414 .Pp
415 The default fill percentage is 100% and will cause the file system to be
416 completely defragmented.
417 All specified element types will be reallocated and rewritten.
418 If you wish to quickly free up space instead try specifying
419 a smaller fill percentage, such as 90% or 80% (the
420 .Sq %
421 suffix is not needed).
422 .Pp
423 Since this command may rewrite the entire contents of the disk it is
424 best to do it incrementally from a
425 .Xr cron 8
426 job along with the
427 .Fl c Ar cyclefile
428 and
429 .Fl t Ar seconds
430 options to limit the run time.
431 The file system would thus be defragmented over long period of time.
432 .Pp
433 It is recommended that separate invocations be used for each data type.
434 B-tree nodes, inodes, and directories are typically the most important
435 elements needing defragmentation.
436 Data can be defragmented over a longer period of time.
437 .Pp
438 Reblocking is a per PFS operation, so a
439 .Nm HAMMER
440 file system and each PFS in it have to be reblocked separately.
441 .\" ==== pfs-status ====
442 .It Ar pfs-status Ar dirpath ...
443 Retrieve the mirroring configuration parameters for the specified
444 .Nm HAMMER
445 file systems or pseudo-filesystems (PFS's).
446 .\" ==== pfs-master ====
447 .It Ar pfs-master Ar dirpath Op options
448 Create a pseudo-filesystem (PFS) inside a
449 .Nm HAMMER
450 file system.
451 Up to 65535 such file systems can be created.
452 Each PFS uses an independent inode numbering space making it suitable
453 for use as a replication source or target.
454 .Pp
455 The
456 .Ar pfs-master
457 directive creates a PFS that you can read, write, and use as a mirroring
458 source.
459 .Pp
460 It is recommended to use a
461 .Nm null
462 mount to access a PFS, for more information see
463 .Xr HAMMER 5 .
464 .\" ==== pfs-slave ====
465 .It Ar pfs-slave Ar dirpath Op options
466 Create a pseudo-filesystem (PFS) inside a
467 .Nm HAMMER
468 file system.
469 Up to 65535 such file systems can be created.
470 Each PFS uses an independent inode numbering space making it suitable
471 for use as a replication source or target.
472 .Pp
473 The
474 .Ar pfs-slave
475 directive creates a PFS that you can use as a mirroring target.
476 You will not be able to access a slave PFS until you have completed the
477 first mirroring operation with it as the target (its root directory will
478 not exist until then).
479 .Pp
480 Access to the pfs-slave via the special softlink,
481 as described in the
482 .Sx PFS NOTES
483 below, allows
484 .Nm HAMMER
485 to
486 dynamically modify the snapshot transaction id by returning a dynamic result
487 from
488 .Xr readlink 2
489 calls.
490 .Pp
491 A PFS can only be truly destroyed with the
492 .Ar pfs-destroy
493 directive.
494 Removing the softlink will not destroy the underlying PFS.
495 .Pp
496 It is recommended to use a
497 .Nm null
498 mount to access a PFS, for more information see
499 .Xr HAMMER 5 .
500 .\" ==== pfs-update ====
501 .It Ar pfs-update Ar dirpath Op options
502 Update the configuration parameters for an existing
503 .Nm HAMMER
504 file system
505 or pseudo-filesystem.
506 Options that may be specified:
507 .Bl -tag -width indent
508 .It sync-beg-tid=0x16llx
509 This is the automatic snapshot access starting transaction id for
510 mirroring slaves.
511 This parameter is normally updated automatically by the
512 .Ar mirror-write
513 directive.
514 .Pp
515 It is important to note that accessing a mirroring slave
516 with a transaction id greater than the last fully synchronized transaction
517 id can result in an unreliable snapshot since you will be accessing
518 data that is still undergoing synchronization.
519 .Pp
520 Manually modifying this field is dangerous and can result in a broken
521 mirror.
522 .It sync-end-tid=0x16llx
523 This is the current synchronization point for mirroring slaves.
524 This parameter is normally updated automatically by the
525 .Ar mirror-write
526 directive.
527 .Pp
528 Manually modifying this field is dangerous and can result in a broken mirror.
529 .It shared-uuid=<uuid>
530 Set the shared UUID for this file system.
531 All mirrors must have the same shared UUID.
532 For safety purposes the
533 .Ar mirror-write
534 directives will refuse to operate on a target with a different shared UUID.
535 .Pp
536 Changing the shared UUID on an existing, non-empty mirroring target,
537 including an empty but not completely pruned target,
538 can lead to corruption of the mirroring target.
539 .It unique-uuid=<uuid>
540 Set the unique UUID for this file system.
541 This UUID should not be used anywhere else,
542 even on exact copies of the file system.
543 .It label=<string>
544 Set a descriptive label for this file system.
545 .It snapshots=<string>
546 Specify the snapshots directory which
547 .Nm
548 .Ar cleanup
549 will use to manage this PFS.
550 The snapshots directory does not need to be configured for
551 PFS masters and will default to
552 .Pa <pfs>/snapshots .
553 .Pp
554 PFS slaves are mirroring slaves so you cannot configure a snapshots
555 directory on the slave itself to be managed by the slave's machine.
556 In fact, the slave will likely have a
557 .Pa snapshots
558 sub-directory mirrored
559 from the master, but that directory contains the configuration the master
560 is using for its copy of the file system, not the configuration that we
561 want to use for our slave.
562 .Pp
563 It is recommended that
564 .Pa <fs>/var/slaves/<name>
565 be configured for a PFS slave, where
566 .Pa <fs>
567 is the base
568 .Nm HAMMER
569 file system, and
570 .Pa <name>
571 is an appropriate label.
572 You can control snapshot retention on your slave independent of the master.
573 .It snapshots-clear
574 Zero out the snapshots directory path for this PFS.
575 .El
576 .\" ==== pfs-upgrade ====
577 .It Ar pfs-upgrade Ar dirpath
578 Upgrade a PFS from slave to master operation.
579 The PFS will be rolled back to the current end synchronization tid
580 (removing any partial synchronizations), and will then become writable.
581 .Pp
582 .Em WARNING!
583 .Nm HAMMER
584 currently supports only single masters and using
585 this command can easily result in file system corruption
586 if you don't know what you are doing.
587 .Pp
588 This directive will refuse to run if any programs have open descriptors
589 in the PFS, including programs chdir'd into the PFS.
590 .\" ==== pfs-downgrade ====
591 .It Ar pfs-downgrade Ar dirpath
592 Downgrade a master PFS from master to slave operation
593 The PFS becomes read-only and access will be locked to its
594 .Ar sync-end-tid .
595 .Pp
596 This directive will refuse to run if any programs have open descriptors
597 in the PFS, including programs chdir'd into the PFS.
598 .\" ==== pfs-destroy ====
599 .It Ar pfs-destroy Ar dirpath
600 This permanently destroys a PFS.
601 .Pp
602 This directive will refuse to run if any programs have open descriptors
603 in the PFS, including programs chdir'd into the PFS.
604 .\" ==== mirror-read ====
605 .It Ar mirror-read Ar filesystem Op Ar <begin-tid>
606 Generate a mirroring stream to stdout.
607 The stream ends when the transaction id space has been exhausted.
608 .\" ==== mirror-read-stream ====
609 .It Ar mirror-read-stream Ar filesystem Op Ar <begin-tid>
610 Generate a mirroring stream to stdout.
611 Upon completion the stream is paused until new data is synced to the
612 master, then resumed.
613 Operation continues until the pipe is broken.
614 .\" ==== mirror-write ====
615 .It Ar mirror-write Ar filesystem
616 Take a mirroring stream on stdin.
617 .Pp
618 This command will fail if the
619 .Ar shared-uuid
620 configuration field for the two file systems do not match.
621 .Pp
622 If the target PFS does not exist this command will ask you whether
623 you want to create a compatible PFS slave for the target or not.
624 .\" ==== mirror-dump ====
625 .It Ar mirror-dump
626 A
627 .Ar mirror-read
628 can be piped into a
629 .Ar mirror-dump
630 to dump an ASCII representation of the mirroring stream.
631 .\" ==== mirror-copy ====
632 .It Ar mirror-copy Ar [[user@]host:]filesystem Ar [[user@]host:]filesystem
633 This is a shortcut which pipes a
634 .Ar mirror-read
635 command to a
636 .Ar mirror-write
637 command.
638 If a remote host specification is made the program forks a
639 .Xr ssh 1
640 and execs the
641 .Ar mirror-read
642 and/or
643 .Ar mirror-write
644 on the appropriate host.
645 The source may be a master or slave PFS, and the target must be a slave PFS.
646 .Pp
647 This command also established full duplex communication and turns on
648 the two-way protocol feature which automatically negotiates transaction id
649 ranges without having to use a cyclefile.
650 If the operation completes successfully the target PFS's
651 .Ar sync-end-tid
652 will be updated.
653 Note that you must re-chdir into the target PFS to see the updated information.
654 If you do not you will still be in the previous snapshot.
655 .Pp
656 If the target PFS does not exist this command will ask you whether
657 you want to create a compatible PFS slave for the target or not.
658 .\" ==== mirror-stream ====
659 .It Ar mirror-stream Ar [[user@]host:]filesystem Ar [[user@]host:]filesystem
660 This command works similarly to
661 .Ar mirror-copy
662 but does not exit unless the pipe is broken.
663 This command will resume the mirroring operation whenever the master is synced.
664 The command is commonly used with
665 .Fl i Ar delay
666 and
667 .Fl b Ar bandwidth
668 options to keep the mirroring target in sync with the source on a continuing
669 basis.
670 .\" ==== version ====
671 .It Ar version Ar filesystem
672 This command returns the HAMMER filesystem version for the specified
673 filesystem as well as the range of versions supported in the kernel.
674 The
675 .Fl q
676 option may be used to remove the summary at the end.
677 .\" ==== version-upgrade ====
678 .It Ar version-upgrade Ar filesystem Ar version Op Ar force
679 This command upgrades the HAMMER filesystem to the specified version.
680 Once upgraded a filesystem may not be downgraded.
681 If you wish to upgrade a filesystem to a version greater or equal to the
682 work-in-progress version number you must specify the
683 .Ar force
684 directive.
685 Use of WIP versions should be relegated to testing and may require wiping
686 the filesystem as development progresses, even though the WIP version might
687 not change.
688 .Pp
689 NOTE!  This command operates on the entire HAMMER filesystem and is not a
690 per-PFS operation.  All PFS's will be affected.
691 .Bl -tag -width indent
692 .It 1
693 DragonFly-2.0 default version, first HAMMER release.
694 .It 2
695 Work-in-progress version.
696 This version is developing a new directory hash key.
697 .El
698 .El
699 .\".Sh EXAMPLES
700 .Sh PSEUDO FILESYSTEM (PFS) NOTES
701 The root of a PFS is not hooked into the primary
702 .Nm HAMMER
703 file system as a directory.
704 Instead,
705 .Nm HAMMER
706 creates a special softlink called "@@PFS%05d" (exactly 10 characters long)
707 in the primary
708 .Nm HAMMER
709 file system.
710 .Nm HAMMER
711 then modifies the contents of the softlink as read by
712 .Xr readlink 2 ,
713 and thus what you see with an
714 .Xr ls 1
715 command or if you were to
716 .Xr cd 1
717 into the link.
718 If the PFS is a master the link reflects the current state of the PFS.
719 If the PFS is a slave the link reflects the last completed snapshot, and the
720 contents of the link will change when the next snapshot is completed, and
721 so forth.
722 .Pp
723 PFS support is currently very new and experimental.
724 The
725 .Nm
726 utility employs numerous safeties to reduce user foot-shooting.
727 The
728 .Ar mirror-copy
729 directive requires that the target be configured as a slave and that the
730 .Ar shared-uuid
731 field of the mirroring source and target match.
732 .Sh DIAGNOSTICS
733 .Ex -std
734 .Sh FILES
735 .Bl -tag -width ".It Pa <fs>/var/slaves/<name>" -compact
736 .It Pa snapshots
737 default per PFS snapshots directory
738 .It Pa <snapshots>/config
739 .Nm
740 .Ar cleanup
741 configuration file
742 .It Pa <fs>/var/slaves/<name>
743 recommended slave PFS snapshots directory
744 .El
745 .Sh SEE ALSO
746 .Xr undo 1 ,
747 .Xr HAMMER 5 ,
748 .Xr periodic.conf 5 ,
749 .Xr mount_hammer 8 ,
750 .Xr mount_null 8 ,
751 .Xr newfs_hammer 8
752 .Sh HISTORY
753 The
754 .Nm
755 utility first appeared in
756 .Dx 1.11 .
757 .Sh AUTHORS
758 .An Matthew Dillon Aq dillon@backplane.com