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:
- ^./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:
- 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 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.
Download AIX User-Related Commands (Infographic) today! This quick guide highlights differences between user administration commands on AIX and other UNIX-derived operating systems.