Caution - A Solaris Flash archive cannot be properly created when a non-global zone is
installed. The Solaris Flash feature is not compatible with the Solaris Zones
partitioning technology. If you create a Solaris Flash archive, the resulting archive
is not installed properly when the archive is deployed under these conditions:

The archive is created in a non-global zone

The archive is created in a global zone that has non-global zones installed

To Create a Solaris Flash Archive for an Initial Installation

After you install the master system, create a Solaris Flash archive to use
to install other systems.

The path to the directory in which you want to save the archive file. If you do not specify a path, flarcreate saves the archive file in the current directory.

filename

The name of the archive file.

If the archive creation is successful, the flarcreate command returns an exit code of 0.

If the archive creation fails, the flarcreate command returns a nonzero exit code.

Make a copy of the archive and save it. The copy can be
used in the future to update a clone system with a differential archive.

Creating a Solaris Flash Archive (Examples)

File systems can be copied exactly or can be customized by excluding some
directories or files. You can achieve the same results by using different options.
Use the options that best suit your environment.

The file systems in the following examples have been greatly simplified for clarification.
Rather than use file system names such as /var, /usr, or /opt, the master
system file structure for these examples is the following:

/aaa/bbb/ccc/ddd
/aaa/bbb/fff
/aaa/eee
/ggg

Caution - Use the flarcreate file-exclusion options with caution. If you exclude some directories, others
that you were unaware of might be left in the archive, such as
system configuration files. The system would then be inconsistent and the installation would
not work. Excluding directories and files is best used with data that can
easily be removed without disrupting the system, such as large data files.

Creating a Solaris Flash Archive (Various Examples)

Example 3-6 Creating an Exact Duplicate Archive

In this example, the archive is named archive1. This archive is copied exactly
from the master system and then compressed. The archive is an exact duplicate
of the master system and is stored in archive1.flar.

In this example, some individual files are greater than 4 Gbytes. The default archiving
utility, cpio, cannot handle these large files. The -L pax copy method is used
to create an archive that contains large individual files. The archive is named
archive1. This archive is copied exactly from the master system and then compressed. The
archive is an exact duplicate of the master system and is stored
in archive1.flar.

Example 3-8 Creating an Archive From an Alternate root (/) File System

In this example, the archive is named archive4. This archive is copied exactly
from the master system and then compressed. The archive is an exact duplicate
of the master system and is stored in archive4.flar. The -R option
is used to create the archive from another directory tree.

# flarcreate -n archive4 -c -R /x/yy/zz archive4.flar

Example 3-9 Creating an Archive and Adding Keywords to Describe the Archive

In this example, the archive is named archive3. This archive is copied exactly
from the master system and then compressed. Options add descriptions to the archive-identification
section, which can help you to identify the archive later. For information about
keywords, their values, and formats, see Solaris Flash Keywords.

Creating a Solaris Flash Archive and Customizing Files (Examples)

Example 3-10 Creating an Archive and Excluding and Including Files and Directories

In this example, the archive is named archive2. This archive is copied from the
master system but is not an exact copy. The content under the /aaa
directory is excluded, but the content in /aaa/bbb/ccc remains.

# flarcreate -n archive2 -x /aaa -y /aaa/bbb/ccc archive2.flar

To check the file structure of the archive, type the following. The excluded
directories that include copied files appear, but only the files that were restored
contain data.

# flar info -l aaa
aaa
aaa/bbb/ccc
aaa/bbb/ccc/ddd
aaa/bbb
ggg

Example 3-11 Creating an Archive Excluding and Including Files and Directories by Using Lists

In this example, the archive is named archive5. This archive is copied from the
master system but is not an exact copy.

The exclude file contains the following list:

/aaa

The include file contains the following list:

/aaa/bbb/ccc

The content under the /aaa directory is excluded, but the content in
/aaa/bbb/ccc remains.

# flarcreate -n archive5 -X exclude -f include archive5.flar

To check about the file structure of the archive, type the following. The
excluded directories that include copied files appear, but only the files that were
restored contain data.

Example 3-13 Creating an Archive Excluding and Including Files and Directories by Using a List With the -z Option

In this example, the archive is named archive3. It is copied from the
master system but is not an exact copy. The files and directories to
be selected are included in filter1 file. Within the files, the directories are
marked with a minus (-) or a plus (+) to indicate which files
to exclude and restore. In this example, the directory /aaa is excluded
with a minus and the subdirectory /aaa/bbb/ccc is restored with a plus.
The filter1 file contains the following list.

- /aaa
+ /aaa/bbb/ccc

The following command produces the archive.

# flarcreate -n archive3 -z filter1 archive3.flar

To check the file structure of the archive, type the following command. The
excluded directories that include copied files appear, but only the files that were
restored contain data.

To Create a Solaris Flash Differential Archive With an Updated Master Image

Before creating a differential archive, you need two images to compare: an unchanged
master image and an updated master image. One image is the unchanged master
image that has been kept unchanged. This image was stored and needs to
be accessed. The second image is the unchanged master image that is updated
with minor changes. The root (/) file system is the default for the
new image, but you can access this image if it has been stored
elsewhere. After you have the two images, you can create a differential archive,
which contains only the differences between the two images. The differential archive can
then be installed on clones that were installed previously with the unchanged master image.

Prepare the master system with changes. Before changes are made, the master system
should be running a duplicate of the original archive.

Note - A copy of the unchanged master image must be kept protected from changes
and available for mounting later.

Specifies the name that you give the archive. The archive_name you specify is the value of the content_name keyword. The name is listed in the archive-identification section.

-Aunchanged_master_image_dir

Creates a differential archive by comparing a new system image with the image that is specified by the unchanged_master_image_dir argument. By default, the new system image is root (/). You can change the default with the -R option. unchanged_master_image_dir is a directory where the unchanged system image is stored or mounted through UFS, NFS, or the lumount command.

You can include and exclude some files by using the options for contents selection. For a list of options, see flar Command.

Example 3-14 Creating a Differential Archive With the New Master Image on the Master System

In this example, the directory for unchanged master image is named unchanged_master1.
The new master image that contains changes is the root (/) directory. The
new master image is compared to the unchanged master image and the resulting
differential archive is then compressed. The differential archive is stored in diffarchive1.flar file. The
archive contains files that are to be deleted, changed, or added when installed.

Example 3-15 Creating a Differential Archive With the Images Stored on an Inactive Boot Environment

In this example, the unchanged master image, unchanged_master1, is stored on an inactive
boot environment and is accessed by mounting the boot environment. The new master
image is the root (/) directory. The new master image is compared to
the unchanged master and the resulting differential archive is then compressed. The archive
is stored in diffarchive4.flar. The archive contains files that are to be
deleted, changed, or added when installed.

To Create a Solaris Flash Differential Archive by Using Solaris Live Upgrade

To manage system updates, you can use Solaris Live Upgrade to copy the
OS, which creates a new boot environment. This copy can be compared to
the master system that has been updated with minor changes. The resulting
Solaris Flash differential archive can then be installed on clone systems.

Example 3-16 Creating a Differential Archive by Using Solaris Live Upgrade

master_BE is the name of the current boot environment. copy_BE is the name of
the new boot environment. The file systems root (/) and /usr are placed
on s0 and s3. The lustatus command reports that the new boot environment
copy is complete. The SUNWman package is added to the master system. After
the master system is updated by adding the SUNWman package, the flarcreate
command creates a differential archive by comparing the changed master and the unchanged
new boot environment.