Connect With Us

Declutter Your AIX System Backup

Anthony English explains why it's a good idea to keep data file systems out of the root volume group.

In general, it's a good idea to keep data file systems out of the root volume group (rootvg). That makes the OS backup—created by the mksysb command—smaller, faster to run, and easier to restore. If you have to restore your OS in an emergency, you want the process to be as fast and smooth as possible.

In some environments, systems admins have no choice but to work with a rootvg that contains a lot of data they don't really want to back up as part of the OS. If you have files or file systems you want to exclude from the mksysb backup, you can exclude them using the mksysb command's -e flag. This flag looks at a text file called /etc/exclude.rootvg to determine which files are to be excluded from the backup.

Before I discuss the format of that file, there are some important points to keep in mind:

  • If you exclude files, be sure you either don't need them or can easily recover them by other means.
  • Don’t exclude any essential OS files or directories such as /usr, /, and /var, because without them, you might not be able to restore your OS at all.

The exclude option (mksysb -e) only excludes files from the backup. The mksysb command will still back up the structures for user logical volume you’ve created in rootvg, and they’ll be rebuilt as part of the mksysb restore. If you want to exclude some logical volumes and file systems—not just the files that reside in them—you’ll need to create a new /image.data file using the mkszfile command, and then edit the unwanted logical volumes and file systems out of that file. When you run the mksysb backup, don’t use the -i flag because it will overwrite the /image.data with the latest logical volumes and file systems.

Be Exclusive

You can exclude files and/or directories from the mksysb backup by adding them to /etc/exclude.rootvg. This is a text file you can edit using an ASCII editor such as vi. You enter the patterns of file names (or, more commonly, of directories) that you don't want included in the system backup, and the mksysb command will do a pattern match using grep -v (the -v means find all the files that don't match one of the patterns in /etc/exclude.rootvg).

The mksysb command documentation in the IBM Information Center explains the syntax with a couple of helpful examples:

To exclude all the contents of the directory called scratch, edit the exclude file to read as follows: /scratch/

To exclude the contents of the directory called /tmp, and avoid excluding any other directories that have /tmp in the path name, edit the exclude file to read as follows:

  1. ^./tmp/

All files are backed up relative to the current working directory.

The following command would back up the OS to a file system, but exclude any files matching the patterns in /etc/exclude.rootvg:

  1. mksysb -e /archive/aixtest_mksysb

Other mksysb Methods

Other methods of running the mksysb support the exclude file. If you're using the Network Installation Manager (NIM) to create a mksysb resource from a NIM client, you can create a NIM exclude_files resource. If you're creating a mksysb image in DVD or CD format using the mkdvd or mkcd commands, you can use the -e flag the same way you would the mksysb command. However, if you’re merely burning an image from an existing mksysb backup, the -e flag cannot be used.

Lean and Clean

If you find you're excluding a lot of files or directories from your mksysb backup, it might be time to consider moving your data file systems out of rootvg. It really pays to have a reliable, regular mksysb backup that contains only the files and directories you really need. You never know when you'll need that backup.

 

Learning Path

The mksysb command creates an installable image of the root volume group

Using the exclude_files resource in NIM

The mkcd command creates a system image backup (mksysb) to CD-R or DVD recordable (DVD-R DVD-RAM) format

The mkdvd command works in a similar way, for DVD recordable images.

The mkszfile command creates the /image.data file, which captures the system installation information, rootvg logical volumes and file systems. This is vital for reinstallation of the operating system.

Give rootvg the space it needs

Reliable Restores: mksysb backups make AIX recovery easy

Please or Register to post comments.

AIX User-Related Commands

Download AIX User-Related Commands (Infographic) today! This quick guide highlights differences between user administration commands on AIX and other UNIX-derived operating systems.


POWER IT Pro Blogs
Building a Dynamic System Group
May 21, 2013
blog

Building a Dynamic System Group

IBM Systems Director provides a wealth of systems management and monitoring functions, but sometimes you have to think outside of the box to implement the solution you're looking for....More
LPI Exam Objective 101.3: Runlevels, Shutdown, and Reboot
May 13, 2013
blog

LPI Exam Objective 101.3: Runlevels, Shutdown, and Reboot

This entry in the LPI certification exam blog series discusses the third objective in the System Architecture topic of the exam: Linux runlevels, and shutdown and reboot procedures....More
May 13, 2013
blog

Feedback Loop

I had more feedback from readers to my article, "The Forgotten", than practically anything I have written before. If you missed it, it told the story of a conversation I had with the financial director a mid-sized British food retailer....More
eBooks & Training
Secrets of an AIX Administrator by Christian Pruett
Dec. 13, 2012
Datasheet

Secrets of an AIX Administrator  

Download this Tech Advisor from POWER IT Pro and learn practical, real-world information about AIX administration. Christian Pruett shares all the things he wishes he had known about AIX before becoming an admin in his ebook Secrets of an AIX Administrator....More
Dec. 3, 2012
Datasheet

AIX Security  

IBM i has extremely robust intrinsic security, and Linux, although much less secure than either AIX or IBM i, has many more eyes watching for problems. But AIX has some significant corner cases where security can be breached if you're not careful....More