Solaris Live Upgrade 2.0 Guide

Creating a New Boot Environment

You can use Solaris Live Upgrade with menus or at the command line (CLI). Procedures are documented for both. These procedures do not exhaust the possibilities for using Solaris Live Upgrade. For more information about commands, see Chapter 6, Solaris Live Upgrade Reference for commands and the appropriate man pages, which more fully document the CLI.

Creating a boot environment provides a method of copying critical file systems from an active boot environment to an new boot environment. The Create menu, Configuration submenu, and lucreate command provide a means to reorganize a disk if necessary, customize file systems, and copy the critical file systems to the new boot environment.

Before file systems are copied to the new boot environment, they can be customized so that critical file system directories are either merged into their parent directory or split from their parent directory. User-defined (shareable) file systems are shared between boot environments by default. The following procedures for creating enable you to merge, split, and define a new slice for a shareable file system, if you want it copied rather than shared. Swap is a shared file system that can be split and merged.

For an overview of critical and shareable file systems, see Creating a Boot Environment Overview.

To Create a Boot Environment (Character Interface)

  1. From the main menu, select Create.

    The system displays the Create a Boot Environment submenu.

  2. Type the name of the active boot environment (if necessary) and the new boot environment and confirm. You are only required to type the name of the active boot environment the first time you create a boot environment.

    The boot environment name can be no longer than 30 characters, contain only alphanumeric characters, and contain no mulitbyte characters.


    Name of Current Boot Environment:    solaris7
    Name of New Boot Environment:   solaris8 
    
  3. To save your changes, press F3.

    The configuration menu appears.

    Figure 3–3 Solaris Live Upgrade Configuration Menu

    Graphic

    You see your original boot environment at the top of the screen and the boot environment to be created at the bottom. The area for selecting a critical file system in the Device field is blank until you select a critical file system. Shareable file systems such as /export or swap are displayed in the Device field and are shared (contain the same mount point) by both the source and target boot environments. In the new boot environment, you can split or merge critical file systems such as /usr, /var, or /opt file systems with the root file system. You can also change the file system type. The swap file system is a special case. Swap is shared by default, but you can also split and merge (add and remove) swap slices.

    For an overview of critical and shareable file systems, see Creating a Boot Environment Overview.

    • The Device field is the name of a disk device, of the form /dev/dsk/cnumtnumdnumsnum

    • The FS_Type field can be one of the following:

      • vxfs indicates a Veritas file system

      • swap indicates a swap file system

      • ufs indicates a UFS file system

  4. (Optional) The following tasks can be done at any time:

    • To print the information on screen to an ASCII file, press F5.

    • To scroll through the file system list, press Control-X.

      You can then switch between the file systems of the active and new boot environment and scroll.

    • To exit the Configuration menu at any time, press F6.

      • If you are in the Configuration menu, changes are not saved and file systems are not altered.

      • If you are in a Configuration submenu, you return to the Configuration menu.

  5. Select an available slice by pressing F2.

    The Choices menu displays available slices on the system for the field where the cursor is placed. The menu displays a Slice field and a file system FS_Type field.

    1. Use the arrow keys to place the cursor in a field to select a slice or file system type.

      • When you place your cursor in the Slice field, all free slices are displayed. For root (/), Choices only displays free slices that meet the root (/) file system limitations. See Guidelines for Selecting a Slice for the root (/) File System.

      • When you place your cursor in the FS_Type field, all available file system types are displayed.

      • Slices in bold can be selected for the current file system. The size of the slice is estimated by adding the size of the file system plus thirty percent for room to upgrade.

      • Slices not in bold are too small to support the given file system.

    2. Press Return to choose a slice.

      The slice appears in the Slice field or the file system type changes in the FS_Type field.

  6. (Optional) If available slices do not meet the minimum requirements, to reslice any available disks, press F4.

    The Solaris Live Upgrade Slice Configuration menu appears.

    The format command runs, which enables you to create new slices. Follow the screen to create a new slice. For information on the format command, see the format man page.

    Use the arrow keys to move between the Device field and FS_Type field. The Size (Mbytes) field is automatically completed as the devices are selected.

    1. To free a device, press Control-D.

      The slice is now available and appears on the Choices menu.

    2. To return to the Configuration menu, press F3.

  7. (Optional) Splitting critical file systems puts the file systems on separate mount points. To split a file system:

    (To merge file systems, see Step 8.)

    1. Select the file system to split.

      You can split or exclude file systems such as /usr, /var, or /opt with their parent directory.


      Note –

      When creating file systems for a boot environment, the rules are identical to the rules for creating file systems for the Solaris operating environment. Solaris Live Upgrade cannot prevent you from making invalid configurations for critical file systems. For example, you could enter a lucreate command that would create separate file systems for root (/) and /kernel—an invalid division of root (/).


    2. Press F8.

    3. Type the file system name for the new boot environment, for example:


      Enter the directory that will be a separate file system on the new boot environment: /opt
      

      When the new file system is verified, a new line is added to the screen.

    4. To return to the Configuration menu, press F3.

      The Configuration menu is displayed.

  8. (Optional) Merging puts the file systems on the same mount point. To merge a file system into its parent directory:

    (To split file systems, see Step 7.)

    1. Select the file system to merge.

      You can merge file systems such as /usr, /var, or /opt into their parent directory.

    2. Press F9.

      The file systems that will be combined are displayed, for example:


      /opt will be merged into /. 
    3. Press Return.

    4. To return to the Configuration menu, press F3.

      The Configuration menu is displayed.

  9. (Optional) Decide if you want to add or remove swap slices.

    • If you want to split a swap slice and put it on a new slice, continue with Step 10.

    • If you want to remove a swap slice, continue with Step 11.

  10. (Optional) To split a swap slice:

    1. In the Device field, select the swap slice you want to split.

    2. Press F8.

    3. At the prompt, type:


      Enter the directory that will be a separate filesystem on the new BE: swap
      
    4. Press F2 Choice.

      The Choice menu lists the available slices for swap.

    5. Select the slice to put swap on.

      The slice appears in the Device field and you have a new slice for swap.

  11. (Optional) To remove a swap slice:

    1. In the Device field, select the swap slice you are removing.

    2. Press F9.

    3. At the prompt, type yes.


      Slice /dev/dsk/c0t4d0s0 will not be swap partition. 
      Please confirm? [y, n]: y
      

      The swap slice no longer exists.

  12. Decide if you want to create the boot environment now or schedule the creation for later:

    • Press F3 to create the new boot environment now.

      The configuration is saved and you exit the configuration screen. The file systems are copied, the boot environment is made bootable, and an inactive boot environment is created.

      Creating a boot environment might take an hour or more, depending on your system configuration. The Solaris Live Upgrade main menu is then displayed.

    • If you want to schedule the creation for a later time, type y, then the start time, and an email address as in this example.


      Do you want to schedule the copy? y
      Enter the time in 'at' format to schedule create: 8:15 PM
      Enter the address to which the copy log should be mailed: someone@anywhere.com

      You are notified of the completion by email.

      For information on time formats, see the at(1) man page.

      You can schedule only one job at a time.

    After the creation is complete, the inactive boot environment is ready to be upgraded.

To Create a Boot Environment for the First Time (Command-Line Interface)


Note –

If you run lucreate without the -m option, the Configuration menu is displayed. The Configuration menu enables you to customize the new boot environment by redirecting files onto new mount points.


  1. Log in as superuser.

  2. To create the new boot environment, type:


    # lucreate -c BE_name -m mountpoint:device:fs_type \
     -n BE_name
    

    -c BE_name

    Assigns the name BE_name to the current boot environment. This option is required only when the first boot environment is created. If you run lucreate for the first time and you omit -c, you are prompted to name the current boot environment. If you use the -c option following the first boot environment creation, you receive an error message.

    -m mountpoint:device:fs_type [-m...]

    Specifies the vfstab information for the new boot environment. The file systems that are specified as arguments to -m can be on the same disk or they can be spread across multiple disks.

    • mountpoint can be any valid mount point or (hyphen), indicating a swap partition.

    • device field can be one of the following:

      • The name of a disk device, of the form /dev/dsk/cnumtnumdnumsnum.

      • The keyword merged, indicating that the file system at the specified mount point is to be merged with its parent.

    • fs_type field can be one of the following:

      • ufs, which indicates a UFS file system.

      • vxfs, which indicates a Veritas file system

      • swap, which indicates a swap file system

    -n BE_name

    The name of the boot environment to be created. BE_name must be unique on the system.


    Example 3–1 Creating a Boot Environment (Command Line)

    In this example, the active boot environment is named first_disk. The mount points for the file systems are noted. The new boot environment is named second_disk. Swap, in the new boot environment second_disk, is automatically shared from the source, first_disk.


    # lucreate -c first_disk -m /:/dev/dsk/c0t4d0s0:ufs \
    -m /usr:/dev/dsk/c0t4d0s1:ufs -n second_disk
    

    When creation of the new boot environment is complete, it can be upgraded and activated (made bootable).

To Create a Boot Environment and Merge File Systems (Command-Line Interface)

  1. Log in as superuser.

  2. Type:


    # lucreate  -m mountpoint:device:fs_type \
    -m mountpoint:device:fs_type -m mountpoint:merged:fs_type
    

    -m mountpoint:device:fs_type

    Specifies the vfstab information for the new boot environment. The file systems that are specified as arguments to -m can be on the same disk or they can be spread across multiple disks.

    • mountpoint can be any valid mount point or (hyphen), indicating a swap.

    • device field can be one of the following:

      • The name of a disk device, of the form /dev/dsk/cnumtnumdnumsnum.

      • The keyword merged, indicating that the file system at the specified mount point is to be merged with its parent.

    • fs_type field can be one of the following:

      • vxfs, which indicates a Veritas file system

      • swap, which indicates a swap file system

      • ufs, which indicates a UFS file system


    Example 3–2 Creating a Boot Environment and Merge File Systems (Command-Line Interface)

    In this example, the /usr/opt file system is combined with its parent file system /usr.


    # lucreate -m /:/dev/dsk/c0t4d0s0:ufs -m /usr:/dev/dsk/c0t4d0s1:ufs \
    -m /usr/opt:merged:ufs
    

    When creation of the new boot environment is complete, it can be upgraded and activated (made bootable).


To Create a Boot Environment and Split File Systems (Command-Line Interface)


Note –

When creating file systems for a boot environment, the rules are identical to the rules for creating file systems for the Solaris operating environment. Solaris Live Upgrade cannot prevent you from creating invalid configurations for critical file systems. For example, you could enter a lucreate command that would create separate file systems for root (/) and /kernel—an invalid division of root (/).


When splitting a directory into multiple mount points, hard links are not maintained across file systems. For example, if /usr/stuff1/file is hard linked to /usr/stuff2/file, and /usr/stuff1 and /usr/stuff2 are split into separate file systems, the link between the files no longer exists. lucreate issues a warning message to that effect and a symbolic link is created to replace the lost hard link.

  1. Log in as superuser.

  2. Type:


    # lucreate -m mountpoint:device:fs_type -m mountpoint:device:fs_type \
    -m mountpoint:device:fs_type -m mountpoint:device:fs_type \
     -m mountpoint:device:fs_type  -n new_BE
    

    -m mountpoint:device:fs_type

    Specifies the vfstab information for the new boot environment. The file systems that are specified as arguments to -m can be on the same disk or they can be spread across multiple disks.

    • mountpoint can be any valid mount point or (hyphen), indicating a swap partition.

    • device field can be one of the following:

      • The name of a disk device, of the form /dev/dsk/cnumtnumdnumsnum.

      • The keyword merged, indicating that the file system at the specified mount point is to be merged with its parent.

    • fs_type field can be one of the following:

      • ufs, which indicates a UFS file system.

      • vxfs, which indicates a Veritas file system

      • swap, which indicates a swap file system

    -n BE_name

    The name of the boot environment to be created. BE_name must be unique on the system.


    Example 3–3 Creating a Boot Environment and Splitting File Systems (Command-Line Interface)

    In this example, the preceding command splits the root (/) file system over multiple disk slices in the new boot environment. Assume a source boot environment that has /usr, /var, and /opt all on root (/): /dev/dsk/c0t0d0s0 /.

    On the new boot environment, separate /usr, /var, and /opt, mounting these file systems on their own slices, as follows:

    /dev/dsk/c0t1d0s0 /

    /dev/dsk/c0t1d0s1 /var

    /dev/dsk/c0t1d0s7 /usr

    /dev/dsk/c0t1d0s5 /opt


    # lucreate -m /:/dev/dsk/c0t1d0s0:ufs -m /usr:/dev/dsk/c0t1d0s7:ufs \
     -m /var:/dev/dsk/c0t1d0s1:ufs -m /opt:/dev/dsk/c0t1d0s5:ufs -n second_disk
    

    When creation of the new boot environment is complete, it can be upgraded and activated (made bootable).


To Create a Boot Environment and Reconfigure Swap (Command-Line Interface)

Swap slices are shared between boot environments by default. By NOT specifying swap with the -m option, your current and inactive 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.


Note –

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.


  1. Log in as superuser.

  2. Type:


    # lucreate  -m mountpoint:device:fs_type \
    -m -:device:swap -n BE_name
    

    -m mountpoint:device:fs_type

    Specifies the vfstab information for the new boot environment. The file systems that are specified as arguments to -m can be on the same disk or they can be spread across multiple disks.

    • mountpoint can be any valid mount point or (hyphen), indicating a swap slice.

    • device field can be one of the following:

      • The name of a disk device, of the form /dev/dsk/cnumtnumdnumsnum

      • The keyword merged, indicating that the file system at the specified mount point is to be merged with its parent

    • fs_type field can be one of the following:

      • vxfs, which indicates a Veritas file system

      • swap, which indicates a swap file system

      • ufs, which indicates a UFS file system

    -n BE_name

    The name of the boot environment to be created. BE_name must be unique.

    The new boot environment is created with swap moved to a different slice or device.


    Example 3–4 Creating a Boot Environment and Reconfigure Swap (Command-Line Interface)

    In this example, the new boot environment uses both /dev/dsk/c0t0d0s1 and /dev/dsk/c0t4d0s1 as swap slices:


    # lucreate -m /:/dev/dsk/c0t4d0s0:ufs -m -:/dev/dsk/c0t0d0s1:swap \
     -m -:/dev/dsk/c0t0d0s1: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).


To Create a Boot Environment and Reconfigure Swap Using a List (Command-Line Interface)

If you have a long list of swap slices, create a swap list. lucreate uses this list for the swap slices in the new boot environment.


Note –

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 the swap slice contains a swap, ufs, or any other file system.


  1. Create a list a swap slices to be used in the new boot environment. The location and name of this file is user-defined. In this example, the contents of the /etc/lu/swapslices file is a list of devices and slices:


    -:/dev/dsk/c0t3d0s2:swap
    -:/dev/dsk/c0t3d0s2:swap
    -:/dev/dsk/c0t4d0s2:swap
    -:/dev/dsk/c0t5d0s2:swap
    -:/dev/dsk/c1t3d0s2:swap
    -:/dev/dsk/c1t4d0s2:swap
    -:/dev/dsk/c1t5d0s2:swap
  2. Type:


    # lucreate  -m mountpoint:device:fs_type \
     -M slice_list   -n BE_name
    

    -m mountpoint:device:fs_type

    Specifies the vfstab information for the new boot environment. The file systems that are specified as arguments to -m can be on the same disk or they can be spread across multiple disks.

    • mountpoint can be any valid mount point or (hyphen), indicating a swap slice.

    • device field can be one of the following:

      • The name of a disk device, of the form /dev/dsk/cnumtnumdnumsnum.

      • The keyword merged, indicating that the file system at the specified mount point is to be merged with its parent

    • fs_type field can be one of the following:

      • vxfs, which indicates a Veritas file system

      • swap, which indicates a swap file system

      • ufs, which indicates a UFS file system

    -M slice_list

    List of -m options, which are collected in the file slice_list. Specify these arguments in the format that is specified for -m. Comment lines, which begin with a hash mark (#), are ignored. The -M option is useful when you have a long list of file systems for a boot environment. Note that you can combine -m and -M options. For example, you can store swap slices in slice_list and specify root (/) and /usr slices with -m.

    The -m and -M options support the listing of multiple slices for a given mount point. In processing these slices, lucreate skips any unavailable slices and selects the first available slice.

    -n BE_name

    The name of the boot environment to be created. BE_name must be unique.


    Example 3–5 Create a Boot Environment and Reconfigure Swap Using a List (Command-Line Interface)

    In this example, swap in the new boot environment is the list of slices that are noted in the /etc/lu/swapslices file.


    # lucreate -m /:/dev/dsk/c02t4d0s0:ufs -m /usr:/dev/dsk/c02t4d0s1:ufs \
    -M /etc/lu/swapslices -n second_disk 
    

    When creation of the new boot environment is complete, it can be upgraded and activated (made bootable).


To Create a Boot Environment and Copy a Shareable File System (Command-Line Interface)

If you want a shareable file system to be copied to the new boot environment, specify the mount point to be copied with the -m option. Otherwise, shareable file systems are shared by default, and maintain the same mount point in the vfstab file. Any updating done to the shareable file system is available to both boot environments.

  1. Log in as superuser.

  2. Create the boot environment.


    # lucreate -m mountpoint:device:fs_type \
    -m mountpoint:device:fs_type -m mountpoint:device:fs_type -n BE_name
    

    mountpoint:device:fs_type

    Specifies the vfstab information for the new boot environment. The file systems that are specified can be on the same disk or they can be spread across multiple disks.

    • mountpoint can be any valid mount point or (hyphen), indicating a swap slice.

    • device field can be one of the following:

      • The name of a disk device, of the form /dev/dsk/cnumtnumdnumsnum.

      • The keyword merged, indicating that the file system at the specified mount point is to be merged with its parent.

    • fs_type field can be one of the following:

      • vxfs, which indicates a Veritas file system

      • swap, which indicates a swap file system

      • ufs, which indicates a UFS file system

    -n BE_name

    The name of the boot environment to be created. BE_name must be unique.


    Example 3–6 Creating a Boot Environment and Copying a Shareable File System (Command-Line Interface)

    In this example, a boot environment is created and the /home file system is copied to the target boot environment.


    # lucreate -m /:/dev/dsk/c0t4d0s0:ufs -m /usr:/dev/dsk/c0t4d0s1:ufs \
    -m /home:/dev/dsk/c0t4d0s4:ufs -n second_disk
    

    When creation of the new boot environment is complete, it can be upgraded and activated (made bootable).