IBM Support

Creating and Restoring a Mksysb Without Preserving Mirrors (Using NIM, Tape, or Disk)

Question & Answer


Question

How do you create/restore a mksysb, either locally or using NIM, without preserving mirrors?

Answer

This document gives the procedures to be taken to create or restore a mksysb without preserving mirrors either on a standalone system or in a NIM environment. The procedures in this document are valid for AIX 6.1, 7.1, and 7.2.

WARNING: This procedure is valid ONLY with a mksysb image and will not work with a Sysback 6000 system backup.
____________________________________________________________________________

Contents of the technote:

-How to restore an image.data file from a tape
-How to restore an image.data file from an existing mksysb backup file

-How to edit an image.data file to break a mirror

-Creating a mksysb with an edited image.data file to tape or file
-Creating an 'image_data' resource without preserving mirrors for use with NIM

-Using the 'image_data' resource to restore a mksysb without preserving mirrors using NIM


____________________________________________________________________________

How to restore an image.data file from tape:



For the purposes of this document, all references to tape or CD drives will be rmt0 and cd0. Your devices may vary.

Restoring from tape:
1. Change the block size of the tape device to 512:

# chdev –l rmt0 –a block_size=512

2. Check to make sure the block size of the tape drive has been changed:

# tctl –f /dev/rmt0 status

*You will receive output similar to this:
rmt0 Available 10-60-00-1,0 4.0 GB 4mm Tape Drive
attribute value description user_settable

block_size 512 BLOCK size (0=variable length) True
compress yes Use data COMPRESSION True
mode yes Use DEVICE BUFFERS during writes True
ret_error no RETURN error on tape change or reset True

3. 'cd' to the /tmp directory (or a directory where you would like to store the /image.data file from the mksysb image) and restore the /image.data file from the tape:

# cd /tmp
# restore –s2 -xqvf /dev/rmt0.1 ./image.data
*The image.data file from the tape will be restored to the /tmp directory

4. Rename the image.data file you have just restored, so you do not get it mixed up with the /image.data file in place on your running system:

# mv /tmp/image.data /tmp/image.data.mksysb

____________________________________________________________________________


How to restore an image.data file from an existing mksysb file:



1. ‘cd’ to the /tmp directory (or a directory where you would like to store the /image.data file from the mksysb image) and restore the /image.data file from the mksysb:

# cd /tmp

2. Restore the image.data file to your current location:
# restore -xqvf </location/of/mksysb/file> ./image.data
***The image.data file from the mksysb image will be restored to the /tmp directory

3. Rename the image.data file you have just restored, so you do not get it mixed up with the /image.data file in place on your running system:

# mv /tmp/image.data /tmp/image.data.mksysb

____________________________________________________________________________

How to edit an image.data file to break a mirror:


*This section gives the steps to break a mirror, prior to running the 'mksysb' command

1. 'vi' the /image.data.mksysb file you restored from your mksysb (or 'vi' the /image.data file in your current rootvg if breaking the mirror prior to creating the mksysb backup) to break the mirror, by running the following command:

# vi /image.data

3. What you are looking for are the “lv_data” stanzas. There will be one for every logical volume associated with rootvg.

4. The following is an example of an lv_data stanza from an image.data file of a mirrored rootvg. The lines that need changing are marked with an --->, will be bold, and a slightly larger font:

lv_data:
VOLUME_GROUP= rootvg
--> LV_SOURCE_DISK_LIST= hdisk0 hdisk1
LV_IDENTIFIER= 000693da00004c00000001203de2aa29.14
LOGICAL_VOLUME= fslv01
VG_STAT= active/complete
TYPE= jfs2
MAX_LPS= 512
---> COPIES= 2
LPs= 20
STALE_PPs= 0
INTER_POLICY= minimum
INTRA_POLICY= middle
MOUNT_POINT= /chris
MIRROR_WRITE_CONSISTENCY= on/ACTIVE
LV_SEPARATE_PV= yes
PERMISSION= read/write
LV_STATE= opened/syncd
WRITE_VERIFY= off
PP_SIZE= 256
SCHED_POLICY= parallel
--> PP= 40
BB_POLICY= relocatable
RELOCATABLE= yes
UPPER_BOUND= 32
LABEL= /chris
MAPFILE=
LV_MIN_LPS= 1
STRIPE_WIDTH=
STRIPE_SIZE=
SERIALIZE_IO= no
FS_TAG= vfs=jfs2:log=/dev/hd8:mount=true:options=rw:account=false
DEV_SUBTYP=

***Note: There are two disks in the 'LV_SOURCE_DISK_LIST', the two copies of rootvg are reflected by the 'COPIES' value, and the 'PP' value is double that of the 'LPs' value. Make sure you DO NOT change the 'PP_SIZE' value

4. The following is an example of the same lv_data stanza after manually breaking the mirror. The lines that have been changed are marked with a --->, will be bold, and a slightly larger font. Edit each 'lv_data' stanza in the /image.data of the system to be backed up (if creating a mksysb that only reflects one copy of rootvg), or the '/image.data.mksysb' file (restored earlier in the technote) as shown below to break the mirrors:

lv_data:
VOLUME_GROUP= rootvg
---> LV_SOURCE_DISK_LIST= hdisk0
LV_IDENTIFIER= 000693da00004c00000001203de2aa29.14
LOGICAL_VOLUME= fslv01
VG_STAT= active/complete
TYPE= jfs2
MAX_LPS= 512
---> COPIES= 1
LPs= 20
STALE_PPs= 0
INTER_POLICY= minimum
INTRA_POLICY= middle
MOUNT_POINT= /chris
MIRROR_WRITE_CONSISTENCY= on/ACTIVE
LV_SEPARATE_PV= yes
PERMISSION= read/write
LV_STATE= opened/syncd
WRITE_VERIFY= off
PP_SIZE= 256
SCHED_POLICY= parallel
---> PP= 20
BB_POLICY= relocatable
RELOCATABLE= yes
UPPER_BOUND= 32
LABEL= /chris
MAPFILE=
LV_MIN_LPS= 1
STRIPE_WIDTH=
STRIPE_SIZE=
SERIALIZE_IO= no
FS_TAG= vfs=jfs2:log=/dev/hd8:mount=true:options=rw:account=false
DEV_SUBTYP=

***Note: The 'LV_SOURCE_DISK_LIST' has been reduced to one disk, the 'COPIES' value has been changed to reflect one copy, and the 'PP' value has been changed so that it is equal to the 'LPs' value.

5. Save the edited /image.data file (image.data.mksysb if restored from a mksysb) with the following command:
*Hit the "Esc" button to exit 'input' mode, then type the following:
:wq!
Press <Enter> to save and exit the file

***Aside from the values specified in the documentation above, no other values in the /image.data file should be edited. Any other editing of the /image.data file is unsupported.***

6. At this point you can use the edited image.data file to do one of the following:
You can now use your newly edited image.data file to create a new mksysb to file, tape, or DVD..
Example :
To file or tape : place the edited image.data file in the / (root) directory and rerun your mksysb command without using the “-i” flag. If running the backup through SMIT, make sure you set the option “Generate new /image.data file?” to 'no'. (By default it is set to 'yes')
-Creating a mksysb with an edited image.data file to tape or file


To DVD : Use the -i flag and specify the </location> of the edited image.data file. If running through SMIT specify the edited image.data file location in the “User supplied image.data file” field.
-Technote: http://www-01.ibm.com/support/us/search/index.html
--In 'Search' box type "Creating mksysb backup to DVD"


Within NIM you would create an 'image_data' resource for use with NIM to restore a mksysb without preserving mirrors.


7. If you edited the /image.data file of a running system prior to creating a mksysb, you can now run the 'mkszfile' command to recreate the /image.data file to correctly reflect the mirroring of rootvg. Make sure you run this command prior to any type of reboot

____________________________________________________________________________

Creating a mksysb with an existing edited image.data file to tape and file



For the purposes of this document, all references to tape or CD drives will be rmt0 and cd0. Your devices may vary.

1. Create a new /image.data file with the following command:

# cd /
# mkszfile

2. Break the mirror in the /image.data file as shown in the steps above
How to edit an image.data file to break a mirror

3. Move the edited image.data file to the root (/) directory

# mv /tmp/edited.image.data /image.data

3. Use the mksysb command to create a new mksysb with the /image.data file that has the broken mirror.

From command line:
To tape:
# mksysb /dev/rmt0

To file:
# mksysb /location/of/mksysb/file

***NOTE: DO NOT use the '-i' or '-m' flags. These flags will create a new /image.data file based upon the systems current configuration. This means that the mirrors will still be in tact in the mksysb. All other mksysb flags can be used.

- OR -

Using smit:

Use smit to create a mksysb:

# smit mksysb

Back Up the System

Type or select values in entry fields.
Press Enter AFTER making all desired changes.

[Entry Fields]
WARNING: Execution of the mksysb command will
result in the loss of all material
previously stored on the selected
output medium. This command backs
up only rootvg volume group.
* Backup DEVICE or FILE [/dev/rmt0] +/
Create MAP files? no +
EXCLUDE files? no +
List files as they are backed up? no +
Verify readability if tape device? no +
Generate new /image.data file? no + <---
EXPAND /tmp if needed? no +
Disable software packing of backup? no +
Backup extended attributes? yes +
Number of BLOCKS to write in a single output [] #
(Leave blank to use a system default)
Location of existing mksysb image [] /
File system to use for temporary work space [] /
(If blank, /tmp will be used.)
Back up encrypted files? yes +
Back up DMAPI filesystem files? yes +

***NOTE: By default, the 'Generate new /image.data file?' selection is set to 'yes'. You must make sure to change this selection to 'no', as displayed in the example above.

____________________________________________________________________________

Creating an 'image_data' resource without preserving mirrors for use with NIM



1. Transfer the /image.data.mksysb file to the NIM master (if the file is not not already on the NIM master) and store it in the location you desire. It is a good idea to place the file, or any NIM resource for that matter, in a directory labeled in a descriptive manor.
Ex : /export/nim/image_data
This will ensure you can easily identify where your "image_data" resources are located, should you have the need for multiple "image_data" resources.

Make sure your image.data filenames are descriptive also. A common way to name the file would be in relation to your clientname.
Ex : ClientA.imagedata

2. Run the nim command, or use smitty and the fast path ‘nim_mkres’ to define the file that you have edited using the steps above:

From command line on the NIM master:

# nim -o define -t image_data -a server=master -a location=/export/nim/image_data/ClientA.imagedata -a comments="image.data file with broken mirror for testlpar" mksysb_image_data

***NOTE: "mksysb_image_data" is the name I am giving the 'image_data' resource

Using smit on the NIM master:

# smit nim_mkres
--> select 'image_data' as the Resource Type
Define a Resource

Type or select values in entry fields.
Press Enter AFTER making all desired changes.

[Entry Fields]
* Resource Name [mksysb_image_data]
* Resource Type image_data
* Server of Resource [master] +
* Location of Resource [/export/nim/image_data/ClientA.imagedata /
NFS Client Security Method [] +
NFS Version Access [] +
Comments [image.data file with broken mirror for testlpar]
Source for Replication [] +

3. Run the following command to make sure the 'image_data' resource was created:

# lsnim -t image_data

**The command will give output similar to the following:
mksysb_image_data resources image_data

4. Run the following command to get information about the 'image_data' resource:

# lsnim -l mksysb_image_data

**The command will give output similar to the following:
mksysb_image_data:
class = resources
type = image_data
comments = image.data file with broken mirror for testlpar
Rstate = ready for use
prev_state = unavailable for use
location = /export/nim/image_data/ClientA.imagedata
alloc_count = 0
server = master

____________________________________________________________________________

Using the 'image_data' resource to restore a mksysb without preserving mirrors using NIM



1. Specify using the 'image_data' resource when running the 'bosinst' command from the NIM master:
From command line on the NIM master:

# nim -o bos_inst -a source=mksysb -a lpp_source=<lpp_source> -a spot=<SPOT> -a mksysb=<mksysb> -a image_data=mksysb_image_data -a accept_licenses=yes ClientB

- OR -

Using smit on the NIM master:

# smit nim_bosinst
>select the client to install
>select 'mksysb' as the type of install
>select a SPOT at the same level as the mksysb you are installing
>select an lpp_source at the same level than the mksysb you are installing.

*NOTE: It is recommended to use an lpp_source at the same AIX Technology Level, but if using an lpp_source at a higher level than the mksysb, the system will be updated to the level of the lpp_source during installation. This will only update Technology Levels
Example:
You are using an AIX 6100-08 mksysb, you cannot use a 7.x lpp_source
This will not migrate the Version of AIX you are running to a higher Version
Example:
You are using an AIX 6100-08 mksysb and allocate a 6100-09 lpp_source – this will update your target system to 6100-09

>See below for example:

Install the Base Operating System on Standalone Clients

Type or select values in entry fields.
Press Enter AFTER making all desired changes.

[TOP] [Entry Fields]
* Installation Target lucidbso
* Installation Type mksysb
* SPOT 6100_09_00_spot
LPP_SOURCE [6100_09_00_lpp] +
MKSYSB lucid_mksysb
BOSINST_DATA to use during installation [] +
IMAGE_DATA to use during installation [mksysb_image_data] + <---
RESOLV_CONF to use for network configuration [] +
Customization SCRIPT to run after installation [] +
Customization FB Script to run at first reboot [] +
ACCEPT new license agreements? [yes] + <---
Remain NIM client after install? [yes] +
Preserve NIM definitions for resources on [yes] +
this target?

FORCE PUSH the installation? [no] +

Initiate reboot and installation now? [no] +
-OR-
Set bootlist for installation at the [no] +
next reboot?


[{"Product":{"code":"SWG10","label":"AIX"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Component":"Installation- backup- restore","Platform":[{"code":"PF002","label":"AIX"}],"Version":"5.2;5.3;6.1;7.1","Edition":"","Line of Business":{"code":"LOB08","label":"Cognitive Systems"}}]

Document Information

Modified date:
17 June 2018

UID

isg3T1011782