Tanti Technology

My photo
Bangalore, karnataka, India
Multi-platform UNIX systems consultant and administrator in mutualized and virtualized environments I have 4.5+ years experience in AIX system Administration field. This site will be helpful for system administrator in their day to day activities.Your comments on posts are welcome.This blog is all about IBM AIX Unix flavour. This blog will be used by System admins who will be using AIX in their work life. It can also be used for those newbies who want to get certifications in AIX Administration. This blog will be updated frequently to help the system admins and other new learners. DISCLAIMER: Please note that blog owner takes no responsibility of any kind for any type of data loss or damage by trying any of the command/method mentioned in this blog. You may use the commands/method/scripts on your own responsibility. If you find something useful, a comment would be appreciated to let other viewers also know that the solution/method work(ed) for you.

Sunday, 5 January 2014

System Backup And Restore Commands in AIX

System Backup has become an essential part in today’s world. Backup is generally created to prevent loss of data.
In various production environments, backup of data is created to save all the transactions and the history of vital information available inside servers in each and every company today.
This particular post will discuss about the various commands used with respect to system backup and restore in AIX Operating system in a production environment.
There are multiple commands available to take Backup and restore it back on to the servers.
The first command that we will discuss is:
MKSYSB Command: This command is used to create an image on the Operating System on the Tape Drive.
This backup created on the tape drive can be used later to restore the entire OS from the tape onto the disk in its original state. It works very similar to how backup and restore works in windows Operating Systems (OS).
Command used to create backup with mksysb command is:
# mksysb –ief /dev/rmt0
Where rmt0 is the name of the tape drive on which the backup is created.
Flags:
Flag i stands for the image backup that will be created on running this command
E stands for exclusion of the file systems which are not needed while creating the backup on the tape drive. Administrator can remove the files/file systems they think is not needed while creating a backup.
To remove a particular file system, admin needs to edit the /etc/excludevg.rootvg file and specify the file systems which need not be backed up.
F stands for reading out the files backed up.
Mksysb command is also used to backup SMIT screen.
Commands used to backup user information are:
1. Savevg command: this command finds and backup all the files that belongs to a particular Volume group (VG).
Command used to create backup is:
# savevg –ief /dev/rmt0
Where vgname is the name of the volume group to be backed up.
Similarly, to backup a non root vg, command use is:
# savevg –f -i
For eg:
#savevg –f /home/user01/vg00_backup –i vg00
After running this command, admin can remove vg00 from the system. Command to restore vg00 back from vg00_backup is:
# restvg –qf
For eg:
# restvg –qf /home/user01/vg00_backup hdisk10
So restvg command is basically used to restore non root vg data.
1. Tar command: it writes data from the disk onto the archival medium. It also restores the data back from tape to the disc.
To backup current working directory, command used is:
# cd /
# pwd
used to verify the current working directory.
# tar –cvf /dev/rmt0
Where
C stands to create a new backup on the archival medium
V stands for verbose
F stands for read
# tar –x extracts files from the archival medium on to the disk.
# tar –t will list the order in which the files appear on the archival medium.
To backup using tar command:
# tar –cvf
To restore:
# tar –xvf
1.  Cpio command: copies files into / out of the storage (archival) medium.
2. Backup command: creates the image/ copy of the files to be backedup on the archival medium.
# backup [–i] or [-p] or [-v] or [-q] or [-u] flags can be used to take backup.
-u flag creates an entry in /etc/dumpdates that is having all the backup history information.
To backup current directory, command used is:
#cd
# pwd
# backup –i –f /dev/rmt0
To backup a particular file system, command used is:
# backup -0 –f -f
For eg:
# backup -0 –f /home/user01/vg00_backup –i /home/usr01/vglv
Flag 0 means weekly backup
1 means daily
To restore this backup command used is:
# restore –qf
Or
# restore –xvf
Generally, /dev/rmt0 is the default destination medium where data is backed up.
Condition for RootVg Backup:
1.       Concentrate only on rootvg
2.      Unmounted file systems are not backed up
3.      Contains VGDA information, PV, VG and Policies
Restoration in maintenance mode is done in 3 ways:
1.       Boot from CD
2.       Telinit S|s|M|m
3.       # shutdown -m
There are 2 ways to restore after logging into maintenance mode:
1.       System backup first and then restore (offline mode)
2.       Restore directly from tape drive (all devices are shown CD0, RMT0. Choose tape drive / cd drive. Choose hard disk where restoration is to be done. System is restored)
/etc file system will hold most of the information about backup and restore.

No comments:

Post a Comment