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