[Tip] Backup and restore on AIX | Unix Linux Forums | AIX

  Go Back    


AIX AIX is IBM's industry-leading UNIX operating system that meets the demands of applications that businesses rely upon in today's marketplace.

[Tip] Backup and restore on AIX

AIX


Tags
faq

Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 02-25-2013
MichaelFelt MichaelFelt is offline
Registered User
 
Join Date: Nov 2012
Last Activity: 11 December 2013, 7:33 AM EST
Location: on the road for work; home is private time
Posts: 311
Thanks: 6
Thanked 76 Times in 71 Posts
[Tip] Backup and restore on AIX

Quote:
Originally Posted by bakunin View Post
And for system-wide backups i would use "mksysb" and "savevg" solely under AIX - neither "tar" nor any of the other aforementioned programs.

Just my 2 cents.

bakunin
Pretty penny's.

Just remember that mksysb and savevg are just front-ends for backup.

In other words, backups on AIX are organized by volume groups. mksysb is specialized for rootvg and savevg is used for other volume groups.

Ignoring that rootvg also creates files needed to boot a system that basic content and layout is the same.



Code:
michael@x054:[/data/x052/suma/lpp]restore -Tqf *6108*savevg | head                                
New volume on vgNim.6108.savevg:
Cluster size is 51200 bytes (100 blocks).
The volume number is 1.
The backup date is: Thu Feb 21 13:28:20 CUT 2013
Files are backed up by name.
The user is root.
./tmp/vgdata/vgNim/image.info
./tmp/vgdata/vgdata.files10223824
./tmp/vgdata/vgdata.files
./tmp/vgdata/vgNim/filesystems
./tmp/vgdata/vgNim/vgNim.data
./tmp/vgdata/vgNim/backup.data


Code:
michael@x054:[/data/x052/suma/mksysb/6108]restore -Tqf *61*mksb | head    
New volume on 6100-08-00-0000.mksb:
Cluster size is 51200 bytes (100 blocks).
The volume number is 1.
The backup date is: Thu Feb 21 11:17:57 CUT 2013
Files are backed up by name.
The user is root.
./bosinst.data
./tmp/vgdata/rootvg/image.info
./image.data
./tmp/vgdata/rootvg/backup.data

Note: when mksysb is written to a file, rather than bootable medium, there is no boot program appended to the file (see above).

restvg - restore volume group - is the standard tool for restoring backups created by savevg.

"Booting" is the normal interface for restoring an mksysb image. Since a file does not have a normal boot interface a nim server can be used to restore practically any mksysb image. Two commands are needed to create the resources needed to restore an mksysb image "asis".

Code:
# nim -o define -t mksysb -a master=server -a location=/path/to/mksysb_file nim_mksysb_name
# nim -o define -t spot -a master=server -a location=/export/mksysb/spots nim_mysysb_spot

And then a nim bos_inst command using the two resources just defined to boot and install the image.

Getting back to restvg:

restvg -l -f savevg_or_mksysb.file will tell you what is in the backup - sort of like doing an lsvg -l command.

Code:
michael@x054:[/data/x052/suma/mksysb/6108]restvg -l -f 6100-08-00-0000.mksb
VOLUME GROUP:           rootvg
BACKUP DATE/TIME:       Thu Feb 21 05:17:32 CST 2013
UNAME INFO:             AIX localhost 1 6 00C39B8D4C00
BACKUP OSLEVEL:         6.1.8.0
MAINTENANCE LEVEL:      6100-08
BACKUP SIZE (MB):       2048
SHRINK SIZE (MB):       1527
VG DATA ONLY:           no

rootvg:
LV NAME             TYPE       LPs     PPs     PVs  LV STATE      MOUNT POINT
hd5                 boot       2       2       1    closed/syncd  N/A
hd6                 paging     32      32      1    open/syncd    N/A
hd8                 jfs2log    1       1       1    open/syncd    N/A
hd4                 jfs2       3       3       1    open/syncd    /
hd2                 jfs2       51      51      1    open/syncd    /usr
hd9var              jfs2       3       3       1    open/syncd    /var
hd3                 jfs2       5       5       1    open/syncd    /tmp
hd1                 jfs2       1       1       1    open/syncd    /home
hd10opt             jfs2       6       6       1    open/syncd    /opt
hd11admin           jfs2       8       8       1    open/syncd    /admin
livedump            jfs2       16      16      1    open/syncd    /var/adm/ras/livedump


Code:
michael@x054:[/data/x052/suma/lpp]restvg -l -f vgNim.6108.savevg
VOLUME GROUP:           vgNim
BACKUP DATE/TIME:       Thu Feb 21 13:28:00 UTC 2013
UNAME INFO:             AIX x106 1 6 00C39B8D4C00
BACKUP OSLEVEL:         6.1.8.0
MAINTENANCE LEVEL:      6100-08
BACKUP SIZE (MB):       10400
SHRINK SIZE (MB):       3563
VG DATA ONLY:           no

vgNim:
LV NAME             TYPE       LPs     PPs     PVs  LV STATE      MOUNT POINT
lgNim               jfs2log    1       1       1    open/syncd    N/A
lvtftpb             jfs2       2       2       1    open/syncd    /tftpboot
lvExp               jfs2       2       2       1    open/syncd    /export
lvMksb              jfs2       128     128     1    open/syncd    /export/mksysb
lv6108              jfs2       128     128     1    open/syncd    /export/6108
lv6108s             jfs2       64      64      1    open/syncd    /export/6108/spot

That is all for now. Questions and Comments to see where this takes us.

---------- Post updated 02-25-13 at 11:27 PM ---------- Previous update was 02-24-13 at 11:42 PM ----------

Questions is other threads remind me the importance of clearing limits for root user.


Code:
chuser fsize=-1 cpu=-1 data=-1 stack=-1 core=-1 rss=-1 root

This sets all ulimt settings to unlimited for root in /etc/security/limits

There may be reasons to hold some limits but this is a default I use in my nim fb_scripts (first boot scripts).

Note: you may need to perform a similar command for other applications using large files: e.g., oracle, itdsldap.

If you want to remove limits for everyone the command is simple (editing files is so 1985 :wink: )

Code:
chuser fsize=-1 cpu=-1 data=-1 stack=-1 core=-1 rss=-1 default

Moderator's Comments:
edit by bakunin: added prefix "[Tip]" to the threads title.

Last edited by bakunin; 02-26-2013 at 05:33 PM..
The Following 2 Users Say Thank You to MichaelFelt For This Useful Post:
filosophizer (02-26-2013), jim mcnamara (02-24-2013)
Sponsored Links
    #2  
Old 02-26-2013
bakunin bakunin is offline Forum Staff  
Bughunter Extraordinaire
 
Join Date: May 2005
Last Activity: 23 October 2014, 11:38 AM EDT
Location: In the leftmost byte of /dev/kmem
Posts: 4,286
Thanks: 45
Thanked 824 Times in 651 Posts
Quote:
Originally Posted by MichaelFelt View Post
Just remember that mksysb and savevg are just front-ends for backup.

In other words, backups on AIX are organized by volume groups. mksysb is specialized for rootvg and savevg is used for other volume groups.
Yes, but in fact it is the other way round: a carefully designed system organises data which are logically related (like, for instance, data used by one application) into the same volume group. These groups of logically related data make logical items to be backed up together, which is not surprising.


Quote:
Originally Posted by MichaelFelt View Post
Ignoring that rootvg also creates files needed to boot a system that basic content and layout is the same.
True. In fact "savevg" uses the same 4-part-layout "mksysb" does, but with the first 3 parts filled with dummy-entries. "savevg" even used to be a link to "mksysb", so this comes not as a surprise. The "mksysb"-file format is this (every part can be filled by dummy-entries):

1. boot code. Gets only written if destination file is a tape drive.
2. Installation section. contains installation commands, bosinst.data, etc.
3. TOC. A file in "inutoc" format of all the packages installed.
4. Data. The content of the volume group in backup-file-format (used to be "tar" in historic versions)

To restore a single file (directory, ...) from such a backup: always keep in mind, that the different parts are marked by a EOD on the tape. You have to skip forward to the fourth part and then use normal "restore" to pull it out of the backup-format file. IBM tape drives under AIX rewind automatically after every operation, you have to address the tape therefore with the auto-rewind feature switched off, which is done by using /dev/rmtX.1 :


Code:
tctl fsf 3 /dev/rmtX.1 ; restore ...

Quote:
"Booting" is the normal interface for restoring an mksysb image. Since a file does not have a normal boot interface a nim server can be used to restore practically any mksysb image.
Yes. It is also possible to boot the system with a normal boot CD and then restore from a non-bootable "mksysb"-image - for instance one which was taken to a file and later burned on CD.

Quote:
Questions is other threads remind me the importance of clearing limits for root user.
Good idea.

Quote:
If you want to remove limits for everyone the command is simple (editing files is so 1985 :wink: )
I once heard the basic tenet of UNIX is: everything is a file. Editing these can't be so bad, can it? Whatever can be edited in a file can be scripted and automated. Try scripting one of these graphical true-colour 3-D clicky-thingies and you will instantly appreciate the old-fashioned ways. The ones, where it isn't necessary to use your mouse at 3 o'clock in the morning but a script started by "at" does that for you and mails you the outcome. But that is perhaps another issue for another thread.

I hope this helps.

bakunin
The Following User Says Thank You to bakunin For This Useful Post:
filosophizer (02-27-2013)
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Backup / Restore Duffs22 Red Hat 6 07-17-2012 10:23 AM
AIX 5.2 Maksysb Image backup/restore dayinthelife AIX 3 06-16-2008 11:13 AM
AIX backup and restore quickfirststep AIX 3 09-07-2006 06:59 PM
AIX backup --> Linux Restore jauru AIX 2 07-11-2006 04:40 AM
AIX backup --> Linux Restore jauru Linux 0 07-10-2006 06:48 PM



All times are GMT -4. The time now is 10:40 AM.