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 */ 34 35 #include "hammer.h" 36 37 static void hammer_parsedevs(const char *blkdevs, int oflags); 38 static void hammer_parsedevs_noverify(const char *blkdevs, int oflags); 39 static void sigalrm(int signo); 40 static void sigintr(int signo); 41 static void usage(int exit_code); 42 43 int RecurseOpt; 44 int VerboseOpt; 45 int QuietOpt; 46 int NoSyncOpt; 47 int TwoWayPipeOpt; 48 int TimeoutOpt; 49 int DelayOpt = 5; 50 char *SshPort; 51 int ForceYesOpt; 52 int CompressOpt; 53 int ForceOpt; 54 int RunningIoctl; 55 int DidInterrupt; 56 int BulkOpt; 57 int AllPFS; 58 uint64_t BandwidthOpt; 59 uint64_t SplitupOpt = 4ULL * 1024ULL * 1024ULL * 1024ULL; 60 uint64_t MemoryLimit = 1024LLU * 1024 * 1024; 61 const char *SplitupOptStr; 62 const char *CyclePath; 63 64 int 65 main(int ac, char **av) 66 { 67 char *blkdevs = NULL; 68 char *ptr; 69 char *restrictcmd = NULL; 70 uint32_t status; 71 int ch; 72 73 while ((ch = getopt(ac, av, 74 "b:c:de:hf:i:m:p:qrt:v2yABC:FR:S:T:X")) != -1) { 75 switch(ch) { 76 case '2': 77 TwoWayPipeOpt = 1; 78 break; 79 case 'y': 80 ForceYesOpt = 1; 81 break; 82 case 'b': 83 BandwidthOpt = strtoull(optarg, &ptr, 0); 84 switch(*ptr) { 85 case 'g': 86 case 'G': 87 BandwidthOpt *= 1024; 88 /* fall through */ 89 case 'm': 90 case 'M': 91 BandwidthOpt *= 1024; 92 /* fall through */ 93 case 'k': 94 case 'K': 95 BandwidthOpt *= 1024; 96 break; 97 case '\0': 98 /* bytes per second if no suffix */ 99 break; 100 default: 101 usage(1); 102 } 103 break; 104 case 'S': 105 SplitupOptStr = strdup(optarg); 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; 127 case 'c': 128 CyclePath = optarg; 129 break; 130 case 'd': 131 ++DebugOpt; 132 break; 133 case 'e': 134 ScoreBoardFile = optarg; 135 break; 136 case 'h': 137 usage(0); 138 /* not reached */ 139 case 'i': 140 DelayOpt = strtol(optarg, NULL, 0); 141 break; 142 case 'm': 143 MemoryLimit = strtouq(optarg, &ptr, 0); 144 switch(*ptr) { 145 case 't': 146 case 'T': 147 MemoryLimit *= 1024; 148 /* fall through */ 149 case 'g': 150 case 'G': 151 MemoryLimit *= 1024; 152 /* fall through */ 153 case 'm': 154 case 'M': 155 MemoryLimit *= 1024; 156 /* fall through */ 157 case 'k': 158 case 'K': 159 MemoryLimit *= 1024; 160 /* fall through */ 161 default: 162 break; 163 } 164 165 /* minimum limit */ 166 if (MemoryLimit < 1024 * 1024) 167 MemoryLimit = 1024 * 1024; 168 break; 169 case 'p': 170 SshPort = optarg; 171 break; 172 case 'r': 173 RecurseOpt = 1; 174 break; 175 case 'f': 176 blkdevs = optarg; 177 break; 178 case 't': 179 TimeoutOpt = strtol(optarg, NULL, 0); 180 break; 181 case 'v': 182 if (QuietOpt > 0) 183 --QuietOpt; 184 else 185 ++VerboseOpt; 186 break; 187 case 'q': 188 if (VerboseOpt > 0) 189 --VerboseOpt; 190 else 191 ++QuietOpt; 192 break; 193 case 'A': 194 AllPFS = 1; 195 break; 196 case 'B': 197 BulkOpt = 1; 198 break; 199 case 'C': 200 if (hammer_parse_cache_size(optarg) == -1) 201 usage(1); 202 break; 203 case 'F': 204 ForceOpt = 1; 205 break; 206 case 'R': 207 if (restrictcmd == NULL) 208 restrictcmd = optarg; 209 break; 210 case 'T': 211 if (RestrictTarget == NULL) 212 RestrictTarget = optarg; 213 break; 214 case 'X': 215 CompressOpt = 1; 216 break; 217 default: 218 usage(1); 219 /* not reached */ 220 } 221 } 222 ac -= optind; 223 av += optind; 224 if (ac < 1) { 225 usage(1); 226 /* not reached */ 227 } 228 229 signal(SIGALRM, sigalrm); 230 signal(SIGINT, sigintr); 231 232 /* 233 * Check command restriction (used by hammer ssh-remote). Several 234 * commands may be iterated with a comma. 235 */ 236 if (restrictcmd) { 237 char *elm, *dup; 238 239 dup = ptr = strdup(restrictcmd); 240 while ((elm = strsep(&ptr, ",")) != NULL) { 241 if (strcmp(av[0], elm) == 0) 242 break; 243 } 244 if (elm == NULL) { 245 fprintf(stderr, "hammer-remote: request does not match " 246 "restricted command\n"); 247 exit(1); 248 } 249 free(dup); 250 } 251 252 /* 253 * Lookup the filesystem type 254 */ 255 uuid_name_lookup(&Hammer_FSType, HAMMER_FSTYPE_STRING, &status); 256 if (status != uuid_s_ok) { 257 errx(1, "uuids file does not have the DragonFly " 258 "HAMMER filesystem type"); 259 } 260 261 /* 262 * Parse commands 263 */ 264 if (strcmp(av[0], "synctid") == 0) { 265 hammer_cmd_synctid(av + 1, ac - 1); 266 exit(0); 267 } 268 if (strcmp(av[0], "namekey2") == 0) { 269 int64_t key; 270 int32_t crcx; 271 int len; 272 const char *aname = av[1]; 273 274 if (aname == NULL) 275 usage(1); 276 len = strlen(aname); 277 key = (uint32_t)crc32(aname, len) & 0xFFFFFFFEU; 278 279 switch(len) { 280 default: 281 crcx = crc32(aname + 3, len - 5); 282 crcx = crcx ^ (crcx >> 6) ^ (crcx >> 12); 283 key |= (int64_t)(crcx & 0x3F) << 42; 284 /* fall through */ 285 case 5: 286 case 4: 287 /* fall through */ 288 case 3: 289 key |= ((int64_t)(aname[2] & 0x1F) << 48); 290 /* fall through */ 291 case 2: 292 key |= ((int64_t)(aname[1] & 0x1F) << 53) | 293 ((int64_t)(aname[len-2] & 0x1F) << 37); 294 /* fall through */ 295 case 1: 296 key |= ((int64_t)(aname[0] & 0x1F) << 58) | 297 ((int64_t)(aname[len-1] & 0x1F) << 32); 298 /* fall through */ 299 case 0: 300 break; 301 } 302 if (key == 0) 303 key |= 0x100000000LL; 304 printf("0x%016jx\n", (uintmax_t)key); 305 exit(0); 306 } 307 if (strcmp(av[0], "namekey1") == 0) { 308 int64_t key; 309 310 if (av[1] == NULL) 311 usage(1); 312 key = (int64_t)(crc32(av[1], strlen(av[1])) & 0x7FFFFFFF) << 32; 313 if (key == 0) 314 key |= 0x100000000LL; 315 printf("0x%016jx\n", (uintmax_t)key); 316 exit(0); 317 } 318 if (strcmp(av[0], "namekey32") == 0) { 319 int32_t key; 320 321 if (av[1] == NULL) 322 usage(1); 323 key = crc32(av[1], strlen(av[1])) & 0x7FFFFFFF; 324 if (key == 0) 325 ++key; 326 printf("0x%08x\n", key); 327 exit(0); 328 } 329 if (strcmp(av[0], "pfs-status") == 0) { 330 hammer_cmd_pseudofs_status(av + 1, ac - 1); 331 exit(0); 332 } 333 if (strcmp(av[0], "pfs-master") == 0) { 334 hammer_cmd_pseudofs_create(av + 1, ac - 1, 0); 335 exit(0); 336 } 337 if (strcmp(av[0], "pfs-slave") == 0) { 338 hammer_cmd_pseudofs_create(av + 1, ac - 1, 1); 339 exit(0); 340 } 341 if (strcmp(av[0], "pfs-update") == 0) { 342 hammer_cmd_pseudofs_update(av + 1, ac - 1); 343 exit(0); 344 } 345 if (strcmp(av[0], "pfs-upgrade") == 0) { 346 hammer_cmd_pseudofs_upgrade(av + 1, ac - 1); 347 exit(0); 348 } 349 if (strcmp(av[0], "pfs-downgrade") == 0) { 350 hammer_cmd_pseudofs_downgrade(av + 1, ac - 1); 351 exit(0); 352 } 353 if (strcmp(av[0], "pfs-destroy") == 0) { 354 hammer_cmd_pseudofs_destroy(av + 1, ac - 1); 355 exit(0); 356 } 357 if (strcmp(av[0], "prune") == 0) { 358 hammer_cmd_softprune(av + 1, ac - 1, 0); 359 exit(0); 360 } 361 if (strcmp(av[0], "config") == 0) { 362 hammer_cmd_config(av + 1, ac - 1); 363 exit(0); 364 } 365 if (strcmp(av[0], "viconfig") == 0) { 366 hammer_cmd_viconfig(av + 1, ac - 1); 367 exit(0); 368 } 369 if (strcmp(av[0], "cleanup") == 0) { 370 hammer_cmd_cleanup(av + 1, ac - 1); 371 exit(0); 372 } 373 if (strcmp(av[0], "abort-cleanup") == 0) { 374 hammer_cmd_abort_cleanup(av + 1, ac - 1); 375 exit(0); 376 } 377 if (strcmp(av[0], "info") == 0) { 378 hammer_cmd_info(av + 1, ac - 1); 379 exit(0); 380 } 381 if (strcmp(av[0], "prune-everything") == 0) { 382 hammer_cmd_softprune(av + 1, ac - 1, 1); 383 exit(0); 384 } 385 if (strcmp(av[0], "ssh-remote") == 0) { 386 if (ac != 3) 387 usage(1); 388 hammer_cmd_sshremote(av[1], av[2]); 389 exit(0); 390 } 391 if (strcmp(av[0], "snap") == 0) { 392 hammer_cmd_snap(av + 1, ac - 1, 0, 1); 393 exit(0); 394 } 395 if (strcmp(av[0], "snaplo") == 0) { 396 hammer_cmd_snap(av + 1, ac - 1, 0, 0); 397 exit(0); 398 } 399 if (strcmp(av[0], "snapq") == 0) { 400 hammer_cmd_snap(av + 1, ac - 1, 1, 0); 401 exit(0); 402 } 403 if (strcmp(av[0], "snapls") == 0) { 404 hammer_cmd_snapls(av + 1, ac - 1); 405 exit(0); 406 } 407 if (strcmp(av[0], "snaprm") == 0) { 408 hammer_cmd_snaprm(av + 1, ac - 1); 409 exit(0); 410 } 411 if (strcmp(av[0], "snapshot") == 0) { 412 hammer_cmd_snapshot(av + 1, ac - 1); 413 exit(0); 414 } 415 if (strcmp(av[0], "bstats") == 0) { 416 hammer_cmd_bstats(av + 1, ac - 1); 417 exit(0); 418 } 419 if (strcmp(av[0], "iostats") == 0) { 420 hammer_cmd_iostats(av + 1, ac - 1); 421 exit(0); 422 } 423 if (strcmp(av[0], "stats") == 0) { 424 hammer_cmd_stats(av + 1, ac - 1); 425 exit(0); 426 } 427 428 if (strncmp(av[0], "history", 7) == 0) { 429 hammer_cmd_history(av[0] + 7, av + 1, ac - 1); 430 exit(0); 431 } 432 if (strcmp(av[0], "rebalance") == 0) { 433 signal(SIGINT, sigalrm); 434 hammer_cmd_rebalance(av + 1, ac - 1); 435 exit(0); 436 } 437 if (strncmp(av[0], "reblock", 7) == 0) { 438 signal(SIGINT, sigalrm); 439 if (strcmp(av[0], "reblock") == 0) 440 hammer_cmd_reblock(av + 1, ac - 1, HAMMER_IOC_DO_FLAGS); 441 else if (strcmp(av[0], "reblock-btree") == 0) 442 hammer_cmd_reblock(av + 1, ac - 1, HAMMER_IOC_DO_BTREE); 443 else if (strcmp(av[0], "reblock-inodes") == 0) 444 hammer_cmd_reblock(av + 1, ac - 1, HAMMER_IOC_DO_INODES); 445 else if (strcmp(av[0], "reblock-dirs") == 0) 446 hammer_cmd_reblock(av + 1, ac - 1, HAMMER_IOC_DO_DIRS); 447 else if (strcmp(av[0], "reblock-data") == 0) 448 hammer_cmd_reblock(av + 1, ac - 1, HAMMER_IOC_DO_DATA); 449 else 450 usage(1); 451 exit(0); 452 } 453 if (strncmp(av[0], "mirror", 6) == 0) { 454 if (strcmp(av[0], "mirror-read") == 0) 455 hammer_cmd_mirror_read(av + 1, ac - 1, 0); 456 else if (strcmp(av[0], "mirror-read-stream") == 0) 457 hammer_cmd_mirror_read(av + 1, ac - 1, 1); 458 else if (strcmp(av[0], "mirror-write") == 0) 459 hammer_cmd_mirror_write(av + 1, ac - 1); 460 else if (strcmp(av[0], "mirror-copy") == 0) 461 hammer_cmd_mirror_copy(av + 1, ac - 1, 0); 462 else if (strcmp(av[0], "mirror-stream") == 0) 463 hammer_cmd_mirror_copy(av + 1, ac - 1, 1); 464 else if (strcmp(av[0], "mirror-dump") == 0) 465 hammer_cmd_mirror_dump(av + 1, ac - 1); 466 else 467 usage(1); 468 exit(0); 469 } 470 if (strcmp(av[0], "dedup-simulate") == 0) { 471 hammer_cmd_dedup_simulate(av + 1, ac - 1); 472 exit(0); 473 } 474 if (strcmp(av[0], "dedup") == 0) { 475 hammer_cmd_dedup(av + 1, ac - 1); 476 exit(0); 477 } 478 if (strcmp(av[0], "version") == 0) { 479 hammer_cmd_get_version(av + 1, ac - 1); 480 exit(0); 481 } 482 if (strcmp(av[0], "version-upgrade") == 0) { 483 hammer_cmd_set_version(av + 1, ac - 1); 484 exit(0); 485 } 486 if (strcmp(av[0], "volume-add") == 0) { 487 hammer_cmd_volume_add(av + 1, ac - 1); 488 exit(0); 489 } 490 if (strcmp(av[0], "volume-del") == 0) { 491 hammer_cmd_volume_del(av + 1, ac - 1); 492 exit(0); 493 } 494 if (strcmp(av[0], "volume-list") == 0) { 495 hammer_cmd_volume_list(av + 1, ac - 1); 496 exit(0); 497 } 498 if (strcmp(av[0], "volume-blkdevs") == 0) { 499 hammer_cmd_volume_blkdevs(av + 1, ac - 1); 500 exit(0); 501 } 502 503 if (strcmp(av[0], "show") == 0) { 504 const char *arg = NULL; 505 char *p, *dup; 506 int filter = -1; 507 int obfuscate = 0; 508 int indent = 0; 509 510 hammer_parsedevs(blkdevs, O_RDONLY); 511 if (ac > 3) 512 errx(1, "Too many options specified"); 513 if (ac > 1) 514 arg = av[1]; 515 if (ac > 2) { 516 dup = ptr = strdup(av[2]); 517 while ((p = strsep(&ptr, ",")) != NULL) { 518 if (strcmp(p, "filter") == 0) { 519 filter = 1; 520 } else if (strcmp(p, "nofilter") == 0) { 521 filter = 0; 522 } else if (strcmp(p, "obfuscate") == 0) { 523 obfuscate = 1; 524 } else if (strcmp(p, "indent") == 0) { 525 indent = 1; 526 } 527 } 528 free(dup); 529 } 530 hammer_cmd_show(arg, filter, obfuscate, indent); 531 exit(0); 532 } 533 if (strcmp(av[0], "show-undo") == 0) { 534 hammer_parsedevs(blkdevs, O_RDONLY); 535 hammer_cmd_show_undo(); 536 exit(0); 537 } 538 if (strcmp(av[0], "recover") == 0) { 539 hammer_parsedevs_noverify(blkdevs, O_RDONLY); 540 hammer_cmd_recover(av + 1, ac - 1); 541 exit(0); 542 } 543 if (strcmp(av[0], "blockmap") == 0) { 544 hammer_parsedevs(blkdevs, O_RDONLY); 545 hammer_cmd_blockmap(); 546 exit(0); 547 } 548 if (strcmp(av[0], "checkmap") == 0) { 549 hammer_parsedevs(blkdevs, O_RDONLY); 550 hammer_cmd_checkmap(); 551 exit(0); 552 } 553 if (strcmp(av[0], "strip") == 0) { 554 hammer_parsedevs(blkdevs, O_RDWR); 555 hammer_cmd_strip(); 556 exit(0); 557 } 558 559 usage(1); 560 /* not reached */ 561 return(0); 562 } 563 564 /* 565 * Parse the device specification. 566 * 567 * Multi-volume hammer devices are colon-separated. Each element 568 * may be further expanded via /etc/devtab. One may also specify 569 * a single element which is expanded into multiple elements via 570 * /etc/devtab. 571 */ 572 static 573 void 574 __hammer_parsedevs(const char *blkdevs, int oflags, int verify) 575 { 576 struct volume_info *vol = NULL; 577 char *copy; 578 char *volname; 579 int volnum = 0; 580 581 if (blkdevs == NULL) { 582 errx(1, "A -f blkdevs specification is required " 583 "for this command"); 584 } 585 586 copy = strdup(blkdevs); 587 while ((volname = copy) != NULL) { 588 if ((copy = strchr(copy, ':')) != NULL) 589 *copy++ = 0; 590 volname = getdevpath(volname, 0); 591 if (strchr(volname, ':')) 592 __hammer_parsedevs(volname, oflags, verify); 593 else { 594 vol = load_volume(volname, oflags, verify); 595 assert(vol); 596 ++volnum; 597 } 598 free(volname); 599 } 600 free(copy); 601 602 /* 603 * All volumes have the same vol_count. 604 */ 605 assert(vol); 606 if (volnum != vol->ondisk->vol_count) 607 errx(1, "Volume header says %d volumes, but %d specified.", 608 vol->ondisk->vol_count, volnum); 609 610 if (get_root_volume() == NULL) 611 errx(1, "No root volume found"); 612 } 613 614 static __inline 615 void 616 hammer_parsedevs(const char *blkdevs, int oflags) 617 { 618 __hammer_parsedevs(blkdevs, oflags, 1); 619 } 620 621 static __inline 622 void 623 hammer_parsedevs_noverify(const char *blkdevs, int oflags) 624 { 625 __hammer_parsedevs(blkdevs, oflags, 0); 626 } 627 628 static 629 void 630 sigalrm(int signo __unused) 631 { 632 /* do nothing (interrupts HAMMER ioctl) */ 633 } 634 635 static 636 void 637 sigintr(int signo __unused) 638 { 639 if (RunningIoctl == 0) 640 _exit(1); 641 DidInterrupt = 1; 642 /* do nothing (interrupts HAMMER ioctl) */ 643 } 644 645 static 646 void 647 usage(int exit_code) 648 { 649 fprintf(stderr, 650 "hammer -h\n" 651 "hammer [-2ABFqrvXy] [-b bandwidth] [-C cachesize[:readahead]] \n" 652 " [-R restrictcmd] [-T restrictpath] [-c cyclefile]\n" 653 " [-e scoreboardfile] [-f blkdevs] [-i delay] [-p ssh-port]\n" 654 " [-S splitsize] [-t seconds] [-m memlimit] command [argument ...]\n" 655 "hammer synctid <filesystem> [quick]\n" 656 "hammer bstats [interval]\n" 657 "hammer iostats [interval]\n" 658 "hammer stats [interval]\n" 659 "hammer history[@offset[,len]] <file> ...\n" 660 "hammer namekey1 <path>\n" 661 "hammer namekey2 <path>\n" 662 "hammer namekey32 <path>\n" 663 "hammer cleanup [<filesystem> ...]\n" 664 "hammer abort-cleanup\n" 665 "hammer info [<dirpath> ...]\n" 666 "hammer snapshot [<filesystem>] <snapshot-dir>\n" 667 "hammer snapshot <filesystem> <snapshot-dir> [<note>]\n" 668 "hammer prune <softlink-dir>\n" 669 "hammer prune-everything <filesystem>\n" 670 "hammer rebalance <filesystem> [saturation_percentage]\n" 671 "hammer reblock[-btree|-inodes|-dirs|-data] " 672 "<filesystem> [fill_percentage]\n" 673 "hammer pfs-status <dirpath> ...\n" 674 "hammer pfs-master <dirpath> [options]\n" 675 "hammer pfs-slave <dirpath> [options]\n" 676 "hammer pfs-update <dirpath> [options]\n" 677 "hammer pfs-upgrade <dirpath>\n" 678 "hammer pfs-downgrade <dirpath>\n" 679 "hammer pfs-destroy <dirpath>\n" 680 "hammer mirror-read <filesystem> [begin-tid]\n" 681 "hammer mirror-read-stream <filesystem> [begin-tid]\n" 682 "hammer mirror-write <filesystem>\n" 683 "hammer mirror-dump [header]\n" 684 "hammer mirror-copy [[user@]host:]<filesystem>" 685 " [[user@]host:]<filesystem>\n" 686 "hammer mirror-stream [[user@]host:]<filesystem>" 687 " [[user@]host:]<filesystem>\n" 688 "hammer ssh-remote command filesystem\n" 689 "hammer version <filesystem>\n" 690 "hammer version-upgrade <filesystem> <version> [force]\n" 691 "hammer volume-add <device> <filesystem>\n" 692 "hammer volume-del <device> <filesystem>\n" 693 "hammer volume-list <filesystem>\n" 694 "hammer volume-blkdevs <filesystem>\n" 695 ); 696 697 fprintf(stderr, "\nHAMMER utility version 3+ commands:\n"); 698 699 fprintf(stderr, 700 "hammer config [<filesystem> [<configfile>]]\n" 701 "hammer viconfig [<filesystem>]\n" 702 "hammer snap <path> [<note>]\n" 703 "hammer snaplo <path> [<note>]\n" 704 "hammer snapq <dir> [<note>]\n" 705 "hammer snaprm <path> ...\n" 706 "hammer snaprm <transid> ...\n" 707 "hammer snaprm <filesystem> <transid> ...\n" 708 "hammer snapls [<path> ...]\n" 709 ); 710 711 fprintf(stderr, "\nHAMMER utility version 4+ commands:\n"); 712 713 fprintf(stderr, 714 "hammer -f blkdevs blockmap\n" 715 "hammer -f blkdevs checkmap\n" 716 "hammer -f blkdevs [-qqq] show [lo:objid]\n" 717 "hammer -f blkdevs show-undo\n" 718 "hammer -f blkdevs recover <target_dir> [full|quick]\n" 719 "hammer -f blkdevs strip\n" 720 ); 721 722 fprintf(stderr, "\nHAMMER utility version 5+ commands:\n"); 723 724 fprintf(stderr, 725 "hammer dedup-simulate <filesystem>\n" 726 "hammer dedup <filesystem>\n" 727 ); 728 729 exit(exit_code); 730 } 731 732