.\"
.\" $DragonFly: src/sbin/hammer/hammer.8,v 1.58 2008/11/13 02:04:27 dillon Exp $
.\"
-.Dd November 5, 2009
+.Dd November 14, 2009
.Dt HAMMER 8
.Os
.Sh NAME
.Op Fl b Ar bandwidth
.Op Fl C Ar cachesize Ns Op Ns Cm \&: Ns Ar readahead
.Op Fl c Ar cyclefile
-.Op Fl f Ar blkdev Ns Oo Ns Cm \&: Ns Ar blkdev Oc Ns *
+.Op Fl f Ar blkdevs
.\" .Op Fl s Ar linkpath
.Op Fl i Ar delay
.Op Fl t Ar seconds
.Nm
runs to completion it will delete
.Ar cyclefile .
-.It Fl f Ar blkdev Ns Oo Ns Cm \&: Ns Ar blkdev Oc Ns *
+.It Fl f Ar blkdevs
Specify the volumes making up a
.Nm HAMMER
file system.
+.Ar Blkdevs
+is a colon-separated list of devices, each specifying a
+.Nm HAMMER
+volume.
.It Fl i Ar delay
When maintaining a streaming mirroring this option specifies the
minimum delay after a batch ends before the next batch is allowed
in column 1 along with various
other error flags.
.Pp
-If you specify a localization and object id field the dump will
+If you specify a localization and object id field,
+.Ar lo Ns Cm \&: Ns Ar objid ,
+the dump will
search for the key printing nodes as it recurses down, and then
will iterate forwards.
.Pp
This command needs the
.Fl f
flag.
+.\" ==== show-undo ====
+.It Cm show-undo
+.Nm ( HAMMER
+VERSION 4+)
+Dump the UNDO map.
+.Pp
+This command needs the
+.Fl f
+flag.
.\" .It Ar blockmap
.\" Dump the B-tree, record, large-data, and small-data blockmaps, showing
.\" physical block assignments and free space percentages.
in the snapshots directory which defaults to
.Pa <pfs>/snapshots .
.It Nm HAMMER No version 3+
-The configuration file is saved in filesystem meta-data.
+The configuration file is saved in file system meta-data, see
+.Nm
+.Cm config .
The snapshots directory defaults to
.Pa /var/hammer/<pfs>
.Pa ( /var/hammer/root
If zero or one arguments are specified this function dumps the current
configuration file to stdout.
Zero arguments specifies the PFS containing the current directory.
-This configuration file is stored in filesystem meta-data.
+This configuration file is stored in file system meta-data.
If two arguments are specified this function installs a new config file.
.Pp
In
.Nm HAMMER
versions less than 3 the configuration file is by default stored in
.Pa <pfs>/snapshots/config ,
-but in all later versions the configuration file is stored in filesystem
+but in all later versions the configuration file is stored in file system
meta-data.
.\" ==== viconfig ====
.It Cm viconfig Op Ar filesystem
.Nm ( HAMMER
VERSION 3+)
-Edit the configuration file and reinstall into filesystem meta-data when done.
+Edit the configuration file and reinstall into file system meta-data when done.
Zero arguments specifies the PFS containing the current directory.
.\" ==== expand ====
.It Cm expand Ar filesystem Ar device
.Ar device
contains a valid
.Nm HAMMER
-filesystem, formatting will be denied.
+file system, formatting will be denied.
You can overcome this sanity check
by using
.Xr dd 1
to erase the beginning sectors of the device.
Also remember that you have to specify
.Ar device ,
-together with any other device that make the filesystem, colon-separated to
+together with any other device that make up the file system,
+colon-separated to
+.Pa /etc/fstab
+and
.Xr mount_hammer 8 .
.\" ==== snapshot ====
.It Cm snapshot Oo Ar filesystem Oc Ar snapshot-dir
.Pp
When run on a
.Nm HAMMER
-version 3+ filesystem the snapshot is also recorded in meta-data
+version 3+ file system the snapshot is also recorded in file system meta-data
along with the optional
.Ar note .
See the
The path will be used as-is as a prefix in the path output to stdout.
As with the other
snap and snapshot directives the snapshot transaction id will be registered
-in the filesystem meta-data.
+in the file system meta-data.
.It Cm snaprm Bro Ar path | transid Brc Ar ...
.Nm ( HAMMER
VERSION 3+)
Remove a snapshot given its softlink or transaction id.
If specifying a transaction id
-the snapshot is removed from filesystem meta-data but you are responsible
+the snapshot is removed from file system meta-data but you are responsible
for removing any related softlinks.
.It Cm snapls Op Ar path ...
.Nm ( HAMMER
listing all available snapshots and their notes.
If no arguments are specified snapshots for the PFS containing the
current directory are listed.
-This is the definitive list of snapshots for the filesystem.
+This is the definitive list of snapshots for the file system.
.\" ==== prune ====
.It Cm prune Ar softlink-dir
Prune the file system based on previously created snapshot softlinks.
.Pp
In
.Nm HAMMER
-filesystem versions 3+ this command also scans the snapshots stored
-in the filesystem meta-data and includes them in the prune.
+file system versions 3+ this command also scans the snapshots stored
+in the file system meta-data and includes them in the prune.
.\" ==== prune-everything ====
.It Cm prune-everything Ar filesystem
This command will remove all historical records from the file system.
This directive is not normally used on a production system.
.Pp
This command does not remove snapshot softlinks but will delete all
-snapshots recorded in filesystem meta-data (for filesystem version 3+).
+snapshots recorded in file system meta-data (for file system version 3+).
The user is responsible for deleting any softlinks.
.\" ==== rebalance ====
-.It Cm rebalance Ar filesystem Op Ar saturation_level
+.It Cm rebalance Ar filesystem Op Ar saturation_percentage
This command will rebalance the B-tree, nodes with small number of
elements will be combined and element counts will be smoothed out
between nodes.
.Pp
-The saturation level is a percentage between 50 and 100.
-The default is 75 percent.
+The saturation percentage is between 50% and 100%.
+The default is 75% (the
+.Sq %
+suffix is not needed).
.\" ==== reblock* ====
.It Cm reblock Ar filesystem Op Ar fill_percentage
.It Cm reblock-btree Ar filesystem Op Ar fill_percentage
.\" ==== mirror-copy ====
.\".It Cm mirror-copy Ar [[user@]host:]filesystem [[user@]host:]filesystem
.It Cm mirror-copy \
-Oo Oo Ar user Oc Ns Cm @ Ns Ar host Ns Cm \&: Oc Ns Ar filesystem \
-Oo Oo Ar user Oc Ns Cm @ Ns Ar host Ns Cm \&: Oc Ns Ar filesystem
+Oo Oo Ar user Ns Cm @ Oc Ns Ar host Ns Cm \&: Oc Ns Ar filesystem \
+Oo Oo Ar user Ns Cm @ Oc Ns Ar host Ns Cm \&: Oc Ns Ar filesystem
This is a shortcut which pipes a
.Cm mirror-read
command to a
.\" ==== mirror-stream ====
.\".It Cm mirror-stream Ar [[user@]host:]filesystem [[user@]host:]filesystem
.It Cm mirror-stream \
-Oo Oo Ar user Oc Ns Cm @ Ns Ar host Ns Cm \&: Oc Ns Ar filesystem \
-Oo Oo Ar user Oc Ns Cm @ Ns Ar host Ns Cm \&: Oc Ns Ar filesystem
+Oo Oo Ar user Ns Cm @ Oc Ns Ar host Ns Cm \&: Oc Ns Ar filesystem \
+Oo Oo Ar user Ns Cm @ Oc Ns Ar host Ns Cm \&: Oc Ns Ar filesystem
This command works similarly to
.Cm mirror-copy
but does not exit after the initial mirroring completes.
.Cm force
directive.
Use of WIP versions should be relegated to testing and may require wiping
-the filesystem as development progresses, even though the WIP version might
+the file system as development progresses, even though the WIP version might
not change.
.Pp
.Em NOTE!
.Nm HAMMER
release.
.It 2
-.Dx 2.3
-default version, new directory entry layout.
+.Dx 2.3 .
+New directory entry layout.
This version is using a new directory hash key.
.It 3
-.Dx 2.5 .
-New snapshot management, using filesystem meta-data for saving
+.Dx 2.5
+default version.
+New snapshot management, using file system meta-data for saving
configuration file and snapshots (transaction ids etc.).
Also default snapshots directory has changed.
.It 4
field of the mirroring source and target match.
.Sh UPGRADE INSTRUCTIONS HAMMER V1 TO V2
This upgrade changes the way directory entries are stored.
-It is possible to upgrade a V1 filesystem to V2 in place, but
+It is possible to upgrade a V1 file system to V2 in place, but
directories created prior to the upgrade will continue to use
the old layout.
.Pp
Any directories created after upgrading will use a new layout.
.Sh UPGRADE INSTRUCTIONS HAMMER V2 TO V3
This upgrade adds meta-data elements to the B-Tree.
-It is possible to upgrade a V2 filesystem to V3 in place.
+It is possible to upgrade a V2 file system to V3 in place.
After issuing the upgrade be sure to run a
.Nm
.Cm cleanup
The new snapshots hierarchy is designed to work with
both master and slave PFSs equally well.
.Pp
-In addition, the old config file will be moved to meta-data,
+In addition, the old config file will be moved to file system meta-data,
editable via the new
.Nm
.Cm viconfig
The old config file will be deleted.
Migration occurs only once.
.Pp
-The V3 filesystem has new
+The V3 file system has new
.Cm snap*
directives for creating snapshots.
All snapshot directives, including the original, will create
expire them the same way it expires softlinks.
If you by accident blow away your snapshot softlinks you can use the
.Cm snapls
-directive to get a definitive list from the meta-data and
+directive to get a definitive list from the file system meta-data and
regenerate them from that list.
.Pp
.Em WARNING!
If you are using
.Nm
-to backup filesystems your scripts may be using the
+to backup file systems your scripts may be using the
.Cm synctid
directive to generate transaction ids.
This directive does not create a snapshot.
The older
.Cm snapshot
directive will continue to work as expected and in V3 it will also
-record the snapshot transaction id in meta-data.
+record the snapshot transaction id in file system meta-data.
You may also want to make use of the new
.Ar note
tag for the meta-data.
char *volname;
if (blkdevs == NULL) {
- errx(1, "A -f blkdev[:blkdev]* specification is required "
+ errx(1, "A -f blkdevs specification is required "
"for this command");
}
fprintf(stderr,
"hammer -h\n"
"hammer [-2Bqrvy] [-b bandwidth] [-C cachesize[:readahead]] [-c cyclefile]\n"
- " [-f blkdev[:blkdev]*] [-i delay] [-t seconds] command [argument ...]\n"
+ " [-f blkdevs] [-i delay] [-t seconds] command [argument ...]\n"
"hammer synctid <filesystem> [quick]\n"
- "hammer -f blkdev[:blkdev]* blockmap\n"
+ "hammer -f blkdevs blockmap\n"
"hammer bstats [interval]\n"
"hammer iostats [interval]\n"
"hammer history[@offset[,len]] <file> ...\n"
- "hammer -f blkdev[:blkdev]* [-r] [-vvv] show [lo:objid]\n"
+ "hammer -f blkdevs [-qqq] show [lo:objid]\n"
"hammer namekey1 <path>\n"
"hammer namekey2 <path>\n"
"hammer namekey32 <path>\n"
"hammer expand <filesystem> <device>\n"
);
- fprintf(stderr, "\nHAMMER utility version 3+ commands:\n\n");
+ fprintf(stderr, "\nHAMMER utility version 3+ commands:\n");
fprintf(stderr,
"hammer config [<filesystem> [<configfile>]]\n"
"hammer viconfig [<filesystem>]\n"
- "hammer snap <path> [<note>]\t\tas 'hammer snapshot' above but\n"
- " \t\t\tpoints to base of PFS\n"
- "hammer snaplo <path> [<note>]\t\tcreate in dir or softlink to create\n"
- " \t\t\tpoints to target directory\n"
- "hammer snapq <dir> [<note>]\t\tsnapshot path is output to stdout\n"
- "hammer snaprm {<path> | <transid>} ...\tpath to softlink or transaction id\n"
- "hammer snapls [<path> ...]\t\tlist all hard snapshots in PFS\n"
+ "hammer snap <path> [<note>]\n"
+ "hammer snaplo <path> [<note>]\n"
+ "hammer snapq <dir> [<note>]\n"
+ "hammer snaprm {<path> | <transid>} ...\n"
+ "hammer snapls [<path> ...]\n"
+ );
+
+ fprintf(stderr, "\nHAMMER utility version 4+ commands:\n");
+
+ fprintf(stderr,
+ "hammer -f blkdevs show-undo\n"
);
exit(exit_code);