HAMMER - Implement volume-list command
[dragonfly.git] / sbin / hammer / hammer.c
CommitLineData
0dfeb6c8
MD
1/*
2 * Copyright (c) 2007 The DragonFly Project. All rights reserved.
3 *
4 * This code is derived from software contributed to The DragonFly Project
5 * by Matthew Dillon <dillon@backplane.com>
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
9 * are met:
10 *
11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in
15 * the documentation and/or other materials provided with the
16 * distribution.
17 * 3. Neither the name of The DragonFly Project nor the names of its
18 * contributors may be used to endorse or promote products derived
19 * from this software without specific, prior written permission.
20 *
21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
24 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
25 * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
26 * INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING,
27 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
29 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
30 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
31 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 * SUCH DAMAGE.
33 *
de1c0b31 34 * $DragonFly: src/sbin/hammer/hammer.c,v 1.44 2008/11/13 02:04:27 dillon Exp $
0dfeb6c8
MD
35 */
36
61aeeb33 37#include "hammer.h"
0006adae 38#include <signal.h>
d71afe7b 39#include <math.h>
9c9ac2f1 40#include <fstab.h>
0dfeb6c8 41
d38ab092 42static void hammer_parsedevs(const char *blkdevs);
0006adae 43static void sigalrm(int signo);
445faa69 44static void sigintr(int signo);
0dfeb6c8
MD
45static void usage(int exit_code);
46
d38ab092 47int RecurseOpt;
563b4845 48int VerboseOpt;
e95314de 49int QuietOpt;
d71afe7b 50int NoSyncOpt;
243ca327
MD
51int TwoWayPipeOpt;
52int TimeoutOpt;
48eadef9 53int DelayOpt = 5;
6c45ca3e 54char *SshPort;
07485271 55int ForceYesOpt = 0;
3a998207 56int CompressOpt;
e7f926a5 57int ForceOpt;
445faa69
MD
58int RunningIoctl;
59int DidInterrupt;
0bd7a37c 60int BulkOpt;
48eadef9 61u_int64_t BandwidthOpt;
527a7bdb 62u_int64_t SplitupOpt = 4ULL * 1024ULL * 1024ULL * 1024ULL;
d7ae405c 63const char *CyclePath;
da804f11 64const char *LinkPath;
d38ab092 65
0dfeb6c8
MD
66int
67main(int ac, char **av)
68{
d38ab092 69 char *blkdevs = NULL;
48eadef9
MD
70 char *ptr;
71 u_int32_t status;
72 int ch;
0faa08a1 73 int cacheSize = 0;
0dfeb6c8 74
3d7b2393 75 while ((ch = getopt(ac, av, "b:c:dhf:i:p:qrs:t:v2yBC:FS:X")) != -1) {
0dfeb6c8 76 switch(ch) {
243ca327
MD
77 case '2':
78 TwoWayPipeOpt = 1;
79 break;
07485271
MN
80 case 'y':
81 ForceYesOpt = 1;
82 break;
48eadef9
MD
83 case 'b':
84 BandwidthOpt = strtoull(optarg, &ptr, 0);
85 switch(*ptr) {
86 case 'g':
87 case 'G':
88 BandwidthOpt *= 1024;
89 /* fall through */
90 case 'm':
91 case 'M':
92 BandwidthOpt *= 1024;
93 /* fall through */
94 case 'k':
95 case 'K':
96 BandwidthOpt *= 1024;
97 break;
224ac2f2
MD
98 case '\0':
99 /* bytes per second if no suffix */
100 break;
48eadef9
MD
101 default:
102 usage(1);
103 }
104 break;
3d7b2393
MD
105 case 'S':
106 SplitupOpt = strtoull(optarg, &ptr, 0);
107 switch(*ptr) {
108 case 'g':
109 case 'G':
110 SplitupOpt *= 1024;
111 /* fall through */
112 case 'm':
113 case 'M':
114 SplitupOpt *= 1024;
115 /* fall through */
116 case 'k':
117 case 'K':
118 SplitupOpt *= 1024;
119 break;
120 case '\0':
121 /* bytes per second if no suffix */
122 break;
123 default:
124 usage(1);
125 }
126 break;
d7ae405c
MD
127 case 'c':
128 CyclePath = optarg;
129 break;
ba7b52c9
MD
130 case 'd':
131 ++DebugOpt;
132 break;
0dfeb6c8
MD
133 case 'h':
134 usage(0);
135 /* not reached */
48eadef9
MD
136 case 'i':
137 DelayOpt = strtol(optarg, NULL, 0);
138 break;
6c45ca3e
MD
139 case 'p':
140 SshPort = optarg;
141 break;
d38ab092
MD
142 case 'r':
143 RecurseOpt = 1;
144 break;
145 case 'f':
146 blkdevs = optarg;
147 break;
da804f11
MD
148 case 's':
149 LinkPath = optarg;
150 break;
0006adae 151 case 't':
243ca327 152 TimeoutOpt = strtol(optarg, NULL, 0);
0006adae 153 break;
563b4845 154 case 'v':
e95314de
MD
155 if (QuietOpt > 0)
156 --QuietOpt;
157 else
158 ++VerboseOpt;
159 break;
160 case 'q':
161 if (VerboseOpt > 0)
162 --VerboseOpt;
163 else
164 ++QuietOpt;
563b4845 165 break;
0bd7a37c
MD
166 case 'B':
167 BulkOpt = 1;
168 break;
0faa08a1
MD
169 case 'C':
170 cacheSize = strtol(optarg, &ptr, 0);
171 switch(*ptr) {
172 case 'm':
173 case 'M':
174 cacheSize *= 1024;
175 /* fall through */
176 case 'k':
177 case 'K':
178 cacheSize *= 1024;
b46b99bf 179 ++ptr;
0faa08a1
MD
180 break;
181 case '\0':
b46b99bf 182 case ':':
0faa08a1
MD
183 /* bytes if no suffix */
184 break;
185 default:
186 usage(1);
187 }
b46b99bf
MD
188 if (*ptr == ':') {
189 UseReadAhead = strtol(ptr + 1, NULL, 0);
190 UseReadBehind = -UseReadAhead;
191 }
0faa08a1
MD
192 if (cacheSize < 1024 * 1024)
193 cacheSize = 1024 * 1024;
b46b99bf
MD
194 if (UseReadAhead < 0)
195 usage(1);
196 if (UseReadAhead * HAMMER_BUFSIZE / cacheSize / 16) {
197 UseReadAhead = cacheSize / 16 / HAMMER_BUFSIZE;
198 UseReadBehind = -UseReadAhead;
199 }
0faa08a1
MD
200 hammer_cache_set(cacheSize);
201 break;
e7f926a5
MD
202 case 'F':
203 ForceOpt = 1;
204 break;
3a998207
MD
205 case 'X':
206 CompressOpt = 1;
207 break;
0dfeb6c8
MD
208 default:
209 usage(1);
210 /* not reached */
211 }
212 }
213 ac -= optind;
214 av += optind;
215 if (ac < 1) {
216 usage(1);
217 /* not reached */
218 }
219
243ca327 220 signal(SIGALRM, sigalrm);
445faa69 221 signal(SIGINT, sigintr);
0006adae 222
367431cf
MD
223 if (strcmp(av[0], "synctid") == 0) {
224 hammer_cmd_synctid(av + 1, ac - 1);
225 exit(0);
226 }
5e435c92
MD
227 if (strcmp(av[0], "namekey2") == 0) {
228 int64_t key;
229 int32_t crcx;
230 int len;
231 const char *aname = av[1];
232
233 if (aname == NULL)
234 usage(1);
235 len = strlen(aname);
236 key = (u_int32_t)crc32(aname, len) & 0xFFFFFFFEU;
237
238 switch(len) {
239 default:
240 crcx = crc32(aname + 3, len - 5);
241 crcx = crcx ^ (crcx >> 6) ^ (crcx >> 12);
242 key |= (int64_t)(crcx & 0x3F) << 42;
243 /* fall through */
244 case 5:
245 case 4:
246 /* fall through */
247 case 3:
248 key |= ((int64_t)(aname[2] & 0x1F) << 48);
249 /* fall through */
250 case 2:
251 key |= ((int64_t)(aname[1] & 0x1F) << 53) |
252 ((int64_t)(aname[len-2] & 0x1F) << 37);
253 /* fall through */
254 case 1:
255 key |= ((int64_t)(aname[0] & 0x1F) << 58) |
256 ((int64_t)(aname[len-1] & 0x1F) << 32);
257 /* fall through */
258 case 0:
259 break;
260 }
261 if (key == 0)
262 key |= 0x100000000LL;
a276dc6b 263 printf("0x%016jx\n", (uintmax_t)key);
5e435c92
MD
264 exit(0);
265 }
266 if (strcmp(av[0], "namekey1") == 0) {
cbd800c2
MD
267 int64_t key;
268
269 if (av[1] == NULL)
270 usage(1);
271 key = (int64_t)(crc32(av[1], strlen(av[1])) & 0x7FFFFFFF) << 32;
272 if (key == 0)
273 key |= 0x100000000LL;
a276dc6b 274 printf("0x%016jx\n", (uintmax_t)key);
cbd800c2
MD
275 exit(0);
276 }
277 if (strcmp(av[0], "namekey32") == 0) {
278 int32_t key;
279
280 if (av[1] == NULL)
281 usage(1);
282 key = crc32(av[1], strlen(av[1])) & 0x7FFFFFFF;
283 if (key == 0)
284 ++key;
285 printf("0x%08x\n", key);
286 exit(0);
287 }
34ebae70
MD
288 if (strcmp(av[0], "pfs-status") == 0) {
289 hammer_cmd_pseudofs_status(av + 1, ac - 1);
290 exit(0);
291 }
d4e5b69b
MD
292 if (strcmp(av[0], "pfs-master") == 0) {
293 hammer_cmd_pseudofs_create(av + 1, ac - 1, 0);
294 exit(0);
295 }
296 if (strcmp(av[0], "pfs-slave") == 0) {
297 hammer_cmd_pseudofs_create(av + 1, ac - 1, 1);
34ebae70
MD
298 exit(0);
299 }
300 if (strcmp(av[0], "pfs-update") == 0) {
d4e5b69b 301 hammer_cmd_pseudofs_update(av + 1, ac - 1);
66db8054
MD
302 exit(0);
303 }
9c67b4d2
MD
304 if (strcmp(av[0], "pfs-upgrade") == 0) {
305 hammer_cmd_pseudofs_upgrade(av + 1, ac - 1);
306 exit(0);
307 }
308 if (strcmp(av[0], "pfs-downgrade") == 0) {
309 hammer_cmd_pseudofs_downgrade(av + 1, ac - 1);
310 exit(0);
311 }
243ca327
MD
312 if (strcmp(av[0], "pfs-destroy") == 0) {
313 hammer_cmd_pseudofs_destroy(av + 1, ac - 1);
314 exit(0);
315 }
a7fbbf91
MD
316 if (strcmp(av[0], "status") == 0) {
317 hammer_cmd_status(av + 1, ac - 1);
318 exit(0);
319 }
13ce745d 320 if (strcmp(av[0], "prune") == 0) {
b5aaba7f 321 hammer_cmd_softprune(av + 1, ac - 1, 0);
13ce745d
MD
322 exit(0);
323 }
83f2a3aa
MD
324 if (strcmp(av[0], "config") == 0) {
325 hammer_cmd_config(av + 1, ac - 1);
326 exit(0);
327 }
328 if (strcmp(av[0], "viconfig") == 0) {
329 hammer_cmd_viconfig(av + 1, ac - 1);
330 exit(0);
331 }
6a6e350f
MD
332 if (strcmp(av[0], "cleanup") == 0) {
333 hammer_cmd_cleanup(av + 1, ac - 1);
334 exit(0);
335 }
b66b9421 336 if (strcmp(av[0], "info") == 0) {
eac446c5 337 hammer_cmd_info();
b66b9421
AH
338 exit(0);
339 }
b5aaba7f
MD
340 if (strcmp(av[0], "prune-everything") == 0) {
341 hammer_cmd_softprune(av + 1, ac - 1, 1);
e8969ef0
MD
342 exit(0);
343 }
83f2a3aa
MD
344 if (strcmp(av[0], "snap") == 0) {
345 hammer_cmd_snap(av + 1, ac - 1, 0, 1);
346 exit(0);
347 }
348 if (strcmp(av[0], "snaplo") == 0) {
349 hammer_cmd_snap(av + 1, ac - 1, 0, 0);
350 exit(0);
351 }
352 if (strcmp(av[0], "snapq") == 0) {
353 hammer_cmd_snap(av + 1, ac - 1, 1, 0);
354 exit(0);
355 }
356 if (strcmp(av[0], "snapls") == 0) {
357 hammer_cmd_snapls(av + 1, ac - 1);
358 exit(0);
359 }
360 if (strcmp(av[0], "snaprm") == 0) {
361 hammer_cmd_snaprm(av + 1, ac - 1);
362 exit(0);
363 }
6b669ab4
MN
364 if (strcmp(av[0], "snapshot") == 0) {
365 hammer_cmd_snapshot(av + 1, ac - 1);
366 exit(0);
367 }
68e079b8
MD
368 if (strcmp(av[0], "bstats") == 0) {
369 hammer_cmd_bstats(av + 1, ac - 1);
370 exit(0);
371 }
372 if (strcmp(av[0], "iostats") == 0) {
373 hammer_cmd_iostats(av + 1, ac - 1);
374 exit(0);
375 }
13ce745d
MD
376
377 if (strncmp(av[0], "history", 7) == 0) {
378 hammer_cmd_history(av[0] + 7, av + 1, ac - 1);
379 exit(0);
380 }
797a0b63
MD
381 if (strcmp(av[0], "rebalance") == 0) {
382 signal(SIGINT, sigalrm);
383 hammer_cmd_rebalance(av + 1, ac - 1);
384 exit(0);
385 }
ba7b52c9 386 if (strncmp(av[0], "reblock", 7) == 0) {
6a6e350f 387 signal(SIGINT, sigalrm);
ba7b52c9
MD
388 if (strcmp(av[0], "reblock") == 0)
389 hammer_cmd_reblock(av + 1, ac - 1, -1);
390 else if (strcmp(av[0], "reblock-btree") == 0)
391 hammer_cmd_reblock(av + 1, ac - 1, HAMMER_IOC_DO_BTREE);
58c17893
MD
392 else if (strcmp(av[0], "reblock-inodes") == 0)
393 hammer_cmd_reblock(av + 1, ac - 1, HAMMER_IOC_DO_INODES);
9e29c876
MD
394 else if (strcmp(av[0], "reblock-dirs") == 0)
395 hammer_cmd_reblock(av + 1, ac - 1, HAMMER_IOC_DO_DIRS);
ba7b52c9
MD
396 else if (strcmp(av[0], "reblock-data") == 0)
397 hammer_cmd_reblock(av + 1, ac - 1, HAMMER_IOC_DO_DATA);
ba7b52c9
MD
398 else
399 usage(1);
3f673d5c
MD
400 exit(0);
401 }
a7fbbf91
MD
402 if (strncmp(av[0], "mirror", 6) == 0) {
403 if (strcmp(av[0], "mirror-read") == 0)
48eadef9 404 hammer_cmd_mirror_read(av + 1, ac - 1, 0);
7a27dae7 405 else if (strcmp(av[0], "mirror-read-stream") == 0)
48eadef9 406 hammer_cmd_mirror_read(av + 1, ac - 1, 1);
a7fbbf91
MD
407 else if (strcmp(av[0], "mirror-write") == 0)
408 hammer_cmd_mirror_write(av + 1, ac - 1);
409 else if (strcmp(av[0], "mirror-copy") == 0)
48eadef9
MD
410 hammer_cmd_mirror_copy(av + 1, ac - 1, 0);
411 else if (strcmp(av[0], "mirror-stream") == 0)
412 hammer_cmd_mirror_copy(av + 1, ac - 1, 1);
243ca327
MD
413 else if (strcmp(av[0], "mirror-dump") == 0)
414 hammer_cmd_mirror_dump();
a7fbbf91
MD
415 else
416 usage(1);
417 exit(0);
418 }
bb29b5d8
MD
419 if (strcmp(av[0], "dedup-simulate") == 0) {
420 hammer_cmd_dedup_simulate(av + 1, ac - 1);
421 exit(0);
422 }
423 if (strcmp(av[0], "dedup") == 0) {
424 hammer_cmd_dedup(av + 1, ac - 1);
425 exit(0);
426 }
de1c0b31
MD
427 if (strcmp(av[0], "version") == 0) {
428 hammer_cmd_get_version(av + 1, ac - 1);
429 exit(0);
430 }
431 if (strcmp(av[0], "version-upgrade") == 0) {
432 hammer_cmd_set_version(av + 1, ac - 1);
433 exit(0);
434 }
d121f61c
MN
435 if (strcmp(av[0], "volume-add") == 0) {
436 hammer_cmd_volume_add(av + 1, ac - 1);
e27700cf
MN
437 exit(0);
438 }
865c9609
MN
439 if (strcmp(av[0], "volume-del") == 0) {
440 hammer_cmd_volume_del(av + 1, ac - 1);
441 exit(0);
442 }
e914c91d
SK
443 if (strcmp(av[0], "volume-list") == 0) {
444 hammer_cmd_volume_list(av + 1, ac - 1);
445 exit(0);
446 }
61aeeb33
MD
447
448 uuid_name_lookup(&Hammer_FSType, "DragonFly HAMMER", &status);
449 if (status != uuid_s_ok) {
450 errx(1, "uuids file does not have the DragonFly "
451 "HAMMER filesystem type");
452 }
61aeeb33 453
d38ab092 454 if (strcmp(av[0], "show") == 0) {
e7f926a5 455 u_int32_t lo = 0;
a276dc6b 456 intmax_t obj_id = (int64_t)HAMMER_MIN_OBJID;
61aeeb33 457
d38ab092
MD
458 hammer_parsedevs(blkdevs);
459 if (ac > 1)
a276dc6b
MD
460 sscanf(av[1], "%08x:%jx", &lo, &obj_id);
461 hammer_cmd_show(-1, lo, (int64_t)obj_id, 0, NULL, NULL);
d38ab092
MD
462 exit(0);
463 }
6aec797f
MD
464 if (strcmp(av[0], "show-undo") == 0) {
465 hammer_parsedevs(blkdevs);
466 hammer_cmd_show_undo();
467 exit(0);
468 }
b9107f58
MD
469 if (strcmp(av[0], "recover") == 0) {
470 hammer_parsedevs(blkdevs);
471 if (ac <= 1)
472 errx(1, "hammer recover required target directory");
473 hammer_cmd_recover(av[1]);
474 exit(0);
475 }
eb3f8f1f
MD
476 if (strcmp(av[0], "blockmap") == 0) {
477 hammer_parsedevs(blkdevs);
478 hammer_cmd_blockmap();
479 exit(0);
480 }
6ed4c886
MD
481 if (strcmp(av[0], "checkmap") == 0) {
482 hammer_parsedevs(blkdevs);
483 hammer_cmd_checkmap();
484 exit(0);
485 }
61aeeb33
MD
486 usage(1);
487 /* not reached */
0dfeb6c8
MD
488 return(0);
489}
490
9c9ac2f1
MD
491/*
492 * Parse the device specification.
493 *
494 * Multi-volume hammer devices are colon-separated. Each element
495 * may be further expanded via /etc/devtab. One may also specify
496 * a single element which is expanded into multiple elements via
497 * /etc/devtab.
498 */
0dfeb6c8
MD
499static
500void
d38ab092
MD
501hammer_parsedevs(const char *blkdevs)
502{
503 char *copy;
504 char *volname;
505
506 if (blkdevs == NULL) {
f6532f03 507 errx(1, "A -f blkdevs specification is required "
d38ab092
MD
508 "for this command");
509 }
510
511 copy = strdup(blkdevs);
512 while ((volname = copy) != NULL) {
513 if ((copy = strchr(copy, ':')) != NULL)
514 *copy++ = 0;
9c9ac2f1
MD
515 volname = getdevpath(volname, 0);
516 if (strchr(volname, ':'))
517 hammer_parsedevs(volname);
518 else
519 setup_volume(-1, volname, 0, O_RDONLY);
d38ab092
MD
520 }
521}
522
523static
524void
0006adae
MD
525sigalrm(int signo __unused)
526{
527 /* do nothing (interrupts HAMMER ioctl) */
528}
529
530static
531void
445faa69
MD
532sigintr(int signo __unused)
533{
534 if (RunningIoctl == 0)
535 _exit(1);
536 DidInterrupt = 1;
537 /* do nothing (interrupts HAMMER ioctl) */
538}
539
540static
541void
0dfeb6c8
MD
542usage(int exit_code)
543{
544 fprintf(stderr,
545 "hammer -h\n"
8ceaba31 546 "hammer [-2BqrvXy] [-b bandwidth] [-C cachesize[:readahead]] [-c cyclefile]\n"
3d7b2393
MD
547 " [-f blkdevs] [-i delay] [-t seconds] [-S splitup]\n"
548 " command [argument ...]\n"
84082922 549 "hammer synctid <filesystem> [quick]\n"
bb8e52c0
TN
550 "hammer bstats [interval]\n"
551 "hammer iostats [interval]\n"
552 "hammer history[@offset[,len]] <file> ...\n"
5e435c92
MD
553 "hammer namekey1 <path>\n"
554 "hammer namekey2 <path>\n"
4567021b 555 "hammer namekey32 <path>\n"
bb8e52c0 556 "hammer cleanup [<filesystem> ...]\n"
b66b9421 557 "hammer info\n"
bb8e52c0 558 "hammer snapshot [<filesystem>] <snapshot-dir>\n"
16265794 559 "hammer snapshot <filesystem> <snapshot-dir> [<note>]\n"
84082922 560 "hammer prune <softlink-dir>\n"
b5aaba7f 561 "hammer prune-everything <filesystem>\n"
797a0b63 562 "hammer rebalance <filesystem> [saturation_percentage]\n"
4567021b 563 "hammer reblock[-btree|-inodes|-dirs|-data] "
84082922 564 "<filesystem> [fill_percentage]\n"
34bb69d8 565 "hammer pfs-status <dirpath> ...\n"
d4e5b69b
MD
566 "hammer pfs-master <dirpath> [options]\n"
567 "hammer pfs-slave <dirpath> [options]\n"
34ebae70 568 "hammer pfs-update <dirpath> [options]\n"
9c67b4d2
MD
569 "hammer pfs-upgrade <dirpath>\n"
570 "hammer pfs-downgrade <dirpath>\n"
571 "hammer pfs-destroy <dirpath>\n"
bb8e52c0
TN
572 "hammer mirror-read <filesystem> [begin-tid]\n"
573 "hammer mirror-read-stream <filesystem> [begin-tid]\n"
574 "hammer mirror-write <filesystem>\n"
575 "hammer mirror-dump\n"
576 "hammer mirror-copy [[user@]host:]<filesystem>"
577 " [[user@]host:]<filesystem>\n"
578 "hammer mirror-stream [[user@]host:]<filesystem>"
579 " [[user@]host:]<filesystem>\n"
5e435c92 580 "hammer version <filesystem>\n"
4567021b 581 "hammer version-upgrade <filesystem> <version> [force]\n"
d121f61c 582 "hammer volume-add <device> <filesystem>\n"
865c9609 583 "hammer volume-del <device> <filesystem>\n"
e914c91d 584 "hammer volume-list <filesystem>\n"
0dfeb6c8 585 );
83f2a3aa 586
f6532f03 587 fprintf(stderr, "\nHAMMER utility version 3+ commands:\n");
83f2a3aa
MD
588
589 fprintf(stderr,
590 "hammer config [<filesystem> [<configfile>]]\n"
591 "hammer viconfig [<filesystem>]\n"
f6532f03
TN
592 "hammer snap <path> [<note>]\n"
593 "hammer snaplo <path> [<note>]\n"
594 "hammer snapq <dir> [<note>]\n"
aaf93065
TN
595 "hammer snaprm <path> ...\n"
596 "hammer snaprm <transid> ...\n"
597 "hammer snaprm <filesystem> <transid> ...\n"
f6532f03
TN
598 "hammer snapls [<path> ...]\n"
599 );
600
601 fprintf(stderr, "\nHAMMER utility version 4+ commands:\n");
602
603 fprintf(stderr,
c71cab34
MD
604 "hammer -f blkdevs blockmap\n"
605 "hammer -f blkdevs checkmap\n"
606 "hammer -f blkdevs [-qqq] show [lo:objid]\n"
f6532f03 607 "hammer -f blkdevs show-undo\n"
b9107f58 608 "hammer -f blkdevs recover <target_dir>\n"
83f2a3aa
MD
609 );
610
bb29b5d8
MD
611 fprintf(stderr, "\nHAMMER utility version 5+ commands:\n");
612
613 fprintf(stderr,
614 "hammer dedup-simulate <filesystem>\n"
615 "hammer dedup <filesystem>\n"
616 );
617
0dfeb6c8
MD
618 exit(exit_code);
619}
d38ab092 620