Chinaunix首页 | 论坛 | 博客
  • 博客访问: 374959
  • 博文数量: 78
  • 博客积分: 3274
  • 博客等级: 中校
  • 技术积分: 686
  • 用 户 组: 普通用户
  • 注册时间: 2009-11-06 12:47
文章分类

全部博文(78)

文章存档

2017年(1)

2016年(2)

2015年(2)

2014年(1)

2013年(5)

2012年(22)

2011年(8)

2010年(31)

2009年(6)

分类: 系统运维

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

  1. Backup device or file——c选择AIX 系统备份存放的地方。备份至磁带是最常见也是最省时的系统备份方法。请按 F4Esc+4 键获取设备的列表。这里输入备份文件和路径/backupdir/sys_bk_data_1
  2. Create map files—— 创建映射文件。Generate a layout mapping of the logical-to-physical partitions for each logical volume in the volume group. This mapping is used to allocate the same logical-to-physical partition mapping when the image is restored.
  3. Exclude files——由于您要对整个系统(位于 rootvg 上)执行备份,因此不需要排除任何文件,请将缺省设置保留为 No
  4. List files as they are backed up——此选项允许您查看要备份的所有文件。请将此选项设置为 No,因为它会降低备份过程的速度。
  5. Verify readability if tape device——对磁带进行检查,确保磁带能够被读取。
  6. Expand /tmp if needed——有时,创建的临时文件可能会填满文件系统,因此您可能需要对 /tmp 目录进行扩展。您不会希望备份因 /tmp 目录不够大而失败。
  7. Generate new /image.data file——缺省设置为 Yes。在运行备份时,系统将创建 image.data 文件。请将此字段设置保留为缺省设置。
  8. Disable software packing of backup——缺省设置为 Yes;在备份系统时,请保留该设置。
  9. Backup extended attributes——缺省设置为 Yes。此选项将备份 rootvg 中所有扩展的属性。
  10. Number of blocks to write in a single output——此选项允许您指定要在备份媒体上写入的块数。请将此选项保留为空白,以便让系统选择该块数。

备份完成之后会有报表提示 OK 表示备份成功 , 如下,会有 /var/tmp 目录临时文件系统提示无法备份属于正常,备份之后smitlog 在根目录下smit.log 可以查看该文件便于查询故障,硬盘系统备份无法引导系统,需要配置NAM 才能做恢复测试


阅读(5592) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~