admin 管理员组

文章数量: 1184232

make_tape_recovery 是HP-UNIX Ignite-UX软件中的一个命令,专门用来实现HP-UNIX系统的备份恢复。要想使用这个命令,必须先安装Ignite软件。

下载链接:

1、首先确认磁带机设备正常,并且磁带状态正常。可以查看

2、如果ioscan 扫描出来的设备是/dev/rmt/0mn,用make_tape_recovery -Av 就能备份vg00卷组的内容到磁带,如果扫描出来的设备不是/dev/rmt/0mn,就要指定备份的磁带路径,make_tape_recovery -Av -a /dev/rmt/5mn 。

dmswas01:/>ioscan -fnCtape
Class     I  H/W Path     Driver S/W State   H/W Type     Description
=====================================================================
tape      5  0/2/1/1.4.0  stape   CLAIMED     DEVICE       HP      C7438A
                         /dev/rmt/5m            /dev/rmt/5mn           /dev/rmt/c2t4d0BEST    /dev/rmt/c2t4d0BESTn 
                         /dev/rmt/5mb           /dev/rmt/5mnb          /dev/rmt/c2t4d0BESTb   /dev/rmt/c2t4d0BESTnb
dmswas01:/>make_tape_recovery -Av -a /dev/rmt/5mn 
       * Creating local directories for configuration files and archive.
=======  11/15/12 16:33:02 EAT  Started make_tape_recovery. (Thu Nov 15 
         16:33:02 EAT 2012)
         @(#)Ignite-UX Revision C.7.5.142
         @(#)ignite/net_recovery (opt) Revision: 
         /branches/IUX_RA0803/ignite/src@72866 Last Modified: 2008-02-06 
         15:49:50 -0700 (Wed, 06 Feb 2008)
       * Testing for necessary pax patch.
       * Recovery Archive Description = Recovery Archive
         
       * Recovery Archive Location    = /dev/rmt/5mn
         
       * Number of Archives to Save   = 2
         
       * Pax type  = tar
         
WARNING: Filesystem /webroot/hmgc/uploadbak is not mounted.  It will be 
         ignored.
        
        In?     dsk/vg  name                    minor#  Associated disks/mountpoints
        2       v       /dev/vg00               0x00    /dev/disk/disk1_p2 
                                                /dev/vg00/lvol1 /stand  2
                                                /dev/vg00/lvol2
                                                /dev/vg00/lvol3 /       2
                                                /dev/vg00/lvol4 /tmp    2
                                                /dev/vg00/lvol5 /home   2
                                                /dev/vg00/lvol6 /opt    2
                                                /dev/vg00/lvol7 /usr    2
                                                /dev/vg00/lvol8 /var    2
                                                /dev/vg00/was_lv        /was    2
                                                /dev/vg00/gdms_lv       /webroot/hmgc/upload110903      2
                                                /dev/vg00/wasapp_lv     /wasapp 2
                                                /dev/vg00/logfs_lv      /logfs/hmgc     2
        0       v       /dev/vgwebroot          0x03    /dev/dsk/c4t0d1 /dev/dsk/c6t0d1 /dev/dsk/c8t0d1 /dev/dsk/c10t0d1 
                                                /dev/vgwebroot/webroot_lv
                                                /dev/vgwebroot/lv_webroot       /webroot/hmgc/upload    0
        0       v       /dev/vg02               0x01    /dev/dsk/c0t1d0 
        ** 0 - The Volume Group or Filesystem is Not included in the
               System Recovery Archive
        ** 1 - The Volume Group or Filesystem is Partially included in the
               System Recovery Archive
        ** 2 - The Volume Group or Filesystem is Fully included in the
               System Recovery Archive
       * Checking Versions of Ignite-UX filesets
       * Scanning system for IO devices...
       * Boot device is: 0/1/1/0.0xa04b793191b494b.0x0
       * Creating System Configuration.
       * /opt/ignite/bin/save_config -f 
         /var/opt/ignite/recovery/2012-11-15,16:33/system_cfg vg00
       * Backing Up Volume Group /dev/vg00
       * /usr/sbin/vgcfgbackup /dev/vg00
       * Creating Map Files for Volume Group /dev/vg00
       * /usr/sbin/vgexport -s -p -m /etc/lvmconf/vg00.mapfile /dev/vg00
       * Backing Up Volume Group /dev/vgwebroot
       * /usr/sbin/vgcfgbackup /dev/vgwebroot
       * Creating Map Files for Volume Group /dev/vgwebroot
       * /usr/sbin/vgexport -s -p -m /etc/lvmconf/vgwebroot.mapfile 
         /dev/vgwebroot
       * Backing Up Volume Group /dev/vg02
       * /usr/sbin/vgcfgbackup /dev/vg02
       * Creating Map Files for Volume Group /dev/vg02
       * /usr/sbin/vgexport -s -p -m /etc/lvmconf/vg02.mapfile /dev/vg02

默认备份vg00,备份信息中,2代表备份的,0代表不备份的

3、 make_tape_recovery命令详解

下面的类容主要来自 make_tape_recovery man page:

make_tape_recovery 包含下列选项:
-a tape_drive
执行tape设备的路径,用于系统备份,默认的传统设备路径是dev/rmt/0mn,除非系统中存在
/var/opt/ignite/recovery/default文件。在HP-UX 11i v3版本中,当传统模式设备被禁用时,你可以用-a选项灵活的指定
备份设备。
-A 这个选项决定哪个disk或者哪个卷组需要备份,默认是vg00。
-b 结合-i选项使用,当交互窗口完成后使make_tape_recovery命令在后台执行
-m tar|cpio|pax
具体指定备份时使用tar、pax还是cpio命令进行备份,默认是tar命令。
-v 显示备份时进程执行的信息,报错备份的卷组和磁盘信息。
-x include=file|directory
指定备份的文件或者目录,不要使用文件系统目录,文件名称不要以空格结束
-x inc_cross=file|directory
指定备份的文件系统目录,只能备份本地系统文件,nfs共享的文件系统是不能备份的,文件名称不要以空格结束。
-x inc_entire=disk|vg_name
指定备份的磁盘或者卷组名称,使用块设备名称,eg:/dev/dsk/c0t5d0,vg00。
-x exclude=file|directory
指定不需要备份的文件或目录,如果一个文件系统没有mount,但是在配置文件/etc/fstab中有记录,在备份信息中
会提示文件系统没有mount,这个目录将被忽略。

注意事项:

1、没有必要的文件或目录被排除在外。排除的重要文件或目录将被忽略
2、排除优先于包含,如果一个目录同时在排除和包含之中,那么这个目录是不会被备份的。
3、在默认文件中包含和排除的排序是不显示的.
4、文件名称不要包含空格.
5、通过nfs或者LOFS共享的文件或者目录是不能备份的。

4、使用磁带来恢复失败的系统或者卷组,步骤如下:
4.1、将系统恢复的磁带插入到磁带设备中
4.2、启动系统
4.3、将系统设置从磁带设备启动
4.4、选择不与ISL交互,并允许安装进程自动完成。
5、使用磁带克隆一个系统:
如果想要使用磁带克隆一个系统到另外一个系统,最好是使用-i选项来运行make_tape_recovery命令。
这样会允许你在备份时通过交互界面来修改必须要的信息,例如磁盘信息,主机名称,备份格式,IP地址等),
如果没有使用-i选项,在进行恢复时,自动安装会在10s后停止。下面介绍详细情况:
当克隆系统时,修改网络参数是非常重要的,这样会避免造成网络冲突,你必须在安装时使用交互界面来修改:
5.1、将系统恢复的磁带插入到磁带设备中
5.2、启动系统,将系统设置从磁带设备启动
5.3、在出现下面提示信息的时候按下返回键结束非交互的安装模式

本文标签: 备份 编程 指定备份