Creating Flash Archive Images
Building a solid, repeatable, and tested backup process is the key to being able to
restore when you need to. This section describes the steps required to create a flash
archive image, from determining which filesystems to include to the tape creation
process (if desired).
Determining filesystems to back up
While any filesystem can be included in a flash archive, typically, only OS
filesystems are required to restore a Solaris system. Data restored from filesystems
not created during the recovery process is likely to be restored to the root
filesystem. This could have serious consequences, especially if the total amount of
data to restore exceeds the size of the root filesystem.
Tip
If you plan on performing a noninteractive restore, and you decide to include
any non-OS filesystems in the backup, you need to include those filesystems in your
profile file if you would like them created
prior to the restore.
flar
create
is the Solaris utility that creates flash
images. The process can either be scripted and run through a scheduler, such as
cron
, or run manually. If you run flar
create
manually and you plan to perform a
noninteractive restore, the image should be created on disk and then copied to tape,
due to prerequisites in the tape creation process.
The flar
manpages provide current syntax and
usage of the command. Here are the options used in the examples:
create
-
Tells flar
to create an archive.
info
-
Without any additional flags, info
examines an archive and displays the summary information it finds in the
archive. If given the additional -l
flag, it
displays the files found in the archive. (create
and info
are mutually
exclusive options.)
-c
-
Tells flar
to compress the archive as
it’s writing it.
-n
-
Gives the archive a name that is stored inside the archive. We can query
this name later in case the filename we stored it under isn’t very
helpful.
filename
or
tape_device
-
Passes flar
the name of a filename or
tape device to write to.
Here is an example of the flar
create
process running on a Solaris 9 system. In
this example, flar
compresses the archive (-c
), gives it a name of sun2.flar (-n
sun2.flar
), and uses sun2.flar as the filename to back up to as well:
# flar create -c -n sun2.flar sun2.flar
Full Flash
Checking integrity...
Integrity OK.
Running precreation scripts...
Precreation scripts done.
Determining the size of the archive...
3949130 blocks
The archive will be approximately 1.01GB.
Creating the archive...
3949130 blocks
Archive creation complete.
# echo $?
0
Note that at the end of the archive, we checked the return code by entering
echo $?
. The Solaris return code is the primary
method of determining the result of the flar
create
command. A return code of zero indicates a
successful completion while any nonzero return code indicates a failure.
After receiving a zero return code from the flar
create
command, you can use the flar
info
and flar
info
-l
commands to ensure that the image creation
process was successful. If the return code of flar
create
or the output of either flar
info
command indicates a problem, the archive
should be considered suspect. The following example shows an example of the flar
info
imagename
command:
# flar info sun2.flar
archive_id=c80af5b0c18ef7a9375e124c07f56875
files_archived_method=cpio
creation_date=20060211192433
creation_master=sun2
content_name=sun2.flar
creation_node=sun2
creation_hardware_class=sun4m
creation_platform=SUNW,SPARCstation-5
creation_processor=sparc
creation_release=5.9
creation_os_name=SunOS
creation_os_version=Generic_118558-11
files_compressed_method=compress
files_archived_size=470522936
content_architectures=sun4m
type=FULL
In addition to displaying general information about the flash archive image, you
can actually display a list of files included in the image using the flar
info
–l
imagename
command:
# flar info -l sun2.flar
lost+found
export
export/home0
export/home0/lost+found
export/home0/rules
export/home0/rules.ok
export/home0/sysidcfg
export/home0/standard.profile
~list truncated~
platform/sun4u/kernel/drv/sparcv9
platform/sun4u/kernel/drv/sparcv9/scmi2c
Creating a flash archive tape
Once the disk image has been created, you can create a tape to perform a
bare-metal recovery. All you have to do is use the dd
command:
# mt –f /dev/rmt/0n rewind
#dd if=sun2.flar of=/dev/rmt/0n obs=1024000
Tip
When creating a flash tape, use a tape drive that uses native Solaris OS drivers
and does not use nonstandard entries in the /kernel/drv/st.conf file. Using nonstandard entries in the st.conf file may cause problems not noticed until
performing a restore.