本文利用mhvtl虚拟带库以及tsm软件,搭建备份恢复测试环境,供初学者参考!
虚拟带库的设置
[root@tsmsrv ~]# lsscsi -g [2:0:0:0] disk VMware, VMware Virtual S 1.0 /dev/sda /dev/sg0 [3:0:0:0] cd/dvd NECVMWar VMware SATA CD00 1.00 /dev/sr0 /dev/sg1 [33:0:8:0] mediumx STK SL500 0105 /dev/sch0 /dev/sg6 [33:0:9:0] tape STK 9840 0105 - /dev/sg2 [33:0:10:0] tape STK 9840 0105 - /dev/sg3 [33:0:11:0] tape STK 9840 0105 - /dev/sg4 [33:0:12:0] tape STK 9840 0105 - /dev/sg5
编辑mhvtl.conf文件,将磁带的容量调整为20G。 [root@tsmsrv ~]# cat /etc/mhvtl/mhvtl.conf .......... # Default media capacity (500 M) CAPACITY=20480
运行/opt/tivoli/tsm/devices/bin/autoconf -a命令,会产生如下文件:
[root@tsmsrv ~]# la /dev/tsmscsi/ total 8.0K drwxr-xr-x 2 root root 180 Oct 21 11:38 . drwxr-xr-x 19 root root 4.4K Oct 21 11:38 .. lrwxrwxrwx 1 root root 8 Oct 21 11:38 lb0 -> /dev/sg6 -rw-r--r-- 1 root root 173 Oct 21 11:38 lbinfo lrwxrwxrwx 1 root root 8 Oct 21 11:38 mt0 -> /dev/sg2 lrwxrwxrwx 1 root root 8 Oct 21 11:38 mt1 -> /dev/sg3 lrwxrwxrwx 1 root root 8 Oct 21 11:38 mt2 -> /dev/sg4 lrwxrwxrwx 1 root root 8 Oct 21 11:38 mt3 -> /dev/sg5 -rw-r--r-- 1 root root 442 Oct 21 11:38 mtinfo
在linux下面,定义带库的时候,必须指定其位于/dev/tsmscsi下的路径。
TSM中定义带库
//定义虚拟带库 tsm: TSMSRV>def libr sl500 libt=scsi shared=no tsm: TSMSRV>def path tsmsrv sl500 srct=server desttype=library device=/dev/tsmscsi/lb0 online=yes
//获取driver的element号 tsm: TSMSRV>show slots sl500 ............. Device : /dev/tsmscsi/lb0 Drive 0, element 500 Drive 1, element 501 Drive 2, element 502 Drive 3, element 503 .............
//定义driver以及path tsm: TSMSRV>def driv sl500 dr1 onl=yes elem=500 tsm: TSMSRV>def driv sl500 dr2 onl=yes elem=501 tsm: TSMSRV>def driv sl500 dr3 onl=yes elem=502 tsm: TSMSRV>def driv sl500 dr4 onl=yes elem=503 tsm: TSMSRV>def path tsmsrv dr1 srct=server destt=dr libr=sl500 device=/dev/tsmscsi/mt0 tsm: TSMSRV>def path tsmsrv dr2 srct=server destt=dr libr=sl500 device=/dev/tsmscsi/mt1 tsm: TSMSRV>def path tsmsrv dr3 srct=server destt=dr libr=sl500 device=/dev/tsmscsi/mt2 tsm: TSMSRV>def path tsmsrv dr4 srct=server destt=dr libr=sl500 device=/dev/tsmscsi/mt3
//label磁带 tsm: TSMSRV>label libv sl500 search=yes labels=barcode checkin=scr overwrite=yes waittime=0
//定义设备类 tsm: TSMSRV>def devc estcdev libr=sl500 devt=ecart format=9840 estcap=20G mountl=drives
//查询磁带状态 tsm: TSMSRV>q libv Session established with server TSMSRV: Linux/x86_64 Server Version 6, Release 3, Level 5.0 Server date/time: 10/21/2014 12:00:34 Last access: 10/21/2014 11:39:04 Library Name Volume Name Status Owner Last Use Home Device Element Type ------------ ----------- ---------------- ---------- --------- ------- ------ SL500 G03001TZ Scratch 1,000 ECART- RIDGE SL500 G03002TZ Scratch 1,001 ECART- RIDGE SL500 G03003TZ Scratch 1,002 ECART- RIDGE SL500 G03004TZ Scratch 1,003 ECART- RIDGE SL500 G03005TZ Scratch 1,004 ECART- RIDGE SL500 G03006TZ Scratch 1,005 ECART- RIDGE SL500 G03007TZ Scratch 1,006 ECART- RIDGE SL500 G03008TZ Scratch 1,007 ECART- RIDGE SL500 G03009TZ Scratch 1,008 ECART- RIDGE SL500 G03010TZ Scratch 1,009 ECART- RIDGE SL500 G03011TZ Scratch 1,010 ECART- RIDGE ........................ //status:如果磁带状态为scratch表明是空白带(临时带),如果状态为private,表明已经被使用 (专用带)。 //LateUse: 磁带使用状态,Data说明该磁带是数据带,DbBackup表明该磁带是TSM自身DB的备份带。
//检入清洗带 tsm: TSMSRV>checkin libv sl500 search=yes status=cleaner checklabel=barcode cleanings=30 //驱动器处理50G数据后,清洁驱动器 tsm: TSMSRV>update drive sl500 dr1 cleanfrequency=50
//查询设备类 tsm: TSMSRV>q dev Device Device Storage Device Format Est/Max Mount Class Access Pool Type Capacity Limit Name Strategy Count (MB) --------- ---------- ------- --------- ------ -------- ------ DISK Random 3 ESTCDEV Sequential 0 ECARTRID- 9840 20,480.0 DRIVES GE TSMDBFILE Sequential 0 FILE DRIVE 1,024.0 1
本文出自 “candon123” 博客,谢绝转载!