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:
To restore:
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:
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:
Or
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