Chapter 13. AIX Bare-Metal Recovery

This chapter explains the procedure you would use to recover your IBM AIX operating system disk in case of a complete system failure—when you are left with nothing but bare metal.

Tip

This chapter was contributed by Mark Perino of Hitachi Data Systems. Mark tackles performance, AIX, Linux, and NAS problems when he’s not writing, hiking, or snowshoeing in Yosemite with his wife, Marissa, and kids, Steven and River.

IBM was the first Unix vendor to deliver a true bare-metal recovery tool. The mksysb command makes a complete “bootable” backup of the root volume group (rootvg) only. This allows you to perform a bare-metal recovery of an AIX host’s operating system. You can even back up using mksysb to a bootable tape, CD/DVD, or a Network Install Manager (NIM) server.

Unix Backup & Recovery mentioned using Sysback to make volume group backups. The Sysback utility has been incorporated into some commercial products from IBM and other vendors with the release of AIX 5.X. This book’s primary focus is on free methods to back up and restore, so we will not be covering Sysback.

IBM’s mksysb and savevg Utilities

The basis for a bare-metal recovery of an AIX system is the mksysb utility, which is included in AIX. It backs up all the files in the root volume group. mksysb backs up the rootvg, including:

  • Boot files

  • Base operating system (BOS)

  • System and configuration files in the rootvg

  • Additional software installed in the rootvg

It also backs up:

  • rootvg volume group information

  • Logical volume information

  • Paging space information

It does not consume space in the backup to save the paging space; it recreates it on a restore. mksysb is primarily useful for a bare-metal recovery. It also has limitations that may prevent it from becoming your only backup solution. Here are some of those limitations:

  • It cannot back up filesystems on something other than rootvg (see savevg)

  • It cannot back up raw logical devices

  • It has a limited ability to preserve logical volume layout (AIX 4.x)

  • It has restrictions restoring across different RS/6000 architectures (see the later section “System Cloning”)

  • It cannot track backups or perform incremental backups

  • It does not have tape robot controls

  • It can back up to a remotely attached tape drive but cannot remotely boot from it

Before AIX 5.x, there were significant differences in the mksysb program from one version to the next. As of AIX 5.x, mksysb is more stable. All AIX 5.x versions can preserve logical volume characteristics and paging space size. mksysb does not back up raw logical volumes. It cannot back up anything other than the root volume group.

mksysb can also be a good solution if you need to make occasional tape backups of your system in case of disk failure. It also can make an excellent companion to other backup programs that handle your application and user data, and provide things that mksysb cannot, such as incremental backups and remote restores. mksysb is not a good solution for environments that are using raw logical volumes; have data outside rootvg; or need to do incremental backups, flexible restores, and backups across the network.

You should always make backups before and after applying IBM maintenance-level upgrades. Maintenance-level upgrades with patches for JFS and JFS2 may not be backward-compatible. So without current and older backups, you run the risk of not being able to mount your filesystems.

Versions 4.3.3 and 5.x of AIX include a utility called savevg , which is actually a link to the mksysb command. When invoked this way, you can back up any volume group on your system, but the other mksysb constraints still apply.

Here are other requirements of the savevg command:

  • Volumes backed up using the savevg command must be varied on and have their filesystems mounted.

  • savevg cannot back up remotely mounted NFS and CIFS filesystems.

  • Filesystems must be of type JFS or JFS2.

mksysb and savevg can back up to different types of media:

  • Tape (bootable in the case of rootvg)

  • CD/DVD (bootable in the case of rootvg)

  • Image file on NFS mount

mksysb and savevg can be restored from:

  • Tape (bootable in the case of rootvg)

  • CD/DVD (bootable in the case of rootvg)

  • Internal disk (not recommended for rootvg)

  • NFS mount (bootable when used with a NIM server)

mksysb and savevg Format

mksysb works by creating several files on its backup tape, CD, DVD, or image file. The first few files boot the kernel and provide the LVM layout of the data that was backed up. The last files contain the files to be restored in backup format for AIX 4.3.3 and 5.x. (The AIX backup format is essentially the same as dump.) savevg backups are essentially the same except there is no bootable kernel information. Figure 13-1 shows a logical representation of such a tape.

A logical representation of a mksysb tape
Figure 13-1. A logical representation of a mksysb tape

The tape block size for the first three files is 512 bytes while the block size for the image data is variable, based on the settings of the tape drive at the time of the backup. If you choose 0 as the block size for that device, systems will, when possible, back up with 1024 bytes. When backing up to CD/DVD or image file, it is not necessary to specify a block size.

Preparing to Use mksysb and savevg

There are three common types of mksysb backups:

  • Backing up and restoring from a tape drive

  • Creating a bootable CD/DVD

  • Backing up to an NFS mount and restoring via NIM

The first two require physical media. Both tape and CD/DVD produce bootable restore and recovery images. Backing up to an NFS mount is limited by the speed of the IP network when doing backups. Restore speed for NIM is limited by the speed of the network as well. Backing up to an NFS share and restoring via NIM is more work to set up but can be automated using scripts to make periodic backups of the rootvg without being dependant on a human to load media.

Another option that some people script is backups to a local disk that is not a member of rootug, and then a script to move them off to a remote host using FTP/SCP/RCP. Most users should avoid doing this. It adds a potentially weak link to your backup strategy. What happens when the copy script fails, and the backup you need is good but physically on a failed machine? A simple restore just got a whole lot harder. If NFS just isn’t an option, and you must use another transfer method, be sure to write solid verification scripts both on the client and the destination server. Whatever you do, don’t ever send your mksysb backups to the rootvg.

If you find yourself in this situation, you can restore from an older mksysb or CD-ROM, apply maintenance-level releases to get to the same level as when the host failed, mount the backup filesystem, and perform a second restore from the desired mksysb.

After you decide where to back up to, you need to decide whether you are going to quiesce the system to take a root backup. Will you log off all users and/or shut down your applications for the duration of the backup? The answer depends on your system configuration. The backup will likely take at least an hour, and any changes to files during the backup may lead to an inconsistent image on tape. There should not be any problems backing up files that are currently open, although any pending writes to the file at the time it is backed up will obviously not make it to the tape archive. If you have most or all of your user data off rootvg, and your system files are not constantly changing, you should have no problem doing mksysb backups on a “live” system.

If you are using this mksysb image to build other systems, you may want to prepare the rootvg even further. For example, you may want to do the following:

  • Clear out /tmp.

  • Disable the network (by commenting out from inittab, rc.net, rc.tcpip, and rc.nfs anything that hangs the computer if it has no network or causes an IP address conflict).

  • Remove the root password or set it to a well known password in your environment.

  • Clear the error report using errclear, and clear /var/spool, /var/adm, /var/logs, and the like.

Next, decide what needs to be backed up. You can prevent specific files from being backed up to the archive by creating a file called /etc/exclude.rootvg and using the -e flag to mksysb (or savevg). Entries in this file can be simple lists of files, such as:

/etc/passwd

If you use the -e flag, mksysb filters out the files in your /etc/exclude.rootvg using egrep, so in effect, it supports egrep’s syntax. This allows complex entries such as:

.*/core$
^/tmp/
.*.o$

Preparing for the restore

The /image.data file in the / filesystem being backed up contains information about how disks, filesystems, logical volumes, and paging space are rebuilt when the backup is restored. In general, the entries in image.data correlate to flags in the mklv and crfs commands (commands used to create logical volumes and filesystems). Running the mkszfile command before the mksysb creates the image.data file itself. You also can start mksysb with the -i option, which tells mkszfile to generate the image.data file automatically. Running mkszfile independently enables you to edit image.data and change what is backed up, the size of the filesystems, and other variables. You also can edit bosinst.data to customize what runs after the image is restored. If you run mkszfile and edit image.data, make sure you run mksysb without the -i option, or your modifications will be overwritten.

One useful option to edit in bosinst.data is the RECOVER_DEVICES variable. This specifies whether or not to restore the ODM definitions that were in place at the time of the backup. The default (YES) is correct if you plan to restore to the same or similar hardware. If you are performing a backup for a generic system image, set it to NO.

If you specify the -m option to mkszfile, a map file is created for each logical volume in the archive. Each map describes where on the disk the logical volume should be created at restore time. This is similar to the options available to the mklv command (exact layout ability). The map file for a given logical volume contains one line for each physical partition (PP) it occupies, along with the hard disk (hdisk) it is on. Note that this is useful only if the target system has exactly the same disk layout as the source system.

Here is an example of what the image.data file contains. The AIX documentation gives a more complete description of all the options contained in this file.

[SHRINK = yes]

Shrinks the filesystems on restore

[VG_SOURCE_DISK_LIST = hdisk0]

Changes the target disk for the restore

Once backed up, these files cannot be edited on tape or CD/DVD media. You can, however, create a customized diskette containing an image.data and/or bosinst.data file. The diskette could be used at restore time instead of the files in the backup. To create a customized diskette, follow this simple procedure.

Edit image.data and/or bosinst.data extracted from a tape or other media (see the instructions for extracting a single file from a mksysb tape), place a diskette in the drive, and issue the following command:

# ls ./bosinst.data ./image.data | backup -ivqf /dev/rfd0

Backing Up with mksysb

mksysb has several options, which are described in this section. First, you can back up and restore from a locally attached tape. You can also back up to a remote tape drive, but you must restore from a locally attached tape drive. Next, you can use mksysb to make a system backup on disk, such as a centrally located NFS filesystem. If you do that, you have two recovery choices. The first choice is to create bootable DVDs/CDs using mkcd and then boot from those during a recovery. The second recovery choice is to boot from a NIM and restore directly from the NFS-mounted image. Finally, you can also create DVDs/CDs directly using mkcd. Let’s take a look at these options.

mksysb Summary

Here is a quick summary of the options of mksysb that I’ll be using in this section:

-e

Excludes files listed in the /etc/exclude.rootvg file from being backed up. The rules for exclusion follow the pattern-matching rules of the grep command.

-i

Calls the mkszfile command, which generates the /image.data file. The /image. data file contains information on volume groups, logical volumes, filesystems, paging space, and physical volumes. This information is included in the backup for future use by the installation process.

-m

Calls the mkszfile command with the -m flag to generate map files. (Using the -m flag causes the functions of the –i flag to be executed also.)

Backing Up rootvg to Locally Attached Tape

The simplest scenario is to back up all filesystems in rootvg with a locally attached tape drive. In this situation, issue the following command from a root prompt:

# mksysb -i /dev/rmt0

The difference between the various ways to access a tape device on AIX systems is illustrated in Table 13-1 and explained in detail in the manpages.

Table 13-1. AIX device-naming conventions
Device nameDensityRewind on closeRetention on open
/dev/rmt*Setting #1YesNo
/dev/rmt*.1Setting #1NoNo
/dev/rmt*.2Setting #1YesYes
/dev/rmt*.3Setting #1NoYes
/dev/rmt*.4Setting #2YesNo
/dev/rmt*.5Setting #2NoNo
/dev/rmt*.6Setting #2YesYes
/dev/rmt*.7Setting #2NoYes

This can also be achieved through the System Management Interface Tool (smit) menus, of course, and the following fast path brings you directly to the correct screen:

# smit mksysb

You should be able to use any locally attached tape drive supported by AIX.

Backing Up rootvg to a Remote Tape Drive

You can perform a mksysb directly to a remote tape by following this procedure. For the purpose of this example, consider two machines:

tapeserver

The machine with the local tape drive

client

The machine to be backed up

First, make sure the /.rhosts or /etc/hosts.equiv file is set up properly on both machines to allow rsh from the client to the tapeserver. On the tapeserver, use this procedure to manually create a mksysb image:

  1. Set the default block size of the tape to 512 for the boot section:

  2. tapeserver# chdev -a block_size=512 
                            device
  3. Rewind the tape:

  4. tapeserver# mt -f 
                            device
                             rewind
  5. Create the boot image files:

  6. tapeserver# bosboot -d 
                            no-rewind-device
                             -a
  7. Write the boot image to the tape:

  8. tapeserver# mkinsttape 
                            no-rewind-device
  9. Write a dummy table of contents:

  10. tapeserver# echo "Dummy tape TOC" | dd of=
                            no-rewind-device 
                            bs=512 conv=sync
  11. Change the block size to 1024 for the rest of the tape:

  12. tapeserver# chdev -a block_size=1024 
                            device

Now that we have the bootable part of the tape (i.e., the boot block), the installation files, and the dummy table of contents, we need to transfer the data. On the client, run mkszfile , and create a file called /etc/exclude.vg that contains only /tmp/mksysb. pipe. Then, direct mksysb to a named pipe. Finally, cat the contents of the pipe to the tapeserver’s tape drive:

  1. Create a pipe for mksysb:

  2. client# mknod p /tmp/mksysb.pipe
  3. cat the pipe to the remote tape drive:

  4. client# cat /tmp/mksysb.pipe 
                                | rsh 
                            tapeserver 
                            "dd of=
                            device 
                            obs=100b bs=1024 > /dev/null 2>&1" &
  5. Run mksysb with the -e argument against the previously created pipe:

  6. client# mksysb -e /tmp/mksysb.pipe

If you are lazy, a script written by Henk van Doorn called rmksysb does all of this.

Backing Up to Disk

It is possible to back up a system to a locally attached disk, but that obviously presents challenges during a restore. It’s even possible to back up the rootvg to a file in the rootvg, but that would really be a bad idea for a few different reasons. A common practice is therefore to set up a NFS share on a separate server to hold mksysb backups.

The filesystem must be large-file-enabled, and you must set ulimit to allow 9 GB files (by default, ulimit is set to 1 GB).

To see the current setting of ulimit:

Client # ulimit –f
2097151

The systemwide default setting is configured in /etc/security/limits. You can also change it in a shell using the ulimit command (9 GB plus a little for overhead):

Client # ulimit –f 19000000

Now that we can write out a large file (over 1 GB), we can write a backup of the rootvg to an NFS mount on the client system. In the following examples, we use / NFS_mount/mksysb from the server NFS_Server to hold mksysb backups. We’ll use the command mksysb –e –m /directory/filename. The –e option tells it to exclude patterns listed in / etc/exclude.rootvg, and the –m option specifies the media to write to. The last argument should be the full pathname of the file in which to store the image.

Client # mksysb –e –m /NFS_mount/mksysb/client-6-1-06.msb_image
Creating information file (/image.data) for rootvg..
Creating list of files to back up.
Backing up 39932 files..........#
# 39932 of 39932 files (100%)
0512-038 mksysb: Backup Completed Successfully.

It’s just that easy to make a backup of the rootvg. We now have a backup that we can restore to this host. In the event of a minor problem, we can restore a single file, and in the event of a major problem, we can create a bootable restore DVD or restore using NIM.

Making a Bootable DVD/CD from an Existing mksysb

Once you create a mksysb image on disk, you can use it to create a set of bootable DVDs or CDs that can be used to restore the system very quickly. This process has three steps:

  1. mkcd creates temporary files that it uses to create the ISO images.

  2. mkcd creates ISO images from the temporary files.

  3. The ISO images are then used to burn the actual CDs/DVDs.

We are going to need some local scratch space for the first two steps. This scratch space should not be in rootvg and needs to have enough space to hold the temporary CD/DVD filesystem and the CD/DVD ISO images. For each CD, this is about 645 MB, and each DVD holds 4.38 GB. The temporary files can probably be on an NFS directory, but it’s probably best if the ISO images are stored locally to prevent buffering problems when creating the DVDs or CDs.

We’ll use the following arguments to the mkcd command to perform this task:

-e

Excludes the files and/or directories from the backup image listed in the /etc/exclude.volume_group file. You cannot use this flag with the -m or –s flags.

-m filename

mksysb_image specifies a previously created mksysb image. If you do not give the - m flag, mkcd calls mksysb. (See the -M flag for more information about where the mksysb image is placed.)

-C directory

Specifies the filesystem used to create the CD filesystem structure, which must have at least 645 MB of available disk space (up to 4.38 GB for DVD-sized images). The CD image consumes only as much room as necessary to contain all the data on the CD.

-I directory

Specifies the directory or filesystem where the final CD images are stored before writing to the CD-R, DVD-R, or DVD-RAM device. If this flag is not used, mkcd uses the /mkcd/cd_images directory if it already exists. If it doesn’t exist, the command creates the /mkcd/cd_images filesystem in the volume group given with the -V flag, or in rootvg if that flag is not used.

-P

Creates physical partition mapping during mksysb or savevg creation. You cannot use this flag with -m or -s flags.

-R

Prevents mkcd from removing the final CD images. mkcd defaults by removing everything that it creates when it finishes executing. The -R flag allows multiple CD image sets to be stored or for CD creation (burn) to occur on another system. If multiple volumes are needed, the final images are uniquely named using the process ID and volume suffixes.

-S

Stops mkcd before writing to the CD-R, DVD-R or DVD-RAM without removing the final CD images. The -S flag allows multiple CD sets to be created or for CDs to be created on another system. The images remain in the directory marked by the -I flag or in the /mkcd/cd_images directory if the -I flag is not used. If multiple volumes are required, the final images are uniquely named using the process ID and volume suffixes.

-d CD-or-DVD-writer-device

Indicates the CD-R, DVD-R, or DVD-RAM device (/dev/cd1, for instance). This flag is required unless you use the -S flag.

In the following examples, the host named NFS_Server has a DVD writer. It also has a local 18 GB filesystem called /mkcd that we use for both the temporary images as well as the ISO images. NFS_Server also shares the filesystem /NFS_Share/mksysb with other clients so they can write their mksysb backups there. (This is the same directory we backed up to in the previous example.)

The example that follows uses the NFS server to create a bootable CD image from the mksysb image we created on the NFS mount in the previous example (/NFS_share/mksysb/client-6-1-06.msb_image). We use the directory /mkcd/cd_fs to hold the temporary images and the directory /mkcd/cd_images to hold the final ISO images.

NFS_Server # mkcd -m /NFS_share/mksysb/client-6-1-06.msb_image -C /mkcd/cd_fs
-I /mkcd/cd_images -R –S
Initializing mkcd log: /var/adm/ras/mkcd.log...
Verifying command parameters...
Populating the CD or DVD file system...
Copying backup to the CD or DVD file system...
.
Building chrp boot image...
Creating Rock Ridge format image: /mkcd/cd_images/cd_image_295108.vol1
Running mkisofs ...
.
mkrr_fs was successful.

Making the CD or DVD image bootable...

Copying the remainder of the backup to the CD or DVD file system...
Creating Rock Ridge format image: /mkcd/cd_images/cd_image_295108.vol2
Running mkisofs ...
.
mkrr_fs was successful.


Copying the remainder of the backup to the CD or DVD file system...
Creating Rock Ridge format image: /mkcd/cd_images/cd_image_295108.vol3
Running mkisofs ...
.
mkrr_fs was successful.

This gives us three ISO CD images in /mkcd/cd_images. The temporary data that was copied to /mkcd/cd_fs was removed after the cd image was created. We can now transfer that image to another server with a CD drive and burn the .ISO images.

If we want to create a DVD image, we add the –L flag to the command:

NFS_Server # mkcd –L -m /NFS_share/mksysb/client-6-1-06.msb_image 
-C /mkcd/cd_fs -I /mkcd/cd_images -R –S
Initializing mkcd log: /var/adm/ras/mkcd.log...
Verifying command parameters...
Populating the CD or DVD file system...
Copying backup to the CD or DVD file system...
.......
Building chrp boot image...
Creating Rock Ridge format image: /mkcd/cd_images/cd_image_405642
Running mkisofs ...
........
mkrr_fs was successful.

Making the CD or DVD image bootable...

Our earlier example created three ISO images of CD size, but in this example, we specified the –L flag, so we have one large DVD ISO image. You can use these ISO images to create a CD or DVD on any host.

If you want to create the images and burn the CD/DVD all in one step, you can drop the –S and –R options and add the –d option, followed by the device name of the CD/DVD burner:

NFS_Server # mkcd –d /dev/cd0 –e -m /NFS_share/mksysb/client-6-1-06.msb_image -C /mkcd/cd_fs -I /mkcd/cd_images

If you want to burn a CD from an ISO image created earlier, use a command like this:

NFS_Server # burn_cd /dev/cd0 /NFS_share/mksysb/client-6-1-06.msb_image

If there is more than one CD image file, repeat the command for each image file.

If you want to burn a DVD from an ISO image, add the –d flag:

NFS_Server # burn_cd –d /dev/cd0 /NFS_share/mksysb/client-6-1-06.msb_image

Creating a CD/DVD Backup in One Step

If you are lucky enough to have a CD/DVD writer available on the system you want to make DVDs for and have sufficient local scratch space to build a CD image, you can use mkcd to create the CD/DVD in one step. Although all of the steps in the previous method are still required and performed, mkcd manages and automates the whole process, from making the mksysb backup all the way to burning the actual DVDs/CDs. In the following example, we want to make a bootable DVD-sized backup of the rootvg with map files (restore LVM), excluding all files and directives in /etc/exclude.rootvg:

NFS_Server # mkcd -L -P –e –M /NFS_Share/mksysb –C /mkcd/cd_fs 
–I /mkcd/cd_images -R –S
Initializing mkcd log: /var/adm/ras/mkcd.log...
Verifying command parameters...
Creating image.data file...
Creating mksysb image...

Creating list of files to back up.
Backing up 39945 files...............
39945 of 39945 files (100%)
0512-038 mksysb: Backup Completed Successfully.
Populating the CD or DVD file system...
Copying backup to the CD or DVD file system...
.......
Building chrp boot image...
Creating Rock Ridge format image: /mkcd/cd_images/cd_image_323664
Running mkisofs ...
....
mkrr_fs was successful.

Making the CD or DVD image bootable...
NFS_Server #

This command performs a mksysb of the rootvg and from that makes a bootable DVD ISO image in /mkcd/cd_images called cd_image_323664. You can either transfer that image to another system (including a PC with a DVD burner) and make a DVD from it, or make a DVD on the local system using the –d device argument to mkcd. If you want to make CD images, just issue the same command without the –L flag. It then produces multiple CD images if the backup is larger than one CD.

Setting Up NIM

Some people prefer not to make CDs or DVDs and prefer instead to simply leave their mksysb images on the file server and read directly from them during a recovery. If you want to do this, you need to use Network Install Manager (NIM). The advantage to this method is that you do not need to load any physical media to perform the restore. The drawback is that your restore is limited by the speed of your Ethernet network, and problems with the Ethernet network can complicate a restore.

If you don’t already have a NIM server, you’ll need to set one up for this purpose. The good news is that, while NIM is fairly complex, setting up a NIM environment just for this purpose is not that hard. You need to set up the server, add the client to the NIM server, and add a mksysb definition for that client.

Setting Up a NIM Server

The purpose of the NIM server is to provide a boot image to the client over the network using BOOTP and TFTP. In our case, we want to boot and install a mksysb that we have previously created.

The easiest way to set up NIM is to use the eznim wizard introduced in AIX 5.2:

NIM_Server # smit eznim

For versions before 5.2, there is the regular smit panel for NIM, which has a setup option:

NIM_Server # smit nim

Setting up NIM through the smit panels is the easiest and most thorough method. If you choose to install it using the command-line interface (CLI), read the manpage for nim_master_setup for any options to specify relative to your environment. The following instructions create a quick and easy CLI setup:

  1. From the latest recommended maintenance level of AIX that you are installing on, find the POWER Version X Volume 1 CD.

  2. Insert and mount the CD.

  3. Locate and run the nim_master_setup command:

  4. NIM_Server # nim_master_setup
  5. This command sets up a default NIM server. It creates /tftpboot and /export in the root filesystem.

Adding a Client Definition to NIM

This step adds the host that we want to back up to the NIM server. We need to do this so that the NIM server knows who to serve images to.

The easiest way to add a client is to use the smit fastpath:

NIM_Server # smit nim_mkmac

It can also be installed and set up using CLI. The following instructions apply to a typical client. Both the client and server need to be able to resolve each other via DNS. The example’s hostname is client, and it has a chrp mp architecture that uses twisted pair. For a more detailed usage of the CLI, see the manpage for the niminit command. We run the niminit command from the client, not the server. This has the added benefit of making sure that the client can talk to the NIM server.

client # niminit -a name=client -a master=NIM_server -a pif_name=en0 
-a platform=chrp -a netboot_kernel=mp -a cable_type1=tp

Setting a mksysb Definition for a Client

Now that we have defined a client, we can select the installation type. This tells the NIM server which image the client should install.

The easiest way to select which mksysb to have a client boot is to use the smit fastpath. To do this, select mksysb as the image resource and set the location:

client # smit update_client_eznim

In the smit panel, select the installation type “mksysb - Install from a mksysb,” and set that to the mksysb image that you want to restore.

This can also be set up using CLI. Again, for a more detailed usage of CLI, see the manpage for the nim command. In this example, we want the host we are on (client) to NIM boot from NIM_Server using the mksysb file /export/backups/client-6-1-06.msb_image. We also assign a resource name of mksysb_res1 to client-6-1-06.msb_image:

client # nim -o define -t mksysb -a server=NIM_Server –a location=/export/backups/ client-6-1-06.msb_image mksysb_res1

savevg Operations

savevg can be used almost identically to mksysb except you specify a volume group to back up instead of defaulting to rootvg. The volume group must be varied on (that is, active), and the filesystem must be mounted. The exclude list for savevg is handled by /etc/exclude.<vgname>, where <vgname> is replaced with the name of the volume group that you want to back up.

Using savevg to Back Up a Volume Group

In this example, we back up datavg to an NFS share:

Client # mount NFS_Server:/NFS_mount/savevg /NFS_mount/savevg
Client # savevg –e –m –f /NFS_mount/savevg/client-datavg-6-1-06.svg_image datavg
Creating information file for volume group datavg.

Creating list of files to back up.
Backing up 13 files
13 of 13 files (100%)
0512-038 savevg: Backup Completed Successfully.

Verifying a mksysb or savevg Backup

Now that you have a backup on tape or disk, you may want to verify the contents of the backup. The most thorough test of a mksysb tape is to actually do a restore, but you can get an idea of the integrity of the tape by listing the contents of the archive. If it’s a tape, make sure the tape is at the beginning first:

# mt -f device rewind

Next, use restore to list the contents of the tape or file:

# restore -s4 -Tvf [no-rewind-device|filename]

This shows you all the files that were backed up, the time and date that the backup was run, and how many files were backed up.

Restoring an AIX System with mksysb

This section explains how to completely restore a system using one of the mksysb methods discussed earlier.

Tip

To learn how to restore individual files with restore, please refer to Chapter 3.

In the event of a disaster, you can boot from tape, CD/DVD, or the network and do a full restore. The processes are very similar, so we’ll cover them as one procedure:

  1. If the system is still running, you can set it up to boot from tape or CD before you shut it down:

    1. To boot from CD/DVD:

    2. Client # bootlist –m normal cd0
    3. To boot from tape:

    4. Client # bootlist –m normal rmt0
    5. To boot from the network:

    6. Client # bootlist –m normal en0
  2. Power down the system.

  3. Attach a system terminal (or monitor and keyboard).

  4. Prepare the media:

    1. If this is a tape restore, attach a tape drive and insert the tape in the drive.

    2. If this is a CD restore, insert the first CD/DVD in the drive.

  5. Power up the system.

  6. Display the SMS menu. If you weren’t able to set the boot list to the proper device before powering down, you need to tell the system to boot from the proper device on power up. On HMC-attached systems, you can select the boot mode before you start the partitions; it then defaults to the SMS menu. On other AIX systems, you need to interrupt the boot process to display the SMS menu. On some older systems, you press F1 while the POST icons are appearing on the monitor. On most later model systems, you press F5 while the POST icons are appearing on the monitor. Consult the hardware guide that shipped with your AIX system for the interrupt sequence for your model of hardware.

  7. Once in the SMS menu, select Maintenance Mode, and set one of the following restore/boot options:

    1. Choose Select Boot Device, and specify CD, DVD, or tape restore.

    2. For a NIM install, select “Installation from Network.” Selecting NIM install may require you to supply additional network parameters depending on how your NIM server is set up.

  8. The backup is checked for compatibility. If the backup is compatible with the hardware it is being restored onto, it pauses for five seconds and then continues unprompted and restores the rootvg based on the settings in image.data and/or bosinst.data. If you want to interrupt the install, press the 0 key three times (000) during the five-second pause. This forces the restore into prompted mode. In the event that the backup does not match the hardware of the system, it automatically begins a prompted restore. The prompted restore looks very much like the initial AIX installer, but at the end you have a restore of your system.

  9. If you are not performing a prompted restore, the restore continues uninterrupted until it completes. If you are performing a prompted restore, it allows you to change the physical disk(s) that the restore is performed to, shrink filesystems, etc.

  10. When the restore finishes, the system changes its boot device to the install target devices for the rootvg and reboot.

System Cloning

Cloning a system is the action of restoring the complete image of one system onto a completely different system. The “restored” system is then a perfect image of the original one. This could be useful in the case of a fire or a similar catastrophe in which the hardware is completely lost. In such a case, you could use an off-site mksysb to recover the old system onto new hardware.

AIX 4.x Operating System

The 4.x versions of AIX require special attention because not all the drivers are installed with the BOS. In this case, you are left with two choices:

  • Install all device drivers for all available architectures before taking the mksysb or backup of the system. That allows the tape to be booted from and restored onto any IBM RS/6000.

  • If device drivers are not installed, you can simply boot the new machine from the CD-ROM containing the AIX 4.x operating system. After the boot, choose the Restore from tape backup option, insert the mksysb tape, and start the restore.

AIX 5.x Operating System

In AIX 5.x, all device drivers and supported kernels are installed with the BOS. This means that a system backup should be largely hardware-independent. However, there are issues when backing up older 32-bit systems. A system backup of a 32-bit AIX system running in 32-bit mode will still run in the same 32-bit mode if installed onto 64-bit hardware. A backup of a 64-bit system will not run on a 32-bit system because 32-bit hardware cannot run 64-bit software. To change system modes between 32 and 64 bits, see the IBM systems operation guide for the version of AIX you are running.

You should edit the bosinst.data file to set the RECOVER_DEVICES variable. This specifies whether or not to restore the ODM definitions that were in place at the time of the backup. Since this backup may be restored onto a machine with very different hardware, let AIX rebuild its own ODM definitions at boot.

If you make a bootable CD/DVD on a different platform, you must add the –G flag to mkcd. This forces it to include the chrp, rs6k, and rspc boot images on the CD.

Tip

BackupCentral.com has a wiki page for every chapter in this book. Read or contribute updated information about this chapter at http://www.backupcentral.com.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset