Backup Solaris 9/10 OS System

Using Flash Archive in the Solaris Operating System for Disaster RecoveryUsing Flash Archive in the Solaris Operating System for Disaster Recovery

Introduction

Generic disaster recovery preparation for the UNIX platform includes maintaining the server’s configuration details. For example, in the system information, you need to keep a hard copy of the method you are using for backup and restore. If you use ufsdump to back up the OS to locally attached tape drives, the information to keep includes all the backup file systems, the order of the file systems backed up, as well as information about the backup tape, OS level, patch level, disk partitions, file system layout, the third-party drivers, and so on.

The Solaris 9 and 10 OS releases provide a new installation function called flash installation. With flash installation, you can create a single reference installation of the Solaris OS on one system, called the master system. Then you can replicate that installation as a new installation on any number of systems, called cloned systems, that have the same architecture as the master system.

Although flash installation is designed to clone a master machine, I have done some tests and found it to be very useful for disaster recovery. This article shows what I did to back up the system using the flar command and then recover the system using the backup on the tape. This test used a Sun Enterprise 4000 server with the RSM Array 2000 disk system, running the Solaris 8 OS, with the latest cluster patch installed. There were two 16 Gbyte internal disks. One had the original OS installed and the other was used to test the recovery of the OS. A Digital Linear Tape (DLT) 7000 tape drive was connected to the machine.

The Procedure

1. Bring the machine into single-user mode before creating the archive. Two reasons exist for doing this: First, although flarcreate can be run at any time, it is better to run it when the system is not busy. Second, there was a problem with excluding multiple file systems from the archive when using the flarcreate command. (Some patches addressing this problem are found in the Solaris 9 OS.)

In single-user mode, flarcreate archives only those file systems that have entries in the mnttab.

# init 0
ok> boot -s

2. Log in as root. If /opt file system is on the local disk, mount it. Otherwise, skip this step.

# mount /opt

3. Create a flash archive: Use the flarcreate command to create a flash OS backup to the tape (in this case a DLT tape).

# flarcreate -n testhost.flar -c -S -R / -t /dev/rmt/2
WARNING: hash generation disabled when using tape (-t)
Full Flash
Checking integrity...
Integrity OK.
Running precreation scripts...
Precreation scripts done.
Determining the size of the archive...
.......
The archive will be approximately 2.69GB.
Creating the archive...
.......
18226862 blocks
Archive creation complete.

4. Check that the archive on the tape completed successfully.

# flar info -t /dev/rmt/2
files_archived_method=cpio
creation_date=20040927044841
creation_master=testhost
content_name=testhost.flar
creation_node=testhost
creation_hardware_class=sun4u
creation_platform=SUNW,Ultra-Enterprise
creation_processor=sparc
creation_release=5.8
creation_os_name=SunOS
creation_os_version=Generic_117350-02
files_compressed_method=none
content_architectures=sun4u

5. Next, recover the system from the backup using the backed up image on the tape. You can use a different machine to do the recovery test as long as it has the same kernel architecture. In this case, I used the same machine. First bring the machine down. Then insert the Solaris 8 OS Software CD 1 media and follow the installation menus, as shown in the following examples:

ok boot cdrom
Resetting ...

The Solaris Installation Program

The Solaris OS installation program is divided into a series of short sections that prompt you to provide information for the installation. At the end of each section, you can review and change your selections before continuing.

Please note: While navigating these menus, the mouse cannot be used. If your keyboard does not have function keys, or if your function keys do not respond, press ESC. The legend at the bottom of the screen will change to show the keys to use for navigation.

F2_Continue F5_Exit F6_Help

Select F2_Continue.

Solaris Interactive Installation

This system can be upgraded, so there are two ways to install the Solaris OS software:

  • The Upgrade option updates the Solaris OS software to the new release and saves as many modifications to the previous version of Solaris software as possible. Be sure to back up the system before using the Upgrade option.
  • The Initial option overwrites the system disks with the new version of the Solaris OS software. This option allows you to preserve any existing file systems. Be sure to back up any modifications made to the previous version of Solaris software before starting the Initial option.

After you select an option and complete the tasks that follow, a summary of your actions will be displayed. If you want to install the system using a flash archive, select Initial.

F2_Upgrade F3_Go Back F4_Initial F5_Exit F6_Help

Select F4_Initial.

Solaris Interactive Installation (Menu 2)

You’ll be using the Initial option for installing the Solaris OS software on the system. As mentioned previously, the Initial option overwrites the system disks when the new Solaris OS software is installed.

On the following screens, you can accept the defaults or you can customize how the Solaris OS software will be installed. To customize the installation, you may (1) select the type of Solaris OS software to install, (2) select disks to hold the software you’ve selected, and (3) specify how the file systems are laid out on the disks.

After completing these tasks, a summary profile of your selections will be displayed.

Here are two ways to install your Solaris OS software:

  • Standard installs your system from a standard Solaris distribution.
  • Flash installs your system from one or more flash archives.
F2_Standard F3_Go Back F4_Flash F5_Exit F6_Help

Select F4_Flash.

Flash Archive Installation Method

In this screen, you will be choosing a flash archive installation method, in this case select Local Tape.

Flash Archive Retrieval Method

On this screen you must select a method to retrieve the flash archive. The retrieval method depends on where the archive is stored. For example, if the archive is stored on a tape, select Local Tape.

Available Retrieval Methods

[ ] HTTP -> default

[ ] NFS

[ ] Local File

[X] Local Tape -> selected

[ ] Local Device


F2_Continue F5_Cancel F6_Help

Select Local Tape. Then select F2_Continue.

Flash Archive Addition

Please specify the path to the tape drive where the flash archive is located, as in the following:

Tape Drive Location: syrinx:/dev/rmt/0
Location: /dev/rmt/0
.......


F2_Continue F5_Cancel F6_Help

Select F2_Continue. (Note: Usually the path is /dev/rmt/0.)

Preserve Data?

Do you want to preserve existing data? At least one of the disks you’ve selected for installing the Solaris OS software has file systems or unnamed slices that you may want to save.

F2_Continue F3_Go Back F4_Preserve F5_Exit F6_Help

Select F2_Continue.

In the next step, you choose a disk where you want to install the OS. You can repartition the file systems in this step to meet your new requirements.

File System and Disk Layout

The summary that follows is your current file system and disk layout, based on the information you’ve supplied. Please note: If you choose to customize, you should understand file systems, their intended purpose on the disk, and how changing them may affect the operation of the system.

File system/Mount point Disk/Slice Size

overlap c0t11d0s2 17269 MB



F2_Continue F3_Go Back F4_Customize F5_Exit F6_Help

Select F4_Customize.

Mount Remote File Systems?

Do you want to mount software from a remote file server? This may be necessary if you had to remove software because of disk space problems.

F2_Continue F3_Go Back F4_Remote Mounts F5_Exit F6_Help

Select F2_Continue.

Profile

The following information is your profile for installing the Solaris OS software. It reflects the choices you’ve made on previous screens.

Installation Option: Flash

Boot Device: c1t0d0

Client Services: None


Software: 1 Flash Archive


File System and Disk Layout:


.......


F2_Continue F4_Change F5_Exit F6_Help

Select F2_Continue.

Reboot After Installation?

After you’ve installed the Solaris OS software, the system must be rebooted. You can have the system reboot automatically or, if you want to run scripts or do additional customization, you may reboot manually. To reboot manually, use the reboot(1M) command.

[X] Auto Reboot

[ ] Manual Reboot


F2_Begin_Installation F5_Cancel

Select F2_Begin_Installation.

6. After the system reboots, you can enter a new root password. The following shows the compression of the original file system layout and the recovery file system layout:

The original file system layout:

$ df -k
Filesystem kbytes used avail capacity Mounted on
/dev/md/dsk/d10 494235 55231 389581 13% /
/dev/md/dsk/d20 1525647 795052 669570 55% /usr
.......
/dev/md/dsk/d40 2056211 1419825 574700 72% /var
/dev/dsk/c1t4d0s0 4129822 4175 4084349 1% /tmp
/dev/dsk/c1t4d0s3 6194334 2280496 3851895 38% /home
/dev/md/dsk/d50 10177352 8905539 1170040 89% /opt

$ swap -l
swapfile dev swaplo blocks free
/dev/md/dsk/d30 85,30 16 4198368 4198368

The recovery file system:

$ df -k
Filesystem kbytes used avail capacity Mounted on
/dev/dsk/c0t11d0s0 494235 54233 390579 13% /
/dev/dsk/c0t11d0s1 1489367 793504 636289 56% /usr
.......
/dev/dsk/c0t11d0s4 1987399 1417795 509983 74% /var
/dev/dsk/c0t11d0s5 9943356 8895415 948508 91% /opt
/dev/dsk/c1t4d0s3 6194334 2280496 3851895 38% /home
/dev/dsk/c1t4d0s0 4129822 4173 4084351 1% /tmp

$ swap -l
swapfile dev swaplo blocks free
/dev/dsk/c0t11d0s3 32,443 16 4099424 4099424

As you can see, the sizes of swap, /usr, /var and /opt file systems were slightly different, because you can repartition as you wish. Also /home and /tmp file systems were still on the same device, unchanged.

Note: A problem occurred while recovering operating systems that had been mounted as metadevices. This was because the image created included all the metadevice settings and configuration files. After the restore, all those settings and configuration files were still in the same places. If you do not remove them manually, you will have problems booting the machine.

7. To remove those metadevice entries, you can boot the machine from a CD, mount the root file system as /a, and then delete MDD root info and MDD database info in the /etc/system file. Also, delete the entries in /etc/lvm/md.cf and mddb.cf files.

8. If possible, it’s preferable to remove the metadevice before you create the archive.

9. If the machine was on a network, you may have to reset some of the recovered machine’s network setting (such as the hosts, nsswitch.conf, and resolv.conf). This is because it is the nature of the flash installation function to “clone” other machines on the network.

10. If the machine is connected to external disks, you need to add those entries into the vfstab file. All the data will be there.

Conclusion

In some cases, you may be recovering a machine that has different peripherals than the master machine. If you install the master system with the core, end user, developer, or entire software group, the master system supports only the peripheral devices that are attached to the master machine at the time of backup.

With your disaster recovery plan, you should be able to recover a system that has different peripherals than the master machine. For this reason, you should install the Entire Plus OEM software group on the master machine. The flash archive created from the master machine with the Entire Plus OEM software group should work on any system that has peripheral devices supported by the installed release of the Solaris OS.

Source

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s