Saturday, January 29, 2011

Creating a mksysb to DVD-RAM in AIX V5 & V6

Creating a mksysb to DVD-RAM in AIX V5 & V6

This document discusses the ?mksysb? command and creating a rootvg
backup to a DVD-RAM (cd#) device.

What is a mksysb and why create one
Files important to the mksysb
Important information concerning mksysb flags
A note about UDF and ISO options
Creating a mksysb to a DVD drive in AIX V5 & V6
Verification of a mksysb
Restoring a mksysb
Restore menus
Restoring individual files or directories from a mksysb on DVD
FAQ
-- JFS to JFS2 conversions
-- mkdvd failing with space errors
-- Media requirement / Drive requirement (DVD-RAM) -- Logging
-- NFS filesystems -- Restrictions on files that are safe to restore
-- Estimated restore time
-- Stuck at 83%, hang or no hang ?

*Note : For all examples the cd/dvd drive will be referred to as
/dev/cd0. This may not be the case in your environment. Simply
substitute the correct CD drive # as needed. Furthermore, this document
does not cover restoring mksysb images to systems other than the one it
was taken from.

*Note II : ?mkdvd? is simply a link to the ?mkcd? command. For this
document we will be using ?mkdvd? for the command line examples.

*Note III : The ?smitty? and command line examples shown are using ISO
format for the mkdvd command. In the interest of keeping the document
from growing too large UDF examples are shown in limited sections,
however can be easily figured out by familiarizing yourself with the ISO
examples.

------------------------------------------------------------------------
--------

What is a mksysb and why create one ?
A mksysb is a bootable backup of your root volume group and is designed
to backup all mounted JFS and JFS2 filesystem data. The root volume
group image is in backup/restore file format, starting with the data
files and then any optional map files. When a bootable backup of a root
volume group is created, the boot image reflects the currently running
kernel. If the current kernel is a 64-bit kernel, the backup's boot
image is also 64-bit, and it only boots 64-bit systems. If the current
kernel is a 32-bit kernel, the backup's boot image is 32-bit, and it can
boot both 32-bit and 64-bit systems.

In general the mksysb backup is the standard backup utility used to
recover a system from an unusable state - whether that be a result of
data corruption, a disk failure, or any other situation that leaves your
system down. You should create a mksysb backup on a schedule in line
with how often your rootvg data changes, and always before any sort of
system software upgrade.

A mksysb can also be used to boot a system into maintenance mode for
work on the rootvg in cases where the system can not boot into normal
mode.

------------------------------------------------------------------------
--------

Files important to the mksysb

There are two specific files that the mksysb restore process uses that
you should become familiar with. These files can be manipulated in
various ways to alter the process or outcome of the restore itself.

bosinst.data : This file can be used to pre-set the BOS menu options.
Selections such as which disk to install, kernel settings, and whether
or not to recover TCP related information can all be set here. This file
is mainly used for non-prompted installations. Any option selected
during a prompted install will override the corresponding setting in
this file. For more information concerning the individual stanza
descriptions see the publib website PubLib Documentation by searching on
"bosinst.data file stanza descriptions".
http://publib.boulder.ibm.com/infocenter/pseries/v5r3/index.jsp

image.data : This file is responsible for holding information used to
rebuild the rootvg structure before the data is restored. This
information includes the sizes, names, maps, and mount points of logical
volumes and file systems in the root volume group. It is extremely
important that this file is up to date and correct, otherwise the
restore can fail. It is common to edit this file when it is necessary to
break mirroring during a restore. For more information concerning the
image.data file and the stanza descriptions see the publib website :
PubLib Documentation by searching on "image.data file".
http://publib.boulder.ibm.com/infocenter/pseries/v5r3/index.jsp

------------------------------------------------------------------------
--------

Important information concerning mksysb flags

It is very important that you understand the use and intent of a few of
the flags used by the mksysb command. Improper use, lack of use, or use
of certain flags in certain situations could cause your mksysb to be
difficult to restore. In some cases it may cause your mksysb to be
unrestorable.

-i Calls the ?mkszfile? command, which updates the image.data file with
current filesystem sizes and characteristics. This flag should always be
used unless there is a very specific reason you do not wish to have this
information updated. Failure to have an accurate image.data file can
cause your mksysb restore to fail with ?out of space? errors.

-e Allows you to exclude data by editing the /etc/exclude.rootvg file. A
few tips on excluding data from your mksysb are listed below :

There should be one entry per line of the file. It can be either a
single file or directory name.

The correct format of each entry should be ^./<path>

Never use wildcards.

Do not leave extra spaces or blank lines in the file.

While the /etc/exclude.rootvg file excludes data, bear in mind that it
does not exclude the fact that a filesystem exists. For example if you
have a 50Gb filesystem ?/data? and add an entry in your
/etc/exclude.rootvg file :
^./data
This will exclude all files in /data but it will still recreate the
/data
filesystem as a 50Gb filesystem (except it will now be empty).
The only way to truly exclude a filesystem from your mksysb would
be to unmount the filesystem before initiating your mksysb.

-p Using this flag disables the software compression algorithms. When
creating a mksysb during any level of system activity it is recommended
to use the ?-p? flag. Failure to do so can cause ?unpacking / file out
of phase? errors during your mksysb restore. These errors are fatal
(unrecoverable) errors. No warning is given during the creation of the
mksysb that notifies you of the possibility of having these errors
during the restore.
You may want to make the ?-p? flag compulsory when running your mksysb
command so you do not run into this situation.

-X This flag will cause the system to automatically expand the /tmp
filesystem if necessary. The /tmp filesystem will require approximately
32Mb of free space.

------------------------------------------------------------------------
--------

A note about UDF and ISO options

When creating a mksysb to DVD you have the option of using either UDF
(Universal Disk Format) or ISO9660 (CD format).

ISO - The ISO format image will create 1 image file (up to about 4Gb
before a ?volume 2 image? is needed) that is a ?pre-packaged? mksysb
image.

Benefits :
- The process to create a mksysb using ISO format burns faster than
using UDF format.
- The ISO image(s) created are ?portable? in that if your system does
not have a dvd burner you can take those images to another AIX system
with a dvd burner and burn your image there.
- You can also take the ISO image(s) to a PC and use 3rd party software
to burn it there as well.

Note: The use of any 3rd party software on PC is not supported by AIX
software support, so if you find it necessary to burn this image on a
PC, use a program you?re familiar with.

Drawbacks :
- Lack of flexibility with the image. Once your image is burned you can
not manipulate the image.
- More free space on the system is required in order to create the ISO
image. Three filesystems are required to create the ISO image. Total
space required is roughly 3*(mksysb_image_size).

UDF - This format image burns directly to the DVD media and is known as
?filesystem? format.

Benefits :
- The ?filesystem? format allows you to manipulate your mksysb. You can
mount the mksysb over a special "UDF" filesystem and edit or even add
files to the mksysb. (The system backup image is an archived file
composed of many files that cannot be manipulated. However, the
installation packages and any files that are not contained in the backup
image, can be directly manipulated)
- Less free space on the system is required in order to create a UDF
formatted image. It only requires a filesystem large enough to hold the
size of the mksysb itself.

Drawbacks :
- The process to create a mksysb using UDF format has been known to take
much longer than an ISO image formatted mksysb.

------------------------------------------------------------------------
--------

Creating a mksysb to a DVD drive in AIX V5 and V6 :

Below, we'll review the following examples :

Using SMIT without a previously existing mksysb file created
From SMIT using an existing mksysb image
From command line without a previously existing mksysb file
From command line with using a previously existing mksysb file
Creating a mksysb on a system without a DVD drive, to be burned on an
AIX system with a DVD drive using SMIT.
Creating a mksysb on a system without a DVD drive, to be burned on an
AIX system with a DVD drive using command line.

1. Using SMIT without a previously existing mksysb file created :

# smitty mkdvd
                     Use an existing mksysb image?
  1 yes
 --> 2 no

                      DVD backup media format?

--> 1 ISO9660 (CD format)
2 UDF (Universal Disk Format)

DVD-R or DVD-RAM Device.........................[/dev/cd0]
mksysb creation options:
 Create map files?..............................no
 Exclude files?.................................no
Disable software packing of backup?.............no
Backup extended attributes?.....................yes

File system to store mksysb image...............[]
 (If blank, the file system will be created for you.)

File system to store DVD file structure.........[]
   (If blank, the file system will be created for you.)

File system to store final DVD images...........[]
   (If blank, the file system will be created for you.)

If file systems are being created:
  Volume Group for created file systems         [rootvg]

Advanced Customization Options:
Do you want the DVD to be bootable?.............yes
Remove final images after creating DVD?.........yes
Create the DVD now?.............................yes
Install bundle file.............................[]
File with list of packages to copy to DVD.......[]
Location of packages to copy to DVD.............[]
Customization script............................[]
User supplied bosinst.data file.................[]
Debug output?...................................no
User supplied image.data file...................[]

The above set of default choices (other than the selection of the backup
device) are sufficient to initiate your backup to DVD. As you can tell,
there are quite a few other options you can modify. We won?t be
reviewing the options here except for the filesystem storage entries.

- ?Filesystem to store......? entries :
By default it will create 3 filesystems to perform the backup (in
rootvg):
/mkcd/mksysb_image
/mkcd/cd_fs
/mkcd/cd_images

If you don?t have the required space in rootvg you can use any other
volume group with sufficient space simply by changing the appropriate
option in your SMIT screen.
2. From SMIT using an existing mksysb image :

You can use a previously created mksysb image with the mkdvd process. In
this example it should be a mksysb of the same system from which you?re
creating the backup to dvd.
# smitty mkdvd
                     Use an existing mksysb image?
-->1 yes
2 no

                      DVD backup media format?

--> 1 ISO9660 (CD format)
2 UDF (Universal Disk Format)

All other options in the SMIT screen will remain the same as in example
1, except that you will have to provide the location of the existing
mksysb image.

3. From command line without a previously existing mksysb file :

# mkdvd -d /dev/cd0 -V rootvg

4. From command line with using a previously existing mksysb file :
You can use a previously created mksysb image with the mkdvd process. In
this example it should be a mksysb of the same system from which you?re
creating the backup to dvd.
# mkdvd -d /dev/cd0 -m /path_to_mksysb_file -V rootvg

*You must specify the full path name and filename of the mksysb image,
not just the hosting directory.

5. Creating a mksysb on a system without a DVD drive, to be burned on an
AIX system with a DVD drive using SMIT.

You may not have DVD-RAM drives in all of your AIX systems. You can
create a mksysb in a ?pre-packaged ready to burn? format. You can then
ftp this file to one of your systems that does have a DVD-RAM drive and
burn it there.

# smitty mkdvd

                     Use an existing mksysb image?
  1 yes
 --> 2 no

                      DVD backup media format?

--> 1 ISO9660 (CD format)
2 UDF (Universal Disk Format)

DVD-R or DVD-RAM Device.........................[]
mksysb creation options:
 Create map files?..............................no
 Exclude files?.................................no
Disable software packing of backup?.............no
Backup extended attributes?.....................yes

File system to store mksysb image...............[]
 (If blank, the file system will be created for you.)

File system to store DVD file structure.........[]
   (If blank, the file system will be created for you.)

File system to store final DVD images...........[]
   (If blank, the file system will be created for you.)

If file systems are being created:
  Volume Group for created file systems         [rootvg]


No comments:

Post a Comment