发新话题
打印

[原创] 从磁带中恢复文件,给大家参考( 此文章被查看:1297次,被回复:4篇!! )

从磁带中恢复文件,给大家参考

下面是从磁带中恢复一个文件的操作示例,是我MV同事教我的。中文是我加的注释。
此文目的,一个是给大家参考,更重要的我是个健忘的人,留下备查。

有不对的地方告诉我为谢。



login the szdev1 (登录相应到服务器
%su - (切换到根用户
#  cd /export3   (切换到目标盘)
# ls
NB_cat_bck        TT_DB             home              lost+found        viewstore         z.szdev1.export3
# mkdir temp2007  (建立临时存放文件夹,目的让文件是先放在临时目录,再移到实际的目录
# cd temp2007 (切换到临时文件夹,从磁带恢复的文件将以此文件夹作存放的启始目录)
# ls
# mt -f /dev/rmt/0cb status  (检查磁带机状态)
HP Ultrium LTO 3 tape drive:
   sense key(0x0)= No Additional Sense   residual= 0   retries= 0
   file no= 0   block no= 0
# ps -ef | grep ufs (查看ufs进程运行情况)
    root  3863  3735  0 08:48:17 pts/7    0:00 grep ufs
# mt -f /dev/rmt/0cb rew (倒带)
# cat /dev/rmt/0cb (列出磁带机上的文件集)
...
===========================================================
(file-set) (host:/disk)  (Device name)         (Disk-Use)
...
#7      szdev1:/export3 /dev/dsk/c1t3d0s6        6/70GB
...
===========================================================
# mt -f /dev/rmt/0cbn fsf 7 (转到文件集7)
# ufsrestore -if /dev/rmt/0cbn (进入互动恢复程序 ufsrestore)
ufsrestore > ?  (查看能使用的命令
Available commands are:
        ls [arg] - list directory
        marked [arg] - list items marked for extraction from directory
        cd arg - change directory
        pwd - print current directory
        add [arg] - add `arg' to list of files to be extracted
        delete [arg] - delete `arg' from list of files to be extracted
        extract - extract requested files
        setmodes - set modes of requested directories
        quit - immediately exit program
        what - list dump header information
        verbose - toggle verbose flag (useful with ``ls'')
        paginate - toggle pagination flag (affects ``ls'' and ``marked'')
        setpager - set pagination command and arguments
        help or `?' - print this list
If no `arg' is supplied, the current directory is used
ufsrestore >ls (查看当前目录下的文件)
ufsrestore > add aifl2.doc (假若要恢复文件aifl2.doc,先加到列表)
ufsrestore >ls (文件前面带*表示要恢复)
ufsrestore > extract aif12.doc (恢复文件aifl2.doc )
You have not read any volumes yet.
Unless you know which volume your file(s) are on you should start
with the last volume and work towards the first.
Specify next volume #: 1  (磁带号,只有一个磁带,所以选1)
set owner/mode for '.'? [yn] y (当前目录设置
ufsrestore > quit (退出恢复程序 ufsrestore)
# mt -f /dev/rmt/0cb rew (倒带)
# pwd
/export3/temp2007
#  ls  
aifl2.doc  (文件已恢复到硬盘上临时目录中了)
#

[ 本帖最后由 sheng2006 于 2007-1-5 12:14 编辑 ]
本帖最近评分记录
  • among 金钱 +6 2007-1-5 14:52



© 本文为 sheng2006SCMLife 共同所有,未经同意,请勿转载 ©如该文侵犯了您的版权,请联系管理员

TOP

谢谢LZ,这个功能还没有用过,以后好好研究了!



© 本文为 tuohzSCMLife 共同所有,未经同意,请勿转载 ©如该文侵犯了您的版权,请联系管理员

TOP

请问这个是在什么操作系统下使用的?



© 本文为 梦尘SCMLife 共同所有,未经同意,请勿转载 ©如该文侵犯了您的版权,请联系管理员
不见面,
不代表不思念;
不联络,
是为了掩饰深深的眷恋......

TOP

回复 #3 梦尘 的帖子

solaris

在unix下都可以的。

© 本文为 sheng2006 所有,未经同意,请勿转载
©如该文侵犯了您的版权,请联系管理员

TOP

一般这个地方我们选n

Specify next volume #: 1  (磁带号,只有一个磁带,所以选1)
set owner/mode for '.'? [yn] y (当前目录设置)


因为如果你有acl设定过权限,如果回答y,权限将会丢掉

我给大家写个redhat下hp磁带机命令
(dump命令存储需要用restore恢复)
mt -f /dev/nst0 rewind 倒带在最前
mt -f /dev/nst0 fsf n (fsf指前走到第n个分区)
restore -if /dev/nst0(读到磁带机里面去)
后面恢复跟楼住的差不多
一般写好脚本用crontab来定时备份

© 本文为 yunyun123 所有,未经同意,请勿转载
©如该文侵犯了您的版权,请联系管理员
我后悔带着痛觉来到这个世界

TOP

发新话题