Creating a Flash Archive Recovery (FLAR) Image

This article provides the simplest instructions to create a Flash Archive recovery image that can be used to restore a system to "factory fresh" condition.

<>In this article I'm assuming you have access to boot media (CD/DVD or netinstall) and some form of off-storage to host the FLAR image.

Creating the FLAR image

  • Record the partition table of the disk drive that the image is for. This assumes that the replacement disk drive will be the same size, and parititioned identically to the original drive.

    There are two methods for obtaining the partition table of the disk drive:

    1. As root, use the format(1M) command to print out the partition table of the drive that the FLAR image will be taken from.
      # format
      The format command will provide the names of the partitions.
    2. As root, use the prtvtoc(1M) command to generate the parition information.
      # prtvtoc /dev/dsk/c0t0d0s0
      The prtvtoc command will provide the size of the partitions by the number of cylinders for each partition. Save the information to a safe location. It will be used during the restoration of the system image during recovery.
  • Make sure that there is adequate space for the FLAR image where it will be created. The FLAR archive will require up to 5GB of space without compression.
    # df -h /tmp
  • Create the FLAR archive using the flarcreate(1M) command. In this example, the FLAR image will be stored to a directory in under /tmp named FLAR_recovery. The FLAR image will be named myserver_recovery.flar. If stored locally, the creation of the image should take less than 30 minutes.
    # mkdir /tmp/FLAR_recovery
    # flarcreate -n my_recovery_image -x /tmp/FLAR_recovery /tmp/FLAR_recovery/myserver_recovery.flar
    In this example:
    • The "-n my_recovery_image" implants a name into the FLAR image. The name should be something unique and meaningful to better identify it as the FLAR image for the system.
    • The "-x /tmp/FLAR_recovery" option causes the /tmp/FLAR_recovery directory and its contents to be excluded from the FLAR image since it will not be needed in the recovery image.

      Note: By default, the flarcreate command ignores items that are located in "swap" partitions.

    • /tmp/FLAR_recovery/myserver_recovery.flar is the path and filename of the FLAR image. The filename should be something unique and meaingful to better identify it as the FLAR image for the system.

Saving the FLAR image

Saving your recovery image on the same disk drive that you intend to restore after a failure will not be useful when that same disk drive fails. The FLAR image must be saved to an external device or at a remote location across NFS. That external device or remote location must be accessible to the system at recovery time.

Copy the new FLAR to a safe location:

# cp /tmp/FLAR_recovery/myserver_recovery.flar /net/flarserver/images

Recovering the system image from a FLAR image.

The process begins as a normal installation using whichever install method you choose. Instead of installing from the boot method, the installer is used to install from the FLAR image.

  • Begin the boot process.
    • Using the initial boot media (installation CD/DVD).
      ok> boot cdrom
    • Using the netinstall service.
      ok> boot net
  • Supply the network, date/time, and password information for the system.
  • When the "Solaris Interactive Installation" part is reached, select "Flash" as the installation choice.
  • Supply the path to the off-system location of the FLAR image: /net/flarserver/images/myserver_recovery.flar
  • Select the correct Retrieval Method (HTTP, FTP, NFS) to locate the FLAR image. For our example, we copied to an NFS location.
  • Specify the FLAR image location. From our example, the location would be: flarserver:/images/myserver_recovery.flar
  • At the "Select Disks" section, select the disk to install the FLAR image onto.
  • There is no need to preserve existing data.
  • At the "File System and Disk Layout" window, choose "Customize" to edit the disk slices to input the values of the disk partition table from the original disk. The partition table corresponds to each slice on the disk. Partition 0 from the partition table maps to Slice 0 (s0) on the harddrive.
    • The slice sizes can be viewed in Cylinders to better match the output from the partition table.
    • Do not change the size of Slice 2. It must span the entire disk regardless of the space being allocated.
    • If the replacement disk has more storage space than the original disk, then it can be partitioned to use the space available. However, at least as much space for each partition must be allocated as it was allocated on the original disk.
  • After the system reboots, the recovery is now complete.

Post recovery

The recovery instructions assume that none of the hardware components have been added, removed or moved between the time that the recovery image was created and the time that a recovery is performed.

If a system has been recovered after hardware has been changed, then it is possible that the device trees (/dev and /devices) need to be updated.

This can be done with either a reconfiguration reboot of the system, or by using the devfsadm(1M) command.

# devfsadm -C