Swap slices are shared between boot environments by default. By not specifying swap with the -m option, your current and new boot environment share the same swap slices. If you want to reconfigure the new boot environment's swap, use the -m option to add or remove swap slices in the new boot environment.
The swap slice cannot be in use by any boot environment except the current boot environment or if the -s option is used, the source boot environment. The boot environment creation fails if the swap slice is being used by any other boot environment, whether it is a swap, UFS, or any other file system.
You can create a boot environment with the existing swap slices and then edit the vfstab file after the creation.
Log in as superuser.
Type:
# lucreate [-A 'BE_description'] -m mountpoint:device:fs_type \ -m -:device:swap -n BE_name |
The new boot environment is created with swap moved to a different slice or device.
In this example, the current boot environment contains root (/) on /dev/dsk/c0t0d0s0 and swap is on /dev/dsk/c0t0d0s1. The new boot environment copies root (/) to /dev/dsk/c0t4d0s0 and uses both /dev/dsk/c0t0d0s1 and /dev/dsk/c0t4d0s1 as swap slices. A description, Solaris 9 test Jan. 2001, is associated with the boot environment name second_disk.
# lucreate -A 'Solaris 9 test Jan 2001' -c first_disk \ -m /:/dev/dsk/c0t4d0s0:ufs -m -:/dev/dsk/c0t0d0s1:swap \ -m -:/dev/dsk/c0t4d0s1:swap -n second_disk |
These swap assignments are effective only after booting from second_disk. If you have a long list of swap slices, use the -M option. See To Create a Boot Environment and Reconfigure Swap Using a List (Command-Line Interface).
When creation of the new boot environment is complete, it can be upgraded and can be activated (made bootable). See Chapter 33, Upgrading With Solaris Live Upgrade (Tasks).