Solaris 10 11/06 Installation Guide: Solaris Live Upgrade and Upgrade Planning

ProcedureTo Create a Boot Environment and Customize the Content (Command-Line Interface)

The content of the file system on the new boot environment can be modified by using the following options. Directories and files are not copied to the new boot environment.

  1. Become superuser or assume an equivalent role.

    Roles contain authorizations and privileged commands. For more information about roles, see Configuring RBAC (Task Map) in System Administration Guide: Security Services.

  2. To create the new boot environment, type:


    # lucreate -m mountpoint:device[,metadevice]:fs_options [-m ...]  \ 
    [-x exclude_dir] [-y include] \
    [-Y include_list_file] \
    [-f exclude_list_file]\  
    [-z filter_list] [-I] -n BE_name
    
    -m mountpoint:device[,metadevice]:fs_options [-m ...]

    Specifies the file systems' configuration of the new boot environment in the vfstab. The file systems that are specified as arguments to -m can be on the same disk or they can be spread across multiple disks. Use this option as many times as needed to create the number of file systems that are needed.

    • 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/cwtxdysz

      • The name of a Solaris Volume Manager volume, of the form /dev/md/dsk/dnum

      • The name of a Veritas Volume Manager volume, of the form /dev/md/vxfs/dsk/dnum

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

    • fs_options 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. The swap mount point must be a (hyphen).

      • For file systems that are logical devices (mirrors), several keywords specify actions to be applied to the file systems. These keywords can create a logical device, change the configuration of a logical device, or delete a logical device. For a description of these keywords, see To Create a Boot Environment With RAID-1 Volumes (Mirrors) (Command-Line Interface).

    -x exclude_dir

    Excludes files and directories by not copying them to the new boot environment. You can use multiple instances of this option to exclude more than one file or directory.

    exclude_dir is the name of the directory or file.

    -y include_dir

    Copies directories and files that are listed to the new boot environment. This option is used when you have excluded a directory, but want to restore individual subdirectories or files.

    include_dir is the name of the subdirectory or file to be included.

    -Y list_filename

    Copies directories and files from a list to the new boot environment. This option is used when you have excluded a directory, but want to restore individual subdirectories or files.

    • list_filename is the full path to a file that contains a list.

    • The list_filename file must contain one file per line.

    • If a line item is a directory, all subdirectories and files beneath that directory are included. If a line item is a file, only that file is included.

    -f list_filename

    Uses a list to exclude directories and files by not copying them to the new boot environment.

    • list_filename is the full path to a file that contains a list.

    • The list_filename file must contain one file per line.

    -z list_filename

    Uses a list to copy directories and files to the new boot environment. Each file or directory in the list is noted with a plus “+” or minus “-”. A plus indicates an included file or directory and the minus indicates an excluded file or directory.

    • list_filename is the full path to a file that contains a list.

    • The list_filename file must contain one file per line. A space must follow the plus or minus before the file name.

    • If a line item is a directory and is indicated with a + (plus), all subdirectories and files beneath that directory are included. If a line item is a file and is indicated with a + (plus), only that file is included.

    -I

    Overrides the integrity check of system files. Use this option with caution.

    To prevent you from removing important system files from a boot environment, lucreate runs an integrity check. This check examines all files that are registered in the system package database and stops the boot environment creation if any files are excluded. Use of this option overrides this integrity check. This option creates the boot environment more quickly, but might not detect problems.

    -n BE_name

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

    When creation of the new boot environment is complete, it can be upgraded and can be activated (made bootable). See Chapter 5, Upgrading With Solaris Live Upgrade (Tasks).


Example 4–14 Creating a Boot Environment and Excluding Files (Command Line Interface)

In this example, the new boot environment is named second_disk. The source boot environment contains one file system, root (/). In the new boot environment, the /var file system is split from the root (/) file system and put on another slice. The lucreate command configures a UFS file system for the mount points root (/) and /var. Also, two /var mail files, root and staff are not copied to the new boot environment. Swap is automatically shared between the source and the new boot environment.


# lucreate -n second_disk \ 
-m /:/dev/dsk/c0t1d0s0:ufs -m /var/mail:/dev/dsk/c0t2d0s0:ufs  \  
-x /var/mail/root -x /var/mail/staff


Example 4–15 Creating a Boot Environment and Excluding and Including Files (Command Line Interface)

In this example, the new boot environment is named second_disk. The source boot environment contains one file system for the OS, root (/). The source also contains a file system that is named /mystuff. lucreate configures a UFS file system for the mount points root (/) and /mystuff. Only two directories in /mystuff are copied to the new boot environment: /latest and /backup. Swap is automatically shared between the source and the new boot environment.


# lucreate -n second_disk \ 
-m /:/dev/dsk/c01t0d0s0:ufs -m /mystuff:/dev/dsk/c1t1d0s0:ufs  \  
-x /mystuff -y /mystuff/latest -y /mystuff/backup