分类: 系统运维
2012-11-20 09:56:07
参考: http://blog.csdn.net/hongweigg/article/details/6180222
http://www.ibm.com/developerworks/cn/education/aix/au-restoreaix/section4.html
使用mksysb方式,把rootvg备份到本地磁盘上。
# oslevel -r
6100-04
1 检查评估rootvg大小
# lsvg rootvg
VOLUME GROUP: rootvg VG IDENTIFIER: 00cfff0e00004c000000013ac6342f68
VG STATE: active PP SIZE: 16 megabyte(s)
VG PERMISSION: read/write TOTAL PPs: 639 (10224 megabytes)
MAX LVs: 256 FREE PPs: 333 (5328 megabytes)
LVs: 12 USED PPs: 306 (4896 megabytes)
OPEN LVs: 11 QUORUM: 2 (Enabled)
TOTAL PVs: 1 VG DESCRIPTORS: 2
STALE PVs: 0 STALE PPs: 0
ACTIVE PVs: 1 AUTO ON: yes
MAX PPs per VG: 32512
MAX PPs per PV: 2032 MAX PVs: 16
LTG size (Dynamic): 256 kilobyte(s) AUTO SYNC: no
HOT SPARE: no BB POLICY: relocatable
2 检查文件系统是否有足够空间存放备份数据。
# df -m
Filesystem MB blocks Free %Used Iused %Iused Mounted on
/dev/hd4 192.00 16.37 92% 13461 73% /
/dev/hd2 2560.00 398.14 85% 45569 33% /usr
/dev/hd9var 368.00 96.81 74% 7181 24% /var
/dev/hd3 128.00 124.68 3% 19 1% /tmp
/dev/hd1 16.00 15.66 3% 5 1% /home
/dev/hd11admin 128.00 127.63 1% 5 1% /admin
/proc - - - - - /proc
/dev/hd10opt 368.00 168.57 55% 8695 19% /opt
/dev/livedump 256.00 255.64 1% 4 1% /var/adm/ras/livedump
/dev/cd0 3786.19 0.00 100% 1938529 100% /cdromdir
/dev/bklv 4720.00 4718.96 1% 4 1% /backupdir
3 使用smit chfs扩展/backupdir目录空间。
选择 Change / Show Characteristics of an Enhanced Journaled File System
再选择你需要扩的 LV 的 mount point /backupdir
先定位光标在 Unit Size 中按 F4 选择 Gigabytes 修改以 G 为单位
在 Number of units 输入要把/backupdir扩到多大
按执行键执行,等运行完成确认执行结果正常
COMMAND STATUS
Command: OK stdout: yes stderr: no
Before command completion, additional instructions may appear below.
Filesystem size changed to 10240000
4 确认/backupdir空间满足备份要求
# df -m
Filesystem MB blocks Free %Used Iused %Iused Mounted on
/dev/hd4 192.00 16.36 92% 13461 73% /
/dev/hd2 2560.00 398.14 85% 45569 33% /usr
/dev/hd9var 368.00 96.81 74% 7181 24% /var
/dev/hd3 128.00 124.68 3% 19 1% /tmp
/dev/hd1 16.00 15.66 3% 5 1% /home
/dev/hd11admin 128.00 127.63 1% 5 1% /admin
/proc - - - - - /proc
/dev/hd10opt 368.00 168.57 55% 8695 19% /opt
/dev/livedump 256.00 255.64 1% 4 1% /var/adm/ras/livedump
/dev/cd0 3786.19 0.00 100% 1938529 100% /cdromdir
/dev/fslv00 320.00 319.63 1% 4 1% /testdir
/dev/bklv 5000.00 4998.91 1% 4 1% /backupdir
5 用 touch 命令在 目录下创建备份空文件
# cd /backupdir
# touch sys_bk_data_1
# ls -l
total 0
drwxr-xr-x 2 root system 256 Nov 20 07:06 lost+found
-rw-r--r-- 1 root system 0 Nov 20 20:12 sys_bk_data_1
注意:空文件一定要先建立否则 mksysb 无法备份成功
出错提示如下:
Creating information file (/image.data) for rootvg.......
Creating list of files to back up.
.................
Backing up 76107 filesbackup: 0511-089 Cannot open /backupdir: Cannot write to a directory.
0512-005 mksysb: Backup Completed.
The backup command completed with errors.
The messages displayed on Standard Error contained additional
information
6 检查系统文件限制 /etc/security/limits 文件,修改 root 账户文件大小不限制
more /etc/security/limits
……
default:
fsize = 2097151
core = 2097151
cpu = -1
data = 262144
rss = 65536
stack = 65536
nofiles = 2000
root:
daemon:
bin:
sys:
adm:
uucp:
guest:
nobody:
lpd:
pconsole:
stack_hard = 131072
data = 1280000
data_hard = 1280000
esaadmin:
stack = 393216
stack_hard = 393216
调用 vi 命令在 /etc/security/limits 增加如下一行
root:
fsize = -1
#more /etc/security/limits
……
default:
fsize = 2097151
core = 2097151
cpu = -1
data = 262144
rss = 65536
stack = 65536
nofiles = 2000
root:
fsize = -1
daemon:
bin:
……
注意:若文件有限制 smit mksysb 会有如下提示
backup: 0511-432 A write error occurred: A file
cannot be larger than the value set by ulimit.
backup: 0511-079 The backup media may be damaged.
Use a different disk to run the backup.
修改完成后,退出再重新登录,然后进行下面备份操作。
7 发起备份 smit mksysb
Back Up This System to Tape/File or UDFS capable media
Type or select values in entry fields.
Press Enter AFTER making all desired changes.
[Entry Fields]
WARNING: Execution of the mksysb command will
result in the loss of all material
previously stored on the selected
output medium. This command backs
up only rootvg volume group.
* Backup DEVICE or FILE [/backupdir/sys_bk_data_1] +/
Create MAP files? no +
EXCLUDE files? no +
List files as they are backed up? yes +
Verify readability if tape device? no +
Generate new /image.data file? yes +
EXPAND /tmp if needed? no +
Disable software packing of backup? no +
Backup extended attributes? yes +
Number of BLOCKS to write in a single output [] #
(Leave blank to use a system default)
Location of existing mksysb image [] /
File system to use for temporary work space [] /
(If blank, /tmp will be used.)
Back up encrypted files? yes +
Back up DMAPI filesystem files? yes
备份完成之后会有报表提示 OK 表示备份成功 , 如下,会有 /var/tmp 目录临时文件系统提示无法备份属于正常,备份之后smit 的log 在根目录下smit.log 可以查看该文件便于查询故障,硬盘系统备份无法引导系统,需要配置NAM 才能做恢复测试