Posts tagged ·

restore

·...

Creating and restoring a savevg backup without preserving mirrors

Comments Off

Question

How to create and/or restore an existing savevg backup without preserving mirrors.

Answer

This document describes how to restore a savevg image without preserving
mirrors.

WARNING: This procedure is valid only with a savevg image and
will not work with a Sysback 6000 system backup.

Creating a savevg without mirroring
Breaking mirrors on an existing savevg


Creating a savevg without mirroring

 

If the ability to rerun the savevg is available, the following procedure
will
allow you to create a savevg without preserving mirroring.

    1. To create a new
      /tmp/vgdata/<vgname>/<vgname>.data file,
      execute the following
      command.
            mkvgdata <vgname>

<vgname> is the name of the volume group to be backed
up.

  1. Change directories to /tmp/vgdata/<vgname> and, using
    your favorite editor, edit the <vgname>.data file.

    For example:

            cd /tmp/vgdata/<vgname>
            vi <vgname>.data

 

  • The following examples show an lv_data stanza of a
    <vgname>.data
    file. The first example is with mirroring, while the second example shows
    the
    edited version without mirroring. The lines that need changes are marked by
    –>.
    In the second example, the changes are made to those
    lines.

 

To view and edit the file, using your favorite editor, open
<vgname>.data:

   Example 1
                        lv_data:
                                VOLUME_GROUP= <vgname>
                                LV_SOURCE_DISK_LIST=  hdisk1
                                LV_IDENTIFIER= 00000001113f3c62.5
                                LOGICAL_VOLUME= lv00
                                VG_STAT= active/complete
                                TYPE= jfs
                                MAX_LPS= 512
                       -->      COPIES = 2
                                LPs = 70
                                STALE_PPs= 0
                                INTER_POLICY= minimum
                                INTRA_POLICY= center
                                MOUNT_POINT= /apps
                                MIRROR_WRITE_CONSISTENCY= on
                                LV_SEPARATE_PV= yes
                                PERMISSION= read/write
                                LV_STATE= opened/syncd
                                WRITE_VERIFY= off
                                PP_SIZE= 4
                                SCHED_POLICY= parallel
                       -->      PP = 140
                                BB_POLICY= relocatable
                                RELOCATABLE= yes
                                UPPER_BOUND= 32
                                LABEL= /apps
                                MAPFILE=
                                LV_MIN_LPS= 68
   Example 2
                        lv_data:
                                VOLUME_GROUP= <vgname>
                                LV_SOURCE_DISK_LIST=  hdisk1
                                LV_IDENTIFIER= 00000001113f3c62.5
                                LOGICAL_VOLUME= lv00
                                VG_STAT= active/complete
                                TYPE= jfs
                                MAX_LPS= 512
                       -->      COPIES = 1
                                LPs = 70
                                STALE_PPs= 0
                                INTER_POLICY= minimum
                                INTRA_POLICY= center
                                MOUNT_POINT= /apps
                                MIRROR_WRITE_CONSISTENCY= on
                                LV_SEPARATE_PV= yes
                                PERMISSION= read/write
                                LV_STATE= opened/syncd
                                WRITE_VERIFY= off
                                PP_SIZE= 4
                                SCHED_POLICY= parallel
                        -->     PP = 70
                                BB_POLICY= relocatable
                                RELOCATABLE= yes
                                UPPER_BOUND= 32
                                LABEL= /apps
                                MAPFILE=
                                LV_MIN_LPS= 68

NOTE: In Example 2, the COPIES value has been changed to 1,
and
the PP value is set equal to the LPs value. Make these changes
to each of the lv_data stanzas in the
<vgname>.data file. Once you make the changes, save the
file and exit.

 

  • Run another savevg from the command line that will utilize your
    edited
    <vgname>.data file.

 

                savevg -f /dev/rmtX <vgname>

X is the number of your tape device. You may also use a filename.

WARNING: Do not run the savevg in SMIT because this will
update
the <vgname>.data file and overwrite any changes made.

WARNING: Do not run the savevg with the -i flag
because this
will update the <vgname>.data file as well.


Breaking mirrors on an existing savevg

 

If another savevg cannot be run, the following procedure can be used to
restore
a savevg without mirroring.

All references to the tape device in the next section are as rmt0. You may also write the savevg backup to file.

  1. On the target system, place the savevg tape in the tape drive.

 

  • Remove the /tmp/vgdata directory:

 

                rm -r /tmp/vgdata

 

  • Restore the /tmp/vgdata directory from the savevg tape:

 

               cd /
               restore -xqvdf /dev/rmt0 ./tmp/vgdata

 

  • Edit the
    /tmp/vgdata/<vgname>/<vgname>.data file, and
    make
    changes to each of the lv_data stanzas as indicated in the examples
    that follow.
    The lines that need changes are marked by a –>.
    In Example 4, the changes are made to those lines.

 

To view and edit the file, using your favorite editor,
open
/tmp/vgdata/<vgname>/<vgname>.data:

     Example 3
                        lv_data:
                                VOLUME_GROUP= <vgname>
                                LV_SOURCE_DISK_LIST=  hdisk1
                                LV_IDENTIFIER= 00000001113f3c62.5
                                LOGICAL_VOLUME= lv01
                                VG_STAT= active/complete
                                TYPE= jfs
                                MAX_LPS= 512
                        -->     COPIES = 2
                                LPs = 120
                                STALE_PPs= 0
                                INTER_POLICY= minimum
                                INTRA_POLICY= center
                                MOUNT_POINT= /apps2
                                MIRROR_WRITE_CONSISTENCY= on
                                LV_SEPARATE_PV= yes
                                PERMISSION= read/write
                                LV_STATE= opened/syncd
                                WRITE_VERIFY= off
                                PP_SIZE= 4
                                SCHED_POLICY= parallel
                        -->     PP = 240
                                BB_POLICY= relocatable
                                RELOCATABLE= yes
                                UPPER_BOUND= 32
                                LABEL= /apps2
                                MAPFILE=
                                LV_MIN_LPS= 68
     Example 4
                        lv_data:
                                VOLUME_GROUP= <vgname>
                                LV_SOURCE_DISK_LIST=  hdisk0
                                LV_IDENTIFIER= 00000001113f3c62.5
                                LOGICAL_VOLUME= lv01
                                VG_STAT= active/complete
                                TYPE= jfs
                                MAX_LPS= 512
                        -->     COPIES = 1
                                LPs = 120
                                STALE_PPs= 0
                                INTER_POLICY= minimum
                                INTRA_POLICY= center
                                MOUNT_POINT= /apps2
                                MIRROR_WRITE_CONSISTENCY= on
                                LV_SEPARATE_PV= yes
                                PERMISSION= read/write
                                LV_STATE= opened/syncd
                                WRITE_VERIFY= off
                                PP_SIZE= 4
                                SCHED_POLICY= parallel
                        -->     PP = 120
                                BB_POLICY= relocatable
                                RELOCATABLE= yes
                                UPPER_BOUND= 32
                                LABEL= /apps2
                                MAPFILE=
                                LV_MIN_LPS= 120

NOTE: In Example 4 the COPIES value has been changed to 1, and
the PP value is set equal to the LPs value. Make these changes to each of
the lv_data stanzas in the <vgname>.data file.
Once you make
the changes, save the file and exit.

  • After making the changes to the <vgname>.data file,
    create a
    backbyname of /tmp/vgdata to run restvg against.
                cd /
  find ./tmp/vgdata -print |backup -iqvf /tmp/vg.back

This should back up the following files:

                ./tmp/vgdata
  ./tmp/vgdata/vgdata.files
  ./tmp/vgdata/<vgname> 
  ./tmp/vgdata/<vgname>/filesystems
  ./tmp/vgdata/<vgname>/<vgname>.data

<vgname> is the name of your volume group.

  • Verify that the files were backed up, and that the file can be read:
                restore -Tqvf /tmp/vg.back
  • Run the restvg command to recreate the volume group on the hdisks
    you want:
  restvg -f /tmp/vg.back hdisk# hdisk#
  • This should complete fairly quickly (depending on how many logical
    volumes and file systems are being created) and return to the command line.
    Verify that the volume group and file systems were re-created:
  lsvg -l <vgname>

And verify the file systems mounted:

  mount
  • If all looks good, restore the files from the tape:
  cd /
  restore -xqvdf /dev/rmt0
Comments Off

db2vend crash or generating trap during DB2 backup or restore

Comments Off

Problem(Abstract)

DB2 backup using Tivoli Storage Manager API client can crash or generating traps

Cause

Problem with bundled gskit code. The fix is in gskit 8.0.13.4. Tivoli Storage Manager API added gskit 8.0.13.4 in 6.2.2 API. This resolves the crash issue described in apar IC67672 . With the fix for IC67672 applied, the DB2 backup and restore may still generate a trap file. This is because DB2 uses its own gskit and to date, DB2 has not bundled gskit 8.0.13.4 in their code yet.

Environment

DB2 backups using Tivoli Storage Manager API client v6.2 to a Tape Storage.

Diagnosing the problem

DB2 backup or restore from a Tivoli Storage Manager creates traps. Example of a trap:


DB2 build information: DB2 v9.7.0.2 s100514 SQL09072
timestamp: 2010-11-02-10.48.28
Process name: db2vend (db2med - 66910 (TEDB1))
Signal #4
uname: S:AIX R:1 V:6 M:0005A5E3D600 N:HDQPS104
process id: 913410
thread id : 1 (0x1)
kthread id : 6377571
</Header>
<SignalDetails>
<Siginfo_t length="64">
00000004 00000000 0000001E 00000000
00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000
</Siginfo_t>
Signal #4 (SIGILL): si_addr is 0x0000000000000000, si_code is 0x0000001E
(ILL_ILLOPC:Illegal opcode.)

 

Resolving the problem

DB2 plans to add gskit 8.0.13.4 in DB2 9.7 FixPack 5, not yet released. The following option can be used with the Tivoli Storage Manager 6.2 client to work around the issue:

  • Add the following line in the “dsm.opt ” file:testflag noaes
    • /<opt or usr>/tivoli/tsm/client/api/bin directory if DB2 is 32bit
    • /<opt or usr>/tivoli/tsm/client/api/bin64 directory if DB2 is 64bit
  • Note: The dsm.opt should be the one defined as “DSMI_CONFIG” or by default:

Note that with the “testflag noaes” option, the Tivoli Storage Manager API client is not able to do 128-bit encryption or client deduplication.

Comments Off

How To Restore Root (and /usr/) rfile system Solaris- restoresymtable

Comments Off

Sun Solaris – Restoring root file system (/) –Solaris 9, Solaris 10 provides steps we need to follow to restore the root file system (/ system) in SPARC and x86 (intel) machines.
1) Log in as root user. It is a security practice to login as normal user and perform an su to take root user (super user) role.

2) Appearance of # prompt is an indication that the user is root

3) Use who -a command to get information about current user

4) When / (root filesystem) is lost because of disk failure. In this case we boot from CD or from the network.

5) Add a new system disk to the system on which we want to restore the root (/) file system

6) Create a file system using the command :

newfs /dev/rdsk/partitionname

7) Check the new file system with teh fsck command :

fsck /dev/rdsk/partitionname

8) Mount the filesystem on a temporary mount point :

mount /dev/dsk/devicename /mnt

9) Change to the mount directory :

cd /mnt

10) Write protect the tape so that we can’t accidentally overwrite it. This is an optional but important step

11) Restore the root file system (/) by loading the first volume of the appropriate dump level tape into the tape drive. The appropriate dump level is the lowest dump level of all the tapes that need to be restored. Use the following command :

ufsrestore -rf /dev/rmt/n

12) Remove the tape and repeat the step 11 if there is more than one tape for the same level

13) Repeat teh step 11 and 12 with next ddump levels. Always begin with the lowest dump level and use highest ump level tape

14) Verify that file system has been restored :

la

15) Delete the restoresymtable file which is created and used by the ufsrestore utility :

rm restoresymtable

16) Change to the root directory (/) and unmount the newly restored file system

cd /
umount /mnt

17) Check the newly restored file system for consistency :

fsck /dev/rdsk/devicename

18) Create the boot blocks to restore the root file system :
installboot /usr/platform/sun4u/lib/fs/ufs/bootblk /dev/rdsk/devicename — SPARC system
installboot /usr/platform/`uname -i`/lib/fs/ufs/pboot /usr/platform/`uname -i`/lib/fs/ufs/bootblk /dev/rdsk/devicename — x86 system

19) Remove teh last backup tape, and insert a new tape onto which we can write. Make a dump level 0 backup of the newly restored system by issuing the following command :

ufsdump 0ucf /dev/rmt/n /dev/rdsk/deviceName
This step is needed because ufsrestore repositions the files and changes the inode allocations – the old backup will not truly represent the newly restored file system

20) Reboot the system :
#reboot (or)
# init 6
System gets rebooted and newly restored file systems are ready to be used.

Comments Off