Solaris 9 Installation Guide

Creating an 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/eee

Caution - Caution -

Use the flar create 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.



Example 18-1 Creating an Exact Duplicate Archive

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


# flar create -n archive1 -c archive1.flar

To check on the file structure of the archive, type the following.


# flar info -l archive1.flar
aaa
aaa/bbb
aaa/bbb/ccc
aaa/bbb/ccc/ddd
aaa/eee


Example 18-2 Creating an Archive and Excluding and Including Files and Directories

In this example, the archive is named archive2. It is copied from the master system but is not an exact copy. The content under the root (/) file system is excluded, but the content in /aaa remains. The excluded directories and files appear, but are empty.


# flar create -n archive2 -x / -y /aaa  archive2.flar

To check on the file structure of the archive, type the following.


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


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

In this example, the archive is named archive5. It is copied from the master system but is not an exact copy. The content under the root (/) file system is excluded, but the content in /ccc remains. The excluded directories and files appear, but are empty. The exclude file contains a list that excludes the root (/) file system. The include file contains a list that restores the subdirectory /ccc.


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

To check on the file structure of the archive, type the following.


# flar info -l archive5.flar
aaa
aaa/bbb
aaa/bbb/ccc
aaa/bbb/ccc/ddd
aaa/eee


Example 18-4 Creating an Archive Excluding Files and Directories by Using a List and Restoring a Directory

In this example, the archive is named archive5. It is copied from the master system but is not an exact copy. The content under the root (/) file system is excluded, but the content in /ccc remains. The excluded directories and files appear but are empty. The exclude file contains a list that excludes the root (/) file system. The -y option restores the subdirectory /ccc.


# flar create -n archive5 -X exclude -y /ccc  archive5.flar

To check on the file structure of the archive, type the following.


# flar info -l archive5.flar
aaa
aaa/bbb
aaa/bbb/ccc
aaa/bbb/ccc/ddd
aaa/eee


Example 18-5 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 content under the root (/) file system is excluded, but the content in /ccc remains. The excluded directories and files appear, but are empty. The -z option refers to a list of files in a script, oracle_data. Within the script, the directories are marked with a minus or a plus to indicate which files to exclude and restore. In this example, the directories / and /aaa/bbb/ccc/ddd are excluded with a minus and the subdirectory /ccc is restored with a plus.


# flar create -n archive3 -z oracle_data archive3.flar 

To check on the file structure of the archive, type the following.


# flar info -l archive3.flar
aaa
aaa/bbb
aaa/bbb/ccc
aaa/bbb/ccc/ddd
aaa/eee


Example 18-6 Creating an Archive From an Alternate Boot Environment

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


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