Solaris 9 9/04 Installation Guide

To Create a Boot Environment With RAID-1 Volumes (Mirrors) (Command-Line Interface)

When you create a boot environment, Solaris Live Upgrade uses Solaris Volume Manager technology to create RAID-1 volumes. When creating a boot environment, you can use Solaris Live Upgrade to manage the following tasks.

To use the mirroring capabilities of Solaris Live Upgrade, you must create a state database and a state database replica. A state database stores information on disk about the state of your Solaris Volume Manager configuration.

  1. Log in as superuser.

  2. To create the new boot environment, type:


    # lucreate [-A 'BE_description']  \
    -m mountpoint:device[,metadevice]:fs_options [-m...] \
    -n BE_name
    
    -A 'BE_description'

    (Optional) Enables the creation of a boot environment description that is associated with the boot environment name BE_name. The description can be any length and can contain any characters.

    -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 types of file systems and keywords:

      • 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 taken on the file systems. These keywords can create a logical device, change the configuration of a logical device, or delete a logical device.

        • mirror creates a RAID–1 volume or mirror on the specified device. In subsequent -m options, you must specify attach to attach at least one concatenation to the new mirror. The specified device must be correctly named. For example, a logical device name of /dev/md/dsk/d10 or the short name of d10 can serve as a mirror name. For more information about naming devices, see “Overview of Solaris Volume Manager Components” in Solaris Volume Manager Administration Guide.

        • detach removes a concatenation from a volume that is associated with a specified mount point. The volume does not need to be specified.

        • attach attaches a concatenation to the mirror that is associated with a specified mount point. The physical disk slice that is specified is made into a single device concatenation for attaching to the mirror. To specify a concatenation to attach to a disk, you append a comma and the name of that concatenation to the device name. If you omit the comma and the concatenation name, lucreate selects a free volume for the concatenation.

          lucreate allows you to create only concatenations that contain a single physical slice. This command allows you to attach up to three concatenations to a mirror.

        • preserve saves the existing file system and its contents. This keyword enables you to bypass the copying process that copies the contents of the source boot environment. Saving the contents enables a quick creation of the new boot environment. For a particular mount point, you can use preserve with only one physical device. When you use preserve, lucreate checks that the device's contents are suitable for a specified file system. This check is limited and cannot guarantee suitability.

          The preserve keyword can be used with both a physical slice and Solaris Volume Manager volume.

          • If you use the preserve keyword when the UFS file system is on a physical slice, the contents of the UFS file system is saved on the slice. In the following example of the -m option, the preserve keyword saves the contents of the physical device c0t0d0s0 as the file system for the mount point for the root (/) file system.


            -m /:c0t0d0s0:preserve,ufs 
            
          • If you use the preserve keyword when the UFS file system is on a volume, the contents of the UFS file system is saved on the volume.

            In the following example of the -m option, the preserve keyword saves the contents of the RAID-1 volume (mirror) d10 as the file system for the mount point for the root (/) file system.


            -m /:d10:preserve,ufs
            

            In the following example of the -m option, a RAID-1 volume (mirror) d10 is configured as the file system for the mount point for the root (/) file system. The single-slice concatenation d20 is detached from its current mirror. d20 is attached to mirror d10. The root (/) file system is preserved on submirror d20.


            -m /:d10:mirror,ufs -m /:d20:detach,attach,preserve 
            
    -n BE_name

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

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


    Example 35–9 Creating a Boot Environment With a Mirror and Specifying Devices (Command Line)

    In this example, the mount points for the file systems are specified by using the -m option.

    • A description, mydescription, is associated with the name another_disk.

    • lucreate configures a UFS file system for the mount point root (/). A mirror, d10, is created. This mirror is the receptacle for the current boot environment's root (/) file system that is copied to the mirror d10. All data on the mirror d10 is overwritten.

    • Two slices, c0t0d0s0 and c0t1d0s0, are submirrors, d1 and d2. These two submirrors are added to mirror d10.

    • The new boot environment is named another_disk.


    # lucreate -A 'mydescription' \
    -m /:/dev/md/dsk/d10:ufs,mirror \
    -m /:/dev/dsk/c0t0d0s0,d1:attach \
    -m /:/dev/dsk/c0t1c0s0,d2:attach -n another_disk
    

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


    Example 35–10 Creating a Boot Environment With a Mirror and Not Specifying a Submirror Name (Command Line)

    In this example, the mount points for the file systems are specified by using the -m option.

    • A description, mydescription, is associated with the name another_disk.

    • lucreate configures a UFS file system for the mount point root (/). A mirror, d10, is created. This mirror is the receptacle for the current boot environment's root (/) file system that is copied to the mirror d10. All data on the mirror d10 is overwritten.

    • Two slices, c0t0d0s0 and c0t1d0s0, are specified to be used as submirrors. The submirrors are not specified, but the lucreate command chooses names from a list of available volume names. These two submirrors are attached to mirror d10.

    • The new boot environment is named another_disk.


    # lucreate -A 'mydescription' \
    -m /:/dev/md/dsk/d10:ufs,mirror \
    -m /:/dev/dsk/c0t0d0s0:attach \
    -m /:/dev/dsk/c0t1d0s0:attach -n another_disk
    

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


    Example 35–11 Creating a Boot Environment and Detaching a Submirror (Command Line)

    In this example, the mount points for the file systems are specified by using the -m option.

    • A description, mydescription, is associated with the name another_disk.

    • lucreate configures a UFS file system for the mount point root (/). A mirror, d10, is created.

    • Slice c0t0d0s0 is removed from its current mirror. The slice is specified to be submirror d1 and is added to mirror d10. The contents of the submirror, the root (/) file system, are saved and no copy occurs. Slice c0t1d0s0 is submirror d2 and is added to mirror d10.

    • The new boot environment is named another_disk.


    # lucreate -A 'mydescription' \
    -m /:/dev/md/dsk/d10:ufs,mirror \
    -m /:/dev/dsk/c0t0d0s0,d1:detach,attach,preserve \
    -m /:/dev/dsk/c0t1d0s0,d2:attach -n another_disk
    

    This example can be abbreviated as in the following example. The physical and logical device names are shortened. The specifiers for the submirrors d1 and d2 are omitted.


    # lucreate -A 'mydescription' \
    -m /:d10:ufs,mirror \
    -m /:c0t0d0s0:detach,attach,preserve \
    -m /:c0t1d0s0:attach -n another_disk
    

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


    Example 35–12 Creating a Boot Environment, Detaching a Submirror, and Saving Its Contents (Command Line)

    In this example, the mount points for the file systems are specified by using the -m option.

    • A description, mydescription, is associated with the name another_disk.

    • lucreate configures a UFS file system for the mount point root (/). A mirror, d20, is created.

    • Slice c0t0d0s0 is removed from its current mirror and added to the mirror d20. The name of the submirror is not specified. The contents of the submirror, the root (/) file system, are saved and no copy occurs.

    • The new boot environment is named another_disk.


    # lucreate -A 'mydescription' \
    -m /:/dev/md/dsk/d20:ufs,mirror \
    -m /:/dev/dsk/c0t0d0s0:detach,attach,preserve \
    -n another_disk
    

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


    Example 35–13 Creating a Boot Environment With Two Mirrors (Command Line)

    In this example, the mount points for the file systems are specified by using the -m option.

    • A description, mydescription, is associated with the name another_disk.

    • lucreate configures a UFS file system for the mount point root (/). A mirror, d10, is created. This mirror is the receptacle for the current boot environment's root (/) file system that is copied to the mirror d10. All data on the mirror d10 is overwritten.

    • Two slices, c0t0d0s0 and c0t1d0s0, are submirrors, d1 and d2. These two submirrors are added to mirror d10.

    • lucreate configures UFS file system for the mount point /opt. A mirror, d11, is created. This mirror is the receptacle for the current boot environment's /opt file system that is copied to the mirror d11. All data on the mirror d11 is overwritten.

    • Two slices, c2t0d0s1 and c3t1d0s1, are submirrors, d3 and d4. These two submirrors are added to mirror d11.

    • The new boot environment is named another_disk.


    # lucreate -A 'mydescription' \
    -m /:/dev/md/dsk/d10:ufs,mirror \
    -m /:/dev/dsk/c0t0d0s0,d1:attach \
    -m /:/dev/dsk/c0t1d0s0,d2:attach \
    -m /opt:/dev/md/dsk/d11:ufs,mirror \
    -m /opt:/dev/dsk/c2t0d0s1,d3:attach \
    -m /opt:/dev/dsk/c3t1d0s1,d4:attach -n another_disk
    

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