vxvm备份的恢复(急问)

zzsg
vxvm备份的恢复(急问)

系统是v1280双机,要克隆到另一套双机上,系统盘是用vxvm3.2做的镜像,客户用ufsdump做了个磁带备份,要restore到另一套机器的硬盘上。问题来了
客户作备份的时候直接dump /, /var和/oracle/client, vstab如下

#device        device        mount        FS        fsck        mount        mount
#to        mount        to        fsck                point                type        pass        at boot        options
#                       
#/dev/dsk/c1d0s2        /dev/rdsk/c1d0s2        /usr        ufs        1        yes        -
fd        -        /dev/fd        fd        -        no        -
/proc        -        /proc        proc        -        no        -
/dev/vx/dsk/swapvol        -        -        swap        -        no        -
/dev/vx/dsk/rootvol        /dev/vx/rdsk/rootvol        /        ufs        1        no        logging
/dev/vx/dsk/var        /dev/vx/rdsk/var        /var        ufs        1        no        logging
#/dev/dsk/c1t0d0s6        /dev/rdsk/c1t0d0s6        /globaldevices        ufs        2        yes        -
/dev/vx/dsk/client        /dev/vx/rdsk/client        /oracle/client        ufs        2        yes        logging
#nhgddbs01-nfs:/usr/sap/trans        -       /usr/sap/trans  nfs     -       yes        -
swap        -        /tmp        tmpfs        -        yes        -
#/dev/did/dsk/d2s6 /dev/did/rdsk/d2s6 /global/.devices/node@1 ufs 2 no global
/dev/vx/dsk/rootdisk_16vol        /dev/vx/rdsk/rootdisk_16vol        /global/.devices/node@1        ufs        2        no        global
#NOTE: volume rootvol (/) encapsulated partition c1t0d0s0
#NOTE: volume swapvol (swap) encapsulated partition c1t0d0s1
#NOTE: volume var (/var) encapsulated partition c1t0d0s5
#NOTE: volume rootdisk_16vol (/global/.devices/node@1) encapsulated partition c1t0d0s6
#NOTE: volume client (/oracle/client) encapsulated partition c1t0d0s7
#
这怎么restore啊,紧急求助中

zzsg
请教一下,这个方案行不行
1, 用explorer里面的prtvtoc给硬盘分区
2, restore磁带到vfstab相应分区里
3, 从cdrom启动,unencap vxvm里的rootvol

风之幻想
看看这个也许有帮助.

Symptom
How to use vxdump and vxrestore in a shell script



Resolution


A possible way to make a backup using vxdump and vxrestore is:

solaris1 # vxdump 0f - /testmount | (cd /testrestore ; vxrestore -yxf -)
vxfs vxdump: Date of this level 0 dump: Mon Sep 23 09:38:00 2002
vxfs vxdump: Date of last level 0 dump: the epoch
vxfs vxdump: Dumping /dev/vx/rdsk/testdg/testvol to stdout
vxfs vxdump: mapping (Pass I) [regular files]
vxfs vxdump: mapping (Pass II) [directories]
vxfs vxdump: estimated 114 blocks (57KB).
vxfs vxdump: dumping (Pass III) [directories]
vxfs vxdump: dumping (Pass IV) [regular files]
vxfs vxdump: vxdump: 51 tape blocks
vxfs vxdump: vxdump is done
UX:vxfs vxrestore: ERROR: cannot preserve extent attributes
UX:vxfs vxrestore: WARNING: warning: ./lost+found: File exists
set owner/mode for '.'? [yn] y
solaris1 #


The vxdump output is sent directly to 'stdout' (standard output). The standard output is piped into vxrestore
which reads from 'stdin' (standard input). This can be achieved by using the "-" option rather than
specifying a particular file to restore.

Example:
restore from "/tmp/dumpfile": vxrestore -yxf /tmp/dumpfile
restore from stdin: vxrestore -yxf -


The method using stdout/stdin is very efficient however it cannot be used inside  
a shell script. Looking at the last line of the vxrestore output we see that vxrestore expects
user input before it returns to the shell prompt.

set owner/mode for '.'? [yn] y

At this point vxrestore takes stdin control completely off the shell. Any attempt
to pipe or re-direct "y" into 'stdin' would have not effect. Here is an example:

solaris1 # echo y | (vxdump 0f - /testmount | (cd /testrestore ; vxrestore -yxf -))
vxfs vxdump: Date of this level 0 dump: Mon Sep 23 09:54:39 2002
vxfs vxdump: Date of last level 0 dump: the epoch
vxfs vxdump: Dumping /dev/vx/rdsk/testdg/testvol  to stdout
vxfs vxdump: mapping (Pass I) [regular files]
vxfs vxdump: mapping (Pass II) [directories]
vxfs vxdump: estimated 114 blocks (57KB).
vxfs vxdump: dumping (Pass III) [directories]
vxfs vxdump: dumping (Pass IV) [regular files]
vxfs vxdump: vxdump: 51 tape blocks
vxfs vxdump: vxdump is done
UX:vxfs vxrestore: ERROR: cannot preserve extent attributes
UX:vxfs vxrestore: WARNING: warning: ./lost+found: File exists
set owner/mode for '.'? [yn]

We see that vxrestore still expects the user to input "y" or "n".


What can be done to work around this ?

A possible workaround is using a temporary dump file:

solaris1 # vxdump 0f /tmp/dumpfile /testmount
vxfs vxdump: Date of this level 0 dump: Mon Sep 23 10:13:14 2002
vxfs vxdump: Date of last level 0 dump: the epoch
vxfs vxdump: Dumping /dev/vx/rdsk/testdg/testvol to /tmp/dumpfile
vxfs vxdump: mapping (Pass I) [regular files]
vxfs vxdump: mapping (Pass II) [directories]
vxfs vxdump: estimated 114 blocks (57KB).
vxfs vxdump: dumping (Pass III) [directories]
vxfs vxdump: dumping (Pass IV) [regular files]
vxfs vxdump: vxdump: 51 tape blocks on 1 volumes(s)
vxfs vxdump: Closing /tmp/dumpfile
vxfs vxdump: vxdump is done
solaris1 #

solaris1 # cd /testrestore ; vxrestore -e ignore -rf  /tmp/dumpfile
solaris1 #
(-e ignore is used here to suppress extend attribute warning messages - please see vxrestore main pages for details)

Although using vxrestore to read from /tmp/dumpfile is slower than reading from 'stdin'
it will not require any confirmation interactively. Therefore it can be used with a shell script.

The following commands can be used in a shell script. 'stdout' and 'stderr' messages are re-directed to files:

solaris1 # vxdump 0f /tmp/dumpfile /testmount >&2 2> /tmp/dumpmsg
solaris1 # cd /testrestore ; vxrestore -e ignore -rf  /tmp/dumpfile >&2 2> /tmp/restoremsg

Make sure there is sufficient disk space available for vxdump to write to. The procedure is suitable for
relatively small backups. As larger file system backups would require too much temporary disk space
alternative ways to automate backups (like VERITAS NetBackup (tm)) should be considered.


Note: All commands have been tested on Solaris 7 with Veritas File System (VxFS) 3.4 in a Korn Shell environment.

Note: Detailed information on how to use vxdump and vxrestore with their command line options can be found in the manual pages and in the "VERITAS File System 3.4 Administrator's Guide" for Solaris.

dreammaker
请问楼上:vxdump和ufsdump相比有什么区别?用它有什么额外的好处?