10.2. Preparing for an Interactive RestoreThe easiest way to get started using flash archive is to create backups for an interactive restore. This requires more work during the recovery process, but you'll have a bootable backup in only a few minutes. Later in this chpater, we'll explain how to take this backup to the next level by making the restore proceed without interaction. 10.2.1. Creating Flash Archive ImagesBuilding 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). 10.2.1.1. Determining filesystems to back upWhile 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.
10.2.1.2. Using flar createflar 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:
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 10.2.1.3. Creating a flash archive tapeOnce 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
10.2.2. Bare-Metal Recovery with Flash ArchiveNow that we've created a flash archive image, let's use it to perform an interactive restore of a Solaris system. To do this, perform the following steps:
10.2.2.1. An interactive recovery exampleThe following example restores an image from tape. If your images are on disk, you would select option 2 instead of option 5. Please specify the media from which you will install the Solaris Operating Environment. Media: 1. CD/DVD 2. Network File System 3. HTTP (Flash archive only) 4. FTP (Flash archive only) 5. Local Tape (Flash archive only) Media [1]: 5 Please specify the local tape device and the position on the tape where the Flash archive is located. To select a different media, enter B to go Back. Tape Device or B [/dev/rmt/0] /dev/rmt/0n Tape Position or B [1] 0 You selected the following Flash archives for initial install: Tape /dev/rmt/0n 0 Press Return to continue or enter D to deselect all archives: <enter> To select additional Flash archives, please specify the media where the archives are located. Media: 1. CD/DVD 2. Network File System 3. HTTP 4. FTP 5. Local Tape 6. None - Archive Selection Complete If there are archives that contain additional filesystems, you can specify them here. Media [6]: <enter> The system is being initialized, please wait... - Select which disks you want to lay out the file systems on. Available Disks: Disk Size c0t0d0 4000 MB Enter 'y' to layout file systems on the specified disk. This will erase all existing data on the disk. Enter 'n' to leave the disk unmodified. Enter 'e' to leave the remaining disks unmodified and continue with install. Layout file systems on disk c0t0d0 (bootdisk) (y/n) [y]? y At least one of the disks selected for installing Solaris software has file systems or unnamed slices that you can choose to preserve. Do you want to preserve existing data? Enter y to preserve data or n to skip data preservation. [n] <enter> The Solaris Installer is determining size requirements based on your choices, please wait... \ File System operations: 1. Print the current partition table 2. Modify a disk's partition table 3. Return to beginning 4. Done Select the number corresponding to a file system operation, 'Return to beginning' to change selections, or 'Done' to proceed with the install [4]: 1 Disk Name Slice Name Size(Mb) c0t0d0 / 2000 swap 514 File System operations: 1. Print the current partition table 2. Modify a disk's partition table 3. Return to beginning 4. Done Select the number corresponding to a file system operation, 'Return to beginning' to change selections, or 'Done' to proceed with the install [4]: 4 The following items will be installed: Tape /dev/rmt/0n 0 Root Device: c0t0d0 File Systems: c0t0d0s0 / 2000 MB c0t0d0s1 swap 514 MB Enter 'y' to accept these values and start the installation, or 'n' to return to disk selection to make changes (y/n): y Installing... Extracting archive(s) Enter 'y' to accept these values and start the installation, or 'n' to return to disk selection to make changes (y/n): y Installing... (Note: The progress meter may not move during the extraction.) Extracting archive(s) |-1%--------------25%-----------------50%-----------------75%--------------100%| ...lines deleted... Feb 18 09:19:45 rpcbind: rpcbind terminating on signal. syncing file systems... done rebooting... Resetting ... The flash recovery is now complete. Once the system reboots, you may have to configure system information such as the node name and network information. |