1 BEADM(1M) Maintenance Commands BEADM(1M) 2 3 4 5 NAME 6 beadm - utility for managing zfs boot environments 7 8 SYNOPSIS 9 beadm create [-a] [-d description] 10 [-e non-activeBeName | beName@snapshot] 11 [-o property=value] ... [-p zpool] 12 [-v] beName 13 14 15 beadm create [-v] beName@snapshot 16 17 18 beadm destroy [-fFsv] beName | beName@snapshot 19 20 21 beadm list [-a | -ds] [-H] 22 [-k|-K date | name | space] [-v] [beName] 23 24 25 beadm mount [-s ro|rw] [-v] beName mountpoint 26 27 28 beadm unmount [-fv] beName | mountpoint 29 30 31 beadm rename [-v] beName newBeName 32 33 34 beadm activate [-v] beName 35 36 37 beadm rollback [-v] beName snapshot 38 39 40 beadm rollback [-v] beName@snapshot 41 42 43 DESCRIPTION 44 The beadm command is the user interface for managing zfs Boot 45 Environments (BEs). This utility is intended to be used by System 46 Administrators who want to manage multiple Solaris Instances on a 47 single system. 48 49 The beadm command supports the following operations: 50 51 - Create a new BE, based on the active BE. 52 53 - Create a new BE, based on an inactive BE. 54 55 - Create a snapshot of an existing BE. 56 57 - Create a new BE, based on an existing snapshot. 58 59 - Create a new BE, and copy it to a different zpool. 60 61 - Activate an existing, inactive BE. 62 63 - Mount a BE. 64 65 - Unmount a BE. 66 67 - Destroy a BE. 68 69 - Destroy a snapshot of a BE. 70 71 - Rename an existing, inactive BE. 72 73 - Roll back a BE to an existing snapshot of a BE. 74 75 - Display information about your snapshots and datasets. 76 77 78 SUBCOMMANDS 79 The beadm command has the subcommands and options listed below. Also 80 see EXAMPLES below. 81 82 beadm 83 84 Displays command usage. 85 86 87 beadm create [-a] [-d description] 88 [-e non-activeBeName | beName@snapshot] 89 [-o property=value] ... [-p zpool] 90 [-v] beName 91 92 93 Creates a new boot environment named beName. If the -e option is 94 not provided, the new boot environment will be created as a clone 95 of the currently running boot environment. If the -d option is 96 provided then the description is also used as the title for the 97 BE's entry in the boot menu. If the -d option is not provided, 98 beName will be used as the title. 99 100 -a 101 102 Activate the newly created BE upon creation. The default is to 103 not activate the newly created BE. 104 105 -d description 106 107 Create a new BE with a description associated with it. 108 109 -e non-activeBeName 110 111 Create a new BE from an existing inactive BE. 112 113 -e beName@snapshot 114 115 Create a new BE from an existing snapshot of the BE named 116 beName. 117 118 -o property=value 119 120 Create the datasets for new BE with specific ZFS properties. 121 Multiple -o options can be specified. See zfs(1M) for more 122 information on the -o option. 123 124 -p zpool 125 126 Create the new BE in the specified zpool. If this is not 127 provided, the default behavior is to create the new BE in the 128 same pool as as the origin BE. This option is not supported in 129 non-global zone. 130 131 -v 132 133 Verbose mode. Displays verbose error messages from beadm. 134 135 136 beadm create [-v] beName@snapshot 137 138 Creates a snapshot of the existing BE named beName. 139 140 -v 141 142 Verbose mode. Displays verbose error messages from beadm. 143 144 145 beadm destroy [-fFsv] beName | beName@snapshot 146 147 Destroys the boot environment named beName or destroys an existing 148 snapshot of the boot environment named beName@snapshot. Destroying 149 a boot environment will also destroy all snapshots of that boot 150 environment. Use this command with caution. 151 152 -f 153 154 Forcefully unmount the boot environment if it is currently 155 mounted. 156 157 -F 158 159 Force the action without prompting to verify the destruction of 160 the boot environment. 161 162 -s 163 164 Destroy all snapshots of the boot environment. 165 166 -v 167 168 Verbose mode. Displays verbose error messages from beadm. 169 170 171 beadm list [-a | -ds] [-H] 172 [-k|-K date | name | space] [-v] [beName] 173 174 Lists information about the existing boot environment named beName, 175 or lists information for all boot environments if beName is not 176 provided. The 'Active' field indicates whether the boot 177 environment is active now, represented by 'N'; active on reboot, 178 represented by 'R'; or both, represented by 'NR'. In non-global 179 zone the 'Active' field also indicates whether the boot environment 180 has a non-active parent BE, represented by 'x'; is active on boot 181 in a non-active parent BE, represented by 'b'. Activate, rollback 182 and snapshot operations for boot environments from non-active 183 global parent BE aren't supported, destroy is allowed if these boot 184 environments aren't active on boot. 185 186 Each line in the machine parsable output has the boot environment 187 name as the first field. The 'Space' field is displayed in bytes 188 and the 'Created' field is displayed in UTC format. The -H option 189 used with no other options gives the boot environment's uuid in the 190 second field. This field will be blank if the boot environment 191 does not have a uuid. See the EXAMPLES section. In non-global 192 zones, this field shows the uuid of the parent BE. 193 194 -a 195 196 Lists all available information about the boot environment. 197 This includes subordinate file systems and snapshots. 198 199 -d 200 201 Lists information about all subordinate file systems belonging 202 to the boot environment. 203 204 -s 205 206 Lists information about the snapshots of the boot environment. 207 208 -H 209 210 Do not list header information. Each field in the list 211 information is separated by a semicolon. 212 213 -k date 214 215 Sort BEs by date of creation in ascending order. This is 216 default. 217 218 -k name 219 220 Lexical sort of BEs by name in ascending order. 221 222 -k space 223 224 Sort BEs by space in ascending order. 225 226 -K date | name | space 227 228 Same as the -k option, but sorts in descending order. 229 230 -v 231 232 Verbose mode. Displays verbose error messages from beadm. 233 234 235 beadm mount [-s ro|rw] [-v] beName mountpoint 236 237 Mounts a boot environment named beName at mountpoint. mountpoint 238 must be an already existing empty directory. 239 240 -s ro|rw 241 242 Mount the shared filesystems of the BE in read-only or read- 243 write mode. 244 245 -v 246 247 Verbose mode. Displays verbose error messages from beadm. 248 249 250 beadm unmount [-fv] beName | mountpoint 251 252 Unmounts the boot environment named beName. The command can also be 253 given a path to a beName mount point on the system. 254 255 -f 256 257 Forcefully unmount the boot environment even if its currently 258 busy. 259 260 -v 261 262 Verbose mode. Displays verbose error messages from beadm. 263 264 265 beadm rename [-v] beName newBeName 266 267 Renames the boot environment named beName to newBeName. 268 269 -v 270 271 Verbose mode. Displays verbose error messages from beadm. 272 273 274 beadm rollback [-v] beName snapshot | beName@snapshot 275 276 Roll back the boot environment named beName to existing snapshot of 277 the boot environment named beName@snapshot. 278 279 -v 280 281 Verbose mode. Displays verbose error messages from beadm. 282 283 284 beadm activate [-v] beName 285 286 Makes beName the active BE on next reboot. 287 288 -v 289 290 Verbose mode. Displays verbose error messages from beadm. 291 292 293 ALTERNATE BE LOCATION 294 The alternate BE location outside rpool/ROOT can be configured by 295 modifying the BENAME_STARTS_WITH parameter in /etc/default/be. For 296 example: BENAME_STARTS_WITH=rootfs 297 298 299 EXAMPLES 300 Example 1: Create a new BE named BE1, by cloning the current live BE. 301 302 # beadm create BE1 303 304 305 306 Example 2: Create a new BE named BE2, by cloning the existing inactive 307 BE named BE1. 308 309 # beadm create -e BE1 BE2 310 311 312 313 Example 3: Create a snapshot named now of the existing BE named BE1. 314 315 # beadm create BE1@now 316 317 318 319 Example 4: Create a new BE named BE3, by cloning an existing snapshot 320 of BE1. 321 322 # beadm create -e BE1@now BE3 323 324 325 326 Example 5: Create a new BE named BE4 based on the currently running BE. 327 Create the new BE in rpool2. 328 329 # beadm create -p rpool2 BE4 330 331 332 333 Example 6: Create a new BE named BE5 based on the currently running BE. 334 Create the new BE in rpool2, and create its datasets with compression 335 turned on. 336 337 # beadm create -p rpool2 -o compression=on BE5 338 339 340 341 Example 7: Create a new BE named BE6 based on the currently running BE 342 and provide a description for it. 343 344 # beadm create -d "BE6 used as test environment" BE6 345 346 347 348 Example 8: Activate an existing, inactive BE named BE3. 349 350 # beadm activate BE3 351 352 353 354 Example 9: Mount the BE named BE3 at /mnt. 355 356 # beadm mount BE3 /mnt 357 358 359 360 Example 10: Unmount the mounted BE named BE3. 361 362 # beadm unmount BE3 363 364 365 366 Example 11: Destroy the BE named BE3 without verification. 367 368 # beadm destroy -f BE3 369 370 371 372 Example 12: Destroy the snapshot named now of BE1. 373 374 # beadm destroy BE1@now 375 376 377 378 Example 13: Rename the existing, inactive BE named BE1 to BE3. 379 380 # beadm rename BE1 BE3 381 382 383 384 Example 14: Roll back the BE named BE1 to snapshot BE1@now. 385 386 # beadm rollback BE1 BE1@now 387 388 389 390 Example 15: List all existing boot environments. 391 392 393 # beadm list 394 BE Active Mountpoint Space Policy Created 395 -- ------ ---------- ----- ------ ------- 396 BE2 - - 72.0K static 2008-05-21 12:26 397 BE3 - - 332.0K static 2008-08-26 10:28 398 BE4 - - 15.78M static 2008-09-05 18:20 399 BE5 NR / 7.25G static 2008-09-09 16:53 400 401 402 403 Example 16: List all existing boot environmets and list all dataset and 404 snapshot information about those bootenvironments. 405 406 407 # beadm list -d -s 408 409 BE/Dataset/Snapshot Active Mountpoint Space Policy Created 410 ------------------- ------ ---------- ----- ------ ------- 411 BE2 412 p/ROOT/BE2 - - 36.0K static 2008-05-21 12:26 413 p/ROOT/BE2/opt - - 18.0K static 2008-05-21 16:26 414 p/ROOT/BE2/opt@now - - 0 static 2008-09-08 22:43 415 p/ROOT/BE2@now - - 0 static 2008-09-08 22:43 416 BE3 417 p/ROOT/BE3 - - 192.0K static 2008-08-26 10:28 418 p/ROOT/BE3/opt - - 86.0K static 2008-08-26 10:28 419 p/ROOT/BE3/opt/local - - 36.0K static 2008-08-28 10:58 420 BE4 421 p/ROOT/BE4 - - 15.78M static 2008-09-05 18:20 422 BE5 423 p/ROOT/BE5 NR / 6.10G static 2008-09-09 16:53 424 p/ROOT/BE5/opt - /opt 24.55M static 2008-09-09 16:53 425 p/ROOT/BE5/opt@bar - - 18.38M static 2008-09-10 00:59 426 p/ROOT/BE5/opt@foo - - 18.38M static 2008-06-10 16:37 427 p/ROOT/BE5@bar - - 139.44M static 2008-09-10 00:59 428 p/ROOT/BE5@foo - - 912.85M static 2008-06-10 16:37 429 430 431 Example 17: List all dataset and snapshot information about BE5 432 433 434 # beadm list -a BE5 435 436 BE/Dataset/Snapshot Active Mountpoint Space Policy Created 437 ------------------- ------ ---------- ----- ------ ------- 438 BE5 439 p/ROOT/BE5 NR / 6.10G static 2008-09-09 16:53 440 p/ROOT/BE5/opt - /opt 24.55M static 2008-09-09 16:53 441 p/ROOT/BE5/opt@bar - - 18.38M static 2008-09-10 00:59 442 p/ROOT/BE5/opt@foo - - 18.38M static 2008-06-10 16:37 443 p/ROOT/BE5@bar - - 139.44M static 2008-09-10 00:59 444 p/ROOT/BE5@foo - - 912.85M static 2008-06-10 16:37 445 446 447 448 Example 18: List machine parsable information about all boot 449 environments. 450 451 452 # beadm list -H 453 454 BE2;;;;55296;static;1211397974 455 BE3;;;;339968;static;1219771706 456 BE4;;;;16541696;static;1220664051 457 BE5;215b8387-4968-627c-d2d0-f4a011414bab;NR;/;7786206208;static;1221004384 458 459 460 461 EXIT STATUS 462 The following exit values are returned: 463 464 0 465 466 Successful completion 467 468 469 >0 470 471 Failure 472 473 474 475 FILES 476 /var/log/beadm/<beName>/create.log.<yyyymmdd_hhmmss> 477 478 Log used for capturing beadm create output 479 480 yyyymmdd_hhmmss - 20071130_140558 481 yy - year; 2007 482 mm - month; 11 483 dd - day; 30 484 hh - hour; 14 485 mm - minute; 05 486 ss - second; 58 487 488 489 490 /etc/default/be 491 492 Contains default value for BENAME_STARTS_WITH parameter 493 494 495 496 ATTRIBUTES 497 See attributes(5) for descriptions of the following attributes: 498 499 500 501 502 +--------------------+-----------------+ 503 | ATTRIBUTE TYPE | ATTRIBUTE VALUE | 504 +--------------------+-----------------+ 505 |Interface Stability | Uncommitted | 506 +--------------------+-----------------+ 507 508 509 SEE ALSO 510 zfs(1M) 511 512 513 514 February 21, 2016 BEADM(1M)