AIX 5L SysAdmin I: (Unit 12) – AIX 5.1 Backup and Restore

Objectives:
—————–
Identify isues which have to be considered when deciding which backup policies to implement:
–> Media to be used
–> Frequency of the backup
–> Type of backup
List the different backup methods supported through SMIT and on the command line
Create a customized installable system image backup
Execute other useful command to manipulate the backed up data on the media

Why Backup?
———————-
Data is very important
–> Expensive to recreate
–> Can it be recreated?
Disaster recovery:
–> Hardware failure
–> Damage due to installation/repair
–> Accidental deletion
Transfer of data between systems
Reorganizing the file systems
Defragmentation to improve performance
System image for installation
Checkpoint (before/after upgrade)
Long term archive

Types of Backup
————————-
1. System – (makesysb) Records image backup of the operating system (backs up everything in rootvg)
2. Full – Preserves all user data and configuration files (by Volume Group or File System)
3. Incremental – Records changes since previous backups, Must be used carefully, Very quick

Backup Strategy:
————————–
Backup all data that changes!
System backup
Full backup
Incremental backups

Note: Make decision based upon how difficult it would be to have to recreate the data. Also based on time to backup.

Backup Devices – Tape:
———————————–
4mm DAT
8mm
1/2 – inch
DLT
Low Capacity RetensiononOpen RewindonClose
/dev/rmtx no no yes
/dev/rmtx.1 no no no
/dev/rmtx.2 no yes yes
/dev/rmtx.3 no yes no
/dev/rmtx.4 yes no yes
/dev/rmtx.5 yes no no
/dev/rmtx.6 yes yes yes
/dev/rmtx.7 yes yes no

Backup Menus:
———————–
Logical Volume Manager –> Volume Groups
File Systems
Files and Directories
System Backup Manager

Note: There is not a single backup menu in smit. There are backup options on many of the menus depending upon what you want to backup. See list above.

rootvg Backup Process – mksysb
————————————————–
1. Backs up rootvg only
2. Unmounted file systems are not backed up
3. Bootable tape is created in backup format
4. Provides facilities for a non-interactive installation
5. Saves system-created paging space definitions
6. Saves logical volume policies
7. There should be minimal user and application activity

/image.data File for rootvg
————————————–
Snap shot of current Volume Group, Logical Volume and File System data is stored on the system.
Can be modified when necessary

/bosinst.data File for rootvg
—————————————-
Contains all the information from when the system was installed.
Can be modified when necessary
control_flow:
PROMPT = yes (Make sure this is set to “yes” so that it will not automatically start an install when booting)

Note: Do not use to boot to maintenance mode.

rootvg Image Backup
——————————-
# smit mksysb

mksysb Image (bootable image)
———————————————–
Blocksize = 512 – BOS Boot image (Kernel Device Drivers)
File Mark
Blocksize = 512 – mkinsttape image (/image.data, /bosinst.data)
File Mark
Blocksize = 512 – dummy.toc – Dummy TOC (Table of Contents)
File Mark
TapeDrive Blocksize – rootvg data – backup by name

Non-rootvg Backup:
—————————-
# smit savevg

Note: Can backup any Volume Group. However, it does not create a bootable image.

Restoring a mksysb (1 of 2):
——————————————
Boot the system in Install/maintenance mode with mksysb in cd drive.
Note: Can also boot from a CD with the same operating system version. You will get the same Installation and Maintenance menu.

Choose menu options in this order:
Start Maintenance Mode for System Recovery
Install from a System Backup
Choose Tape Drive

When booting from a mksysb backup tape the following menus will also appear.
Change/Show Installation Settings and Install
Answer questions then select 0 to install.

Restoring a non-rootvg Volume Group:
——————————————————–
# smit restvg

Note: It will most likely take twice the time to restore a volume group as it does to backup a volume group.

backup by File Name:
——————————–
backup -i [-q] [-p] [-v] [-f device]

-i – read file names from standard input
-q – query (media is ready)
-p – compress file which are less than 2 GB
-v – verbose – display filenames during backup

Examples:
# cat listfile
/home/roy/file1
/home/roy/file2
/home/roy/file3
# backup -iqvf /dev/rmt0 < listfile Use find to generate list # find /home/roy | backup -iqvf /dev/rmt0 (Full path) - Will always restore to /home/roy/... or # cd /home/roy # find . | backup -iqvf /dev/rmt0 (Relative Path) - Will restore to the current directory what ever it is. Note: Relative vs Full Filenames will impact Location of Files on Recovery!!!!! backup a File or a Directory ---------------------------------------- # smit backfile backup a File System by Inode (Incremental Backup) ---------------------------------------------- backup [-u] [-level] [-f device] filesystem Levels provide incremental backups: -0 - Full File system back up -1, -2, ... backup changes since level -1 /etc/dumpdates contains a backup history -u updates /etc/dumpdates Note: The restore process will take considerably more time than the backup process since you may have to look at several backup images to restore a file or file system. Backup a File System by Inode ---------------------------------------------- # smit backfilesys restore Command ---------------------------- List files on media (Verify the backup) restore -T [-q] [-v] [-f device] -T - Table of contents -q - quite that question -v - verbose -f - device # restore -Tvf /dev/rmt0 Restore (eXtract) individual files. restore -x [-q] [-v] [-f device] [file1 file2..] -x - Extract # restore -xvf /dev/rmt0 /home/ike/manual/chap1 Restore complete file system restore -r [-q] [-v] [-f device] -r - restore everything Restore backups in order, that is, -0 then -1 and so forth # restore -rqvf /dev/rmt0 Restore a File or a Directory ----------------------------------------- # smit restfile Other UNIX backup Commands: ----------------------------------------------- tar (tape archive) -Widely available -Good for transfer of data between platforms -Has no support for extended inode (ACLs) ACL - Access Control Lists cpio (copy input to output) -Widely available -Difficulties can occur with many symbolic links -Has no support for extended inode (ACLs) dd (device to device) -Makes backup copies that are an exact image -Can also be used for conversions For example: can convert ASCII to EBCDIC tar Command -------------------- Generate a tar backup # tar -cvf /dev/rmt0.3 /home -c - create a backup -v - verbose -f - file to backup to Restore a file from a tar image # tar -xvf /dev/rmt0 /home/team01/mydir -x - restore or extract List (verify) content of a tar file # tar -tvf /dev/rmt0 -t - table of contents cpio Command ----------------------- Generate a cpio backup # find /home | cpio -ov> /dev/rmt0
-o – writing to output >
-v – verbose

Restore from a cpio image
# cpio -idv

Leave a Reply

Your email address will not be published. Required fields are marked *

*