1 '\" te 2 .\" Copyright 2013 Nexenta Systems, Inc. All rights reserved. 3 .TH BEADM 1M "Jul 25, 2013" 4 .SH NAME 5 beadm \- utility for managing zfs boot environments 6 .SH SYNOPSIS 7 .LP 8 .nf 9 \fBbeadm\fR \fBcreate\fR [\fB-a\fR] [\fB-d\fR \fIdescription\fR] 10 [\fB-e\fR \fInon-activeBeName\fR | \fIbeName@snapshot\fR] 11 [\fB-o\fR \fIproperty=value\fR] ... [\fB-p\fR \fIzpool\fR] 12 [\fB-v\fR] \fIbeName\fR 13 .fi 14 15 .LP 16 .nf 17 \fBbeadm\fR \fBcreate\fR [\fB-v\fR] \fIbeName@snapshot\fR 18 .fi 19 20 .LP 21 .nf 22 \fBbeadm\fR \fBdestroy\fR [\fB-fFsv\fR] \fIbeName\fR | \fIbeName@snapshot\fR 23 .fi 24 25 .LP 26 .nf 27 \fBbeadm\fR \fBlist\fR [\fB-a\fR | \fB-ds\fR] [\fB-H\fR] [\fB-v\fR] [\fIbeName\fR] 28 .fi 29 30 .LP 31 .nf 32 \fBbeadm\fR \fBmount\fR [\fB-v\fR] \fIbeName\fR \fImountpoint\fR 33 .fi 34 35 .LP 36 .nf 37 \fBbeadm\fR \fBunmount\fR [\fB-fv\fR] \fIbeName\fR | \fImountpoint\fR 38 .fi 39 40 .LP 41 .nf 42 \fBbeadm\fR \fBrename\fR [\fB-v\fR] \fIbeName\fR \fInewBeName\fR 43 .fi 44 45 .LP 46 .nf 47 \fBbeadm\fR \fBactivate\fR [\fB-v\fR] \fIbeName\fR 48 .fi 49 50 .LP 51 .nf 52 \fBbeadm\fR \fBrollback\fR [\fB-v\fR] \fIbeName\fR \fIsnapshot\fR 53 .fi 54 55 .LP 56 .nf 57 \fBbeadm\fR \fBrollback\fR [\fB-v\fR] \fIbeName@snapshot\fR 58 .fi 59 60 .SH DESCRIPTION 61 The \fBbeadm\fR command is the user interface for managing zfs Boot 62 Environments (BEs). This utility is intended to be used by System 63 Administrators who want to manage multiple Solaris Instances on a single 64 system. 65 .sp 66 The \fBbeadm\fR command supports the following operations: 67 .RS +4 68 .TP 69 .ie t \(bu 70 .el - 71 Create a new BE, based on the active BE. 72 .RE 73 .RS +4 74 .TP 75 .ie t \(bu 76 .el - 77 Create a new BE, based on an inactive BE. 78 .RE 79 .RS +4 80 .TP 81 .ie t \(bu 82 .el - 83 Create a snapshot of an existing BE. 84 .RE 85 .RS +4 86 .TP 87 .ie t \(bu 88 .el - 89 Create a new BE, based on an existing snapshot. 90 .RE 91 .RS +4 92 .TP 93 .ie t \(bu 94 .el - 95 Create a new BE, and copy it to a different zpool. 96 .RE 97 .RS +4 98 .TP 99 .ie t \(bu 100 .el - 101 Activate an existing, inactive BE. 102 .RE 103 .RS +4 104 .TP 105 .ie t \(bu 106 .el - 107 Mount a BE. 108 .RE 109 .RS +4 110 .TP 111 .ie t \(bu 112 .el - 113 Unmount a BE. 114 .RE 115 .RS +4 116 .TP 117 .ie t \(bu 118 .el - 119 Destroy a BE. 120 .RE 121 .RS +4 122 .TP 123 .ie t \(bu 124 .el - 125 Destroy a snapshot of a BE. 126 .RE 127 .RS +4 128 .TP 129 .ie t \(bu 130 .el - 131 Rename an existing, inactive BE. 132 .RE 133 .RS +4 134 .TP 135 .ie t \(bu 136 .el - 137 Roll back a BE to an existing snapshot of a BE. 138 .RE 139 .RS +4 140 .TP 141 .ie t \(bu 142 .el - 143 Display information about your snapshots and datasets. 144 .RE 145 146 .SH SUBCOMMANDS 147 The \fBbeadm\fR command has the subcommands and options listed 148 below. Also see 149 EXAMPLES below. 150 .sp 151 .ne 2 152 .na 153 \fBbeadm\fR 154 .ad 155 .sp .6 156 .RS 4n 157 Displays command usage. 158 .RE 159 160 .sp 161 .ne 2 162 .na 163 \fBbeadm\fR \fBcreate\fR [\fB-a\fR] [\fB-d\fR \fIdescription\fR] 164 [\fB-e\fR \fInon-activeBeName\fR | \fIbeName@snapshot\fR] 165 [\fB-o\fR \fIproperty=value\fR] ... [\fB-p\fR \fIzpool\fR] 166 [\fB-v\fR] \fIbeName\fR 167 168 .ad 169 .sp .6 170 .RS 4n 171 Creates a new boot environment named \fIbeName\fR. If the \fB-e\fR option is 172 not 173 provided, the new boot environment will be created as a clone of the 174 currently 175 running boot environment. If the \fB-d\fR option is provided then the 176 description is 177 also used as the title for the BE's entry in the GRUB menu for 178 x86 systems or 179 in the boot menu for SPARC systems. If the \fB-d\fR option is 180 not provided, \fIbeName\fR 181 will be used as the title. 182 .sp 183 .ne 2 184 .na 185 \fB-a\fR 186 .ad 187 .sp .6 188 .RS 4n 189 Activate the newly created BE upon creation. The default is to not activate 190 the newly created BE. 191 .RE 192 .sp 193 .ne 2 194 .na 195 \fB-d\fR \fIdescription\fR 196 .ad 197 .sp .6 198 .RS 4n 199 Create a new BE with a description associated with it. 200 .RE 201 .sp 202 .ne 2 203 .na 204 \fB-e\fR \fInon-activeBeName\fR 205 .ad 206 .sp .6 207 .RS 4n 208 Create a new BE from an existing inactive BE. 209 .RE 210 .sp 211 .ne 2 212 .na 213 \fB-e\fR \fIbeName@snapshot\fR 214 .ad 215 .sp .6 216 .RS 4n 217 Create a new BE from an existing snapshot of the BE named beName. 218 .RE 219 .sp 220 .ne 2 221 .na 222 \fB-o\fR \fIproperty=value\fR 223 .ad 224 .sp .6 225 .RS 4n 226 Create the datasets for new BE with specific ZFS properties. Multiple 227 \fB-o\fR 228 options can be specified. See \fBzfs\fR(1M) for more information on 229 the 230 \fB-o\fR option. 231 .RE 232 .sp 233 .ne 2 234 .na 235 \fB-p\fR \fIzpool\fR 236 .ad 237 .sp .6 238 .RS 4n 239 Create the new BE in the specified zpool. If this is not provided, the 240 default 241 behavior is to create the new BE in the same pool as as the origin BE. 242 This option is not supported in non-global zone. 243 .RE 244 .sp 245 .ne 2 246 .na 247 \fB-v\fR 248 .ad 249 .sp .6 250 .RS 4n 251 Verbose mode. Displays verbose error messages from \fBbeadm\fR. 252 .RE 253 .RE 254 255 .sp 256 .ne 2 257 .na 258 \fBbeadm\fR \fBcreate\fR [\fB-v\fR] \fIbeName@snapshot\fR 259 .ad 260 .sp .6 261 .RS 4n 262 Creates a snapshot of the existing BE named beName. 263 .sp 264 .ne 2 265 .na 266 \fB-v\fR 267 .ad 268 .sp .6 269 .RS 4n 270 Verbose mode. Displays verbose error messages from \fBbeadm\fR. 271 .RE 272 .RE 273 274 .sp 275 .ne 2 276 .na 277 \fBbeadm\fR \fBdestroy\fR [\fB-fFsv\fR] \fIbeName\fR | \fIbeName@snapshot\fR 278 .ad 279 .sp .6 280 .RS 4n 281 Destroys the boot environment named \fIbeName\fR or destroys an existing 282 snapshot of 283 the boot environment named \fIbeName@snapshot\fR. Destroying a 284 boot environment 285 will also destroy all snapshots of that boot environment. Use 286 this command 287 with caution. 288 .sp 289 .ne 2 290 .na 291 \fB-f\fR 292 .ad 293 .sp .6 294 .RS 4n 295 Forcefully unmount the boot environment if it is currently mounted. 296 .RE 297 .sp 298 .ne 2 299 .na 300 \fB-F\fR 301 .ad 302 .sp .6 303 .RS 4n 304 Force the action without prompting to verify the destruction of the boot 305 environment. 306 .RE 307 .sp 308 .ne 2 309 .na 310 \fB-s\fR 311 .ad 312 .sp .6 313 .RS 4n 314 Destroy all snapshots of the boot 315 environment. 316 .RE 317 .sp 318 .ne 2 319 .na 320 \fB-v\fR 321 .ad 322 .sp .6 323 .RS 4n 324 Verbose mode. Displays verbose error messages from \fBbeadm\fR. 325 .RE 326 .RE 327 328 .sp 329 .ne 2 330 .na 331 \fBbeadm\fR \fBlist\fR [\fB-a\fR | \fB-ds\fR] [\fB-H\fR] [\fB-v\fR] [\fIbeName\fR] 332 .ad 333 .sp .6 334 .RS 4n 335 Lists information about the existing boot environment named \fIbeName\fR, or 336 lists 337 information for all boot environments if \fIbeName\fR is not provided. 338 The 'Active' 339 field indicates whether the boot environment is active now, 340 represented 341 by 'N'; active on reboot, represented by 'R'; or both, represented 342 by 'NR'. In non-global zone the 'Active' field also indicates whether the 343 boot environment has a non-active parent BE, represented by 'x'; is active 344 on boot in a non-active parent BE, represented by 'b'. Activate, rollback 345 and snapshot operations for boot environments from non-active global parent 346 BE aren't supported, destroy is allowed if these boot environments aren't 347 active on boot. 348 .sp 349 Each line in the machine parasable output has the boot environment name as the 350 first field. The 'Space' field is displayed in bytes and the 'Created' field 351 is displayed in UTC format. The \fB-H\fR option used with no other options 352 gives 353 the boot environment's uuid in the second field. This field will be 354 blank if 355 the boot environment does not have a uuid. See the EXAMPLES section. 356 In non-global zones, this field shows the uuid of the parent BE. 357 .sp 358 .ne 2 359 .na 360 \fB-a\fR 361 .ad 362 .sp .6 363 .RS 4n 364 Lists all available information about the boot environment. This includes 365 subordinate file systems and snapshots. 366 .RE 367 .sp 368 .ne 2 369 .na 370 \fB-d\fR 371 .ad 372 .sp .6 373 .RS 4n 374 Lists information about all subordinate file systems belonging to the boot 375 environment. 376 .RE 377 .sp 378 .ne 2 379 .na 380 \fB-s\fR 381 .ad 382 .sp .6 383 .RS 4n 384 Lists information about the snapshots of the boot environment. 385 .RE 386 .sp 387 .ne 2 388 .na 389 \fB-H\fR 390 .ad 391 .sp .6 392 .RS 4n 393 Do not list header information. Each field in the list information is 394 separated by a semicolon. 395 .RE 396 .sp 397 .ne 2 398 .na 399 \fB-v\fR 400 .ad 401 .sp .6 402 .RS 4n 403 Verbose mode. Displays verbose error messages from \fBbeadm\fR. 404 .RE 405 .RE 406 407 .sp 408 .ne 2 409 .na 410 \fBbeadm\fR \fBmount\fR [\fB-v\fR] \fIbeName\fR \fImountpoint\fR 411 .ad 412 .sp .6 413 .RS 4n 414 Mounts a boot environment named beName at mountpoint. mountpoint must be an 415 already existing empty directory. 416 .sp 417 .ne 2 418 .na 419 \fB-v\fR 420 .ad 421 .sp .6 422 .RS 4n 423 Verbose mode. Displays verbose error messages from \fBbeadm\fR. 424 .RE 425 .RE 426 427 .sp 428 .ne 2 429 .na 430 \fBbeadm\fR \fBunmount\fR [\fB-fv\fR] \fIbeName\fR | \fImountpoint\fR 431 .ad 432 .sp .6 433 .RS 4n 434 Unmounts the boot environment named beName. The command can also be given a path to a 435 beName mount point on the system. 436 .sp 437 .ne 2 438 .na 439 \fB-f\fR 440 .ad 441 .sp .6 442 .RS 4n 443 Forcefully unmount the boot environment even if its currently busy. 444 .RE 445 .sp 446 .ne 2 447 .na 448 \fB-v\fR 449 .ad 450 .sp .6 451 .RS 4n 452 Verbose mode. Displays verbose error messages from \fBbeadm\fR. 453 .RE 454 .RE 455 456 .sp 457 .ne 2 458 .na 459 \fBbeadm\fR \fBrename\fR [\fB-v\fR] \fIbeName\fR \fInewBeName\fR 460 .ad 461 .sp .6 462 .RS 4n 463 Renames the boot environment named \fIbeName\fR to \fInewBeName\fR. 464 .sp 465 .ne 2 466 .na 467 \fB-v\fR 468 .ad 469 .sp .6 470 .RS 4n 471 Verbose mode. Displays verbose error messages from \fBbeadm\fR. 472 .RE 473 .RE 474 475 .sp 476 .ne 2 477 .na 478 \fBbeadm\fR \fBrollback\fR [\fB-v\fR] \fIbeName\fR \fIsnapshot\fR | \fIbeName@snapshot\fR 479 .ad 480 .sp .6 481 .RS 4n 482 Roll back the boot environment named \fIbeName\fR to existing snapshot 483 of the boot environment named \fIbeName@snapshot\fR. 484 .sp 485 .ne 2 486 .na 487 \fB-v\fR 488 .ad 489 .sp .6 490 .RS 4n 491 Verbose mode. Displays verbose error messages from \fBbeadm\fR. 492 .RE 493 .RE 494 495 .sp 496 .ne 2 497 .na 498 \fBbeadm\fR \fBactivate\fR [\fB-v\fR] \fIbeName\fR 499 .ad 500 .sp .6 501 .RS 4n 502 Makes beName the active BE on next reboot. 503 .sp 504 .ne 2 505 .na 506 \fB-v\fR 507 .ad 508 .sp .6 509 .RS 4n 510 Verbose mode. Displays verbose error messages from \fBbeadm\fR. 511 .RE 512 .RE 513 514 .SH ALTERNATE BE LOCATION 515 .LP 516 The alternate BE location outside rpool/ROOT can be configured 517 by modifying the BENAME_STARTS_WITH parameter in /etc/default/be. 518 For example: BENAME_STARTS_WITH=rootfs 519 520 .SH EXAMPLES 521 .LP 522 \fBExample 1\fR: Create a new BE named BE1, by cloning the current live BE. 523 .sp 524 .in +2 525 .nf 526 \fB# beadm create BE1\fR 527 .fi 528 .in -2 529 .sp 530 531 .LP 532 \fBExample 2\fR: Create a new BE named BE2, by cloning the existing inactive 533 BE 534 named BE1. 535 .sp 536 .in +2 537 .nf 538 \fB# beadm create -e BE1 BE2\fR 539 .fi 540 .in -2 541 .sp 542 543 .LP 544 \fBExample 3\fR: Create a snapshot named now of the existing BE named BE1. 545 .sp 546 .in +2 547 .nf 548 \fB# beadm create BE1@now\fR 549 .fi 550 .in -2 551 .sp 552 553 .LP 554 \fBExample 4\fR: Create a new BE named BE3, by cloning an existing snapshot of 555 BE1. 556 .sp 557 .in +2 558 .nf 559 \fB# beadm create -e BE1@now BE3\fR 560 .fi 561 .in -2 562 .sp 563 564 .LP 565 \fBExample 5\fR: Create a new BE named BE4 based on the currently running BE. 566 Create the new BE in rpool2. 567 .sp 568 .in +2 569 .nf 570 \fB# beadm create -p rpool2 BE4\fR 571 .fi 572 .in -2 573 .sp 574 575 .LP 576 \fBExample 6\fR: Create a new BE named BE5 based on the currently running BE. 577 Create the new BE in rpool2, and create its datasets with compression turned 578 on. 579 .sp 580 .in +2 581 .nf 582 \fB# beadm create -p rpool2 -o compression=on BE5\fR 583 .fi 584 .in -2 585 .sp 586 587 .LP 588 \fBExample 7\fR: Create a new BE named BE6 based on the currently running BE 589 and provide a description for it. 590 .sp 591 .in +2 592 .nf 593 \fB# beadm create -d "BE6 used as test environment" BE6\fR 594 .fi 595 .in -2 596 .sp 597 598 .LP 599 \fBExample 8\fR: Activate an existing, inactive BE named BE3. 600 .sp 601 .in +2 602 .nf 603 \fB# beadm activate BE3\fR 604 .fi 605 .in -2 606 .sp 607 608 .LP 609 \fBExample 9\fR: Mount the BE named BE3 at /mnt. 610 .sp 611 .in +2 612 .nf 613 \fB# beadm mount BE3 /mnt\fR 614 .fi 615 .in -2 616 .sp 617 618 .LP 619 \fBExample 10\fR: Unmount the mounted BE named BE3. 620 .sp 621 .in +2 622 .nf 623 \fB# beadm unmount BE3\fR 624 .fi 625 .in -2 626 .sp 627 628 .LP 629 \fBExample 11\fR: Destroy the BE named BE3 without verification. 630 .sp 631 .in +2 632 .nf 633 \fB# beadm destroy -f BE3\fR 634 .fi 635 .in -2 636 .sp 637 638 .LP 639 \fBExample 12\fR: Destroy the snapshot named now of BE1. 640 .sp 641 .in +2 642 .nf 643 \fB# beadm destroy BE1@now\fR 644 .fi 645 .in -2 646 .sp 647 648 .LP 649 \fBExample 13\fR: Rename the existing, inactive BE named BE1 to BE3. 650 .sp 651 .in +2 652 .nf 653 \fB# beadm rename BE1 BE3\fR 654 .fi 655 .in -2 656 .sp 657 658 .LP 659 \fBExample 14\fR: Roll back the BE named BE1 to snapshot BE1@now. 660 .sp 661 .in +2 662 .nf 663 \fB# beadm rollback BE1 BE1@now\fR 664 .fi 665 .in -2 666 .sp 667 668 .LP 669 \fBExample 15\fR: List all existing boot environments. 670 671 .sp 672 .in +2 673 .nf 674 \fB# beadm list\fR 675 BE Active Mountpoint Space Policy Created 676 -- ------ ---------- ----- ------ ------- 677 BE2 - - 72.0K static 2008-05-21 12:26 678 BE3 - - 332.0K static 2008-08-26 10:28 679 BE4 - - 15.78M static 2008-09-05 18:20 680 BE5 NR / 7.25G static 2008-09-09 16:53 681 .fi 682 .in -2 683 .sp 684 685 .LP 686 \fBExample 16\fR: List all existing boot environmets and list all dataset and 687 snapshot information about those bootenvironments. 688 689 .sp 690 .in +2 691 .nf 692 \fB# beadm list -d -s\fR 693 694 BE/Dataset/Snapshot Active Mountpoint Space Policy Created 695 ------------------- ------ ---------- ----- ------ ------- 696 BE2 697 p/ROOT/BE2 - - 36.0K static 2008-05-21 12:26 698 p/ROOT/BE2/opt - - 18.0K static 2008-05-21 16:26 699 p/ROOT/BE2/opt@now - - 0 static 2008-09-08 22:43 700 p/ROOT/BE2@now - - 0 static 2008-09-08 22:43 701 BE3 702 p/ROOT/BE3 - - 192.0K static 2008-08-26 10:28 703 p/ROOT/BE3/opt - - 86.0K static 2008-08-26 10:28 704 p/ROOT/BE3/opt/local - - 36.0K static 2008-08-28 10:58 705 BE4 706 p/ROOT/BE4 - - 15.78M static 2008-09-05 18:20 707 BE5 708 p/ROOT/BE5 NR / 6.10G static 2008-09-09 16:53 709 p/ROOT/BE5/opt - /opt 24.55M static 2008-09-09 16:53 710 p/ROOT/BE5/opt@bar - - 18.38M static 2008-09-10 00:59 711 p/ROOT/BE5/opt@foo - - 18.38M static 2008-06-10 16:37 712 p/ROOT/BE5@bar - - 139.44M static 2008-09-10 00:59 713 p/ROOT/BE5@foo - - 912.85M static 2008-06-10 16:37 714 .fi 715 .in -2 716 .sp 717 718 \fBExample 17\fR: List all dataset and snapshot information about BE5 719 720 .sp 721 .in +2 722 .nf 723 \fB# beadm list -a BE5\fR 724 725 BE/Dataset/Snapshot Active Mountpoint Space Policy Created 726 ------------------- ------ ---------- ----- ------ ------- 727 BE5 728 p/ROOT/BE5 NR / 6.10G static 2008-09-09 16:53 729 p/ROOT/BE5/opt - /opt 24.55M static 2008-09-09 16:53 730 p/ROOT/BE5/opt@bar - - 18.38M static 2008-09-10 00:59 731 p/ROOT/BE5/opt@foo - - 18.38M static 2008-06-10 16:37 732 p/ROOT/BE5@bar - - 139.44M static 2008-09-10 00:59 733 p/ROOT/BE5@foo - - 912.85M static 2008-06-10 16:37 734 .fi 735 .in -2 736 .sp 737 738 .LP 739 \fBExample 18\fR: List machine parsable information about all boot 740 environments. 741 742 .sp 743 .in +2 744 .nf 745 \fB# beadm list -H\fR 746 747 BE2;;;;55296;static;1211397974 748 BE3;;;;339968;static;1219771706 749 BE4;;;;16541696;static;1220664051 750 BE5;215b8387-4968-627c-d2d0-f4a011414bab;NR;/;7786206208;static;1221004384 751 .fi 752 .in -2 753 .sp 754 755 .SH EXIT STATUS 756 .sp 757 .LP 758 The following exit values are returned: 759 .sp 760 .ne 2 761 .na 762 \fB0\fR 763 .ad 764 .sp .6 765 .RS 4n 766 Successful completion 767 .RE 768 769 .sp 770 .ne 2 771 .na 772 \fB>0\fR 773 .ad 774 .sp .6 775 .RS 4n 776 Failure 777 .RE 778 779 780 .SH FILES 781 .sp 782 .LP 783 .sp 784 .ne 2 785 .na 786 \fB/var/log/beadm/<beName>/create.log.<yyyymmdd_hhmmss>\fR 787 .ad 788 .sp .6 789 .RS 4n 790 Log used for capturing beadm create output 791 .sp 792 .nf 793 \fIyyyymmdd_hhmmss\fR - 20071130_140558 794 \fIyy\fR - year; 2007 795 \fImm\fR - month; 11 796 \fIdd\fR - day; 30 797 \fIhh\fR - hour; 14 798 \fImm\fR - minute; 05 799 \fIss\fR - second; 58 800 .fi 801 .in -2 802 .sp 803 .RE 804 .sp 805 .LP 806 .sp 807 .ne 2 808 .na 809 \fB/etc/default/be\fR 810 .ad 811 .sp .6 812 .RS 4n 813 Contains default value for BENAME_STARTS_WITH parameter 814 .sp 815 .RE 816 817 .SH ATTRIBUTES 818 .sp 819 .LP 820 See \fBattributes\fR(5) for descriptions of the following attributes: 821 .sp 822 823 .sp 824 .TS 825 box; 826 c | c 827 l | l . 828 ATTRIBUTE TYPE ATTRIBUTE VALUE 829 _ 830 Interface Stability Uncommitted 831 .TE 832 833 834 .SH SEE ALSO 835 .sp 836 .LP 837 .BR zfs (1M)