mksysb and savevg backup & restore
A mksysb is a bootable backup of your root volume group.
The mksysb process will backup all mounted JFS and JFS2 filesystem data.
The file-system image is in backup-file format. (bff)
First check whether the filesystems you want to backup is mounted.
#lsvg –l rootvg
Check for state that should be open and also check for mountpoint (last column)
Or use
#mount
Check all the filesystems are there in the output that you want to backup.
If you don,t want to take backup of particular userdefined filesystem in rootvg,
Unmount it .
----- Check for the available tape drives
#lsdev –Cc tape
rmt0 available
Then you can use below command.
Creating a mksysb to a tape drive in AIX V6
. Using SMITTY :
# smitty mksysb
Backup DEVICE or FILE.........................[/dev/rmt0] @
Create MAP files?.............................no
EXCLUDE files?................................no (-e)
List files as they are backed up?.............no
Verify readability if tape device?............no
Generate new /image.data file?................yes (-i) @
EXPAND /tmp if needed?........................yes (-X) @
Disable software packing of backup?...........no (-p)
Backup extended attributes?...................yes
Number of BLOCKS to write in a single output..[]
Location of existing mksysb image.............[]
File system to use for temporary work space...[]
Backup encrypted files?.......................yes
Back up DMAPI filesystem files?...............yes
It will take around 1 hour …
To verify the readability of your backup run the following command :
# listvgbackup -Vf /dev/rmt0
Any errors that occur while reading the headers of any of the files willbe displayed,
otherwise only the initial backup header information will
be displayed. Keep in mind that this check tests the readability of the file only, not the writeability.
---------------------------------------------
For checking the whether all the files,filesystems are backed up, you can view the table of content
Use this command
#restore -s4 –Tvqf /dev/rmt0 >/tmp/mksysb.log
It will create one file in /tmp.
Then,
#cd /tmp
#more mksysb.log
Check the table of content.
RESTORING THE BACKUP
To
restore a mksysb image you simply need to boot from the tape and
verify your selections in the BOS menus. Next, we’ll cover two booting
scenarios.
When your system is currently up and operational
1.
If your system is currently running and you need to restore your
mksysb, simply change the bootlist to reflect the tape drive and reboot the system.
# bootlist -m normal rmt0
# shutdown -Fr
If your system is in a down state
You
should boot to the SMS menus from AIX CD. and set your bootlist to
reflect the tape drive. The SMS menu options are listed below. Your menu
options may be different (depending on your level of firmware), however
it should be clear enough by following
this document to figure out what options should be chosen if yours differ.
SMS - SYSTEM MANAGEMENT SERVICES -
1. Select Language
2. Change Password Options
3. View Error Log
4. Setup Remote IPL (RIPL (Remote Initial Program Load))
5. Change SCSI Settings
6. Select Console
--> 7. Select Boot Options
The next menu should come up :
--> 1. Select Install or Boot Device
2. Configure Boot Device Order
3. Multiboot Startup
FOR SETTING BOOTLIST YOU HAVE TO GO TO “CONFIGURE BOOT DEVICE ORDER”
The next menu will have the following :
Select Device Type :
1. Diskette
2. Tape
3. CD/DVD
4. IDE
5. Hard Drive
6. Network
--> 7. List all Devices
The system will scan itself to determine which devices are available to boot from.
it will display all bootable devices.
The next screen will offer you three choices :
1. Information
--> 2. Normal Mode Boot
3. Service Mode Boot
Restore menus
I. From the Installation and Maintenance Menu, select (2):
1)Start Installation Now with Default Settings
2)Change/Show Installation Settings and Install
3)Start Maintenance Mode for System Recovery
II. From the System Backup Installation and Settings,
you’ll see the default options that are taken from your “bosinst.data” file.
If these are correct select (0) .
* If you need to change any options such as the disks you would like to install to select (1):
Setting:Current Choice(s):
1. Disk(s) where you want to install... hdisk0
Use Maps............................ No
2. Shrink File Systems................. No
0. Install with the settings listed above.
III. Change Disk(s) Where You Want to Install.
Type one or more numbers for the disks to be used for
installation and press Enter. The current choice is indicated by >>>.
At least one bootable disk must be selected. Choose the location by its SCSI ID.
Name Location Code Size (MB) VG StatusBootable
>>>1. hdisk 000-01-00-0,0 600456 rootvg yes
>>>2. hdisk 100-01-00-1,0 600456 rootvg yes
0. Continue with the choices indicated above
After the desired disks have been chosen, select (0) to continue.
IV. System Backup Installation and Settings, select (0 to continue)
Setting: Current Choice(s):
1. Disk(s) where you want to install......... hdisk0...
2. Use Maps.................................. No
3. Shrink File Systems....................... No
0. Install with the settings listed above.
Backup extended attributes?...................yes
Number of BLOCKS to write in a single output..[]
after giving lsvg command ,it will show all volume group.
#lsvg
rootvg
dev-qa
DBbackup
here we are having three volume group, rootvg ,dav-qa,DBbackup.
for taking rootvg backup we are using mksysb command
for taking backup of customized vg(i.e. dev-qa,DBbackup)we are using savevg command
remember that savevg command doesn,t create bootable image.
Non-rootvg Backup
here I an considering the scenario for taking backup on file and after that pushing it into tape.
#cd /abhi/asdir
#touch savevg-dev-qa-11-6.22
check the ulimit
#ulimit
set the fsize to unlimited.
#ulimit -f unlimited
now run savevg command
# smit savevg
Back Up a Volume Group to Tape/File type or select values in entry fields.
Press Enter AFTER making all desired changes.
[Entry Fields]
WARNING: Execution of the savevg command will
result in the loss of all material
previously stored on the selected
output medium.
- Backup DEVICE or FILE [ ] +/ /dev/rmto or any directory(/abhi/asdir/savevg-dev-qa-11-6.22)
* VOLUME GROUP to back up [ ] + (dev-qa) or DBbackup
List files as they are backed up? no +
Generate new vg.data file? Yes +
Create MAP files? no +
EXCLUDE files? no +
EXPAND /tmp if needed? no +
Disable software packing of backup? no +
Number of BLOCKS to write in a single output [ ] #
(Leave blank to use a system default)
F1=Help F2=Refresh F3=Cancel F4=List
F5=Reset F6=Command F7=Edit F8=Image
F9=Shell F10=Exit Enter=Do
check whether the savevg backup is successfully completed.
For that check the file savevg-dev-qa-11-6.22 in the directory /abhi/asdir is available.
#cd /abh/asdir
#pwd
/abhi/asdir
You can list the content of file
# cat /abhi/asdir/savevg-dev-qa-11-6.22
after that you have to push the file to tape.
For that use
#smit backfile
but before running this command check the below mentioned steps
Kindly check that while running this command you are in /
#pwd
/abhi/asdir
here it is showing that you are in directory /abhi/asdir
then give
#cd /
again check present working directory. It should be /
#pwd
/
then give the command #smit backfile
# smit backfile
Backup a File or Directory
Type or select values in entry fields.
Press Enter AFTER making all desired changes.
[Entry Fields] This option will perform a backup by name.
* Backup DEVICE [/dev/rmt0] +/
* FILE or DIRECTORY to backup [/abhi/asdir/savevg-dev-qa-11-6.22 .]
Current working DIRECTORY [ ] /
Backup LOCAL files only? yes +
VERBOSE output? no +
PACK files? No +
F1=Help F2=Refresh F3=Cancel F4=List
F5=Reset F6=Command F7=Edit F8=Image
F9=Shell F10=Exit Enter=D
after that check the content of tape.whether backup was successfull
# restore -Tvf /dev/rmt0
Restoring a non-rootvg Volume Group
for restoring savevg backup we are using restvg command.
#smit restvg
Remake a Volume Group
Type or select values in entry fields.
Press Enter AFTER making all desired changes.
[Entry Fields]
* Restore DEVICE or FILE [/dev/rmt0/savevg-dev-qa-11-6.22] /+
SHRINK the filesystems? no +
PHYSICAL VOLUME names [ ] +
(Leave blank to use the PHYSICAL VOLUMES listed
in the vgname.data file in the backup image)
Use existing MAP files? yes +
Physical partition SIZE in megabytes [ ] +#
(Leave blank to have the SIZE determined
based on disk size)
Number of BLOCKS to read in a single input [ ] #
(Leave blank to use a system default)
F1=Help F2=Refresh F3=Cancel F4=List
F5=Reset F6=Command F7=Edit F8=Image
F9=Shell F10=Exit Enter=Do
There are three types of backup methods:
1. . Full backup
2. .Incremental backup
3. .Differential backup
FULL BACKUP
All the files are backed on the media using this.
DIFFERENTIAL BACKUP
Differential backup strategy first looks for modification time of the file and compares it with
The last full backup.
Only modified files are backed up, but only if they are changed after the latest full backup.
INCREMENTAL BACKUP
Incremental backup checks the difference between the modification time and the
Last backup time.
If the modified time is more recent than the last backup date
The file is backed up.
SAVEVG
Savevg command is used to backup the user-defined volume group.
It doesn’t create bootable image.
The vg must be varied on and the filesystems to be backed up should be mounted.
Examples:
#savevg –i abhivg
It takes backup of abhivg to the default tape drive(/dev/rmt0)
#savevg –mf /dev/rmt1 abhivg
This command backs up the abhivg and also create map file along with
a new abhivg.data file on rmt1 device
#savevg –ief /dev/rmt1 abhivg
This command backs up abhivg excluding the files listed in /etc/exclude.abhivg
#savevg –f /dev/rmt0 –V abhivg
This command backs up abhivg on tape /dev/rmt0 and also verifies the readability of file header.
Important files
/image.data – contains information about the rootvg.
The savevg command uses this file to create a backup image
That can be used by NIM to reinstall the VG to current system
Or to the new system.
/tmp/vgdata/vgname/vgname.data-
Contains information about the user defined volume group.
Savevg uses this file to create a backup image that can be used
By restvg command to remake that user defined VG.
RESTVG
This command restores the user defined volume group .
#restvg –f /dev/rmt0 hdisk hdisk3
To restore the VG image from /dev/rmt0 onto hdisk2 hdisk3
#restvg –r –f /dev/rmt0
To recreate the VG logical volume structure without restoring any files .
#restvg –l –f /dev/rmt0
To display VG information about the VG backed on the tape /dev/rmt0
BACKUP COMMAND
Backup command creates copies of your files on the backup media.
Backup command can be used for taking backup using :
1. Backing files By name( we use –i flag for this)
2. .Backing filesystems by i-node(we use –level flag for this)
Backing up files by name
The backup command reads the standard input for the names of the files to be
Backed up.
File types can be special file,regular files or directories.
*if –p flag is specified only files of less than 2 gb are backed.
#find /home –print|backup –I –f /dev/rmt0
To backup all the files and directories in /home
#cd /home/abhi
#find . –print |backup –ivq
To backup all the files and subdirectories in the /home/abhi using the relative path.
Backing up filesystems by inode
To backup the filesystem by i-node , specify the “-level”
And “filesystem” parameter.
· You must first umount the filesystem before backing up by i-node.
#backup -0 –u –f /dev/rmt0
-0 means all root filesystem files are to backed .
To backup root filesystem
#backup -1 –u –f /dev/rmt0
To backup all the files in root filesystem that are modified since the last
Level 0 backup.
RESTORE COMMAND
Restore command extracts the files backed up using the backup command.
#restore –xvqf abhi.bkup system.data
To restore system.data file into the current directory from archieve
Abhi.bkup.the archieve is also in current directory.
#restore –xvdqf /dev/rmt0 /home/abhi/aks
To restore specific directory and its content from a file-name archieve.
* Source Article from : Internet