本文利用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.0Kdrwxr-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 lbinfolrwxrwxrwx 1 root root 8 Oct 21 11:38 mt0 -> /dev/sg2lrwxrwxrwx 1 root root 8 Oct 21 11:38 mt1 -> /dev/sg3lrwxrwxrwx 1 root root 8 Oct 21 11:38 mt2 -> /dev/sg4lrwxrwxrwx 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=notsm: 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以及pathtsm: TSMSRV>def driv sl500 dr1 onl=yes elem=500tsm: TSMSRV>def driv sl500 dr2 onl=yes elem=501tsm: TSMSRV>def driv sl500 dr3 onl=yes elem=502tsm: TSMSRV>def driv sl500 dr4 onl=yes elem=503tsm: 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/mt1tsm: 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 libvSession 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:04Library Name Volume Name Status Owner Last Use Home Device Element Type ------------ ----------- ---------------- ---------- --------- ------- ------SL500 G03001TZ Scratch 1,000 ECART- RIDGESL500 G03002TZ Scratch 1,001 ECART- RIDGESL500 G03003TZ Scratch 1,002 ECART- RIDGESL500 G03004TZ Scratch 1,003 ECART- RIDGESL500 G03005TZ Scratch 1,004 ECART- RIDGESL500 G03006TZ Scratch 1,005 ECART- RIDGESL500 G03007TZ Scratch 1,006 ECART- RIDGESL500 G03008TZ Scratch 1,007 ECART- RIDGESL500 G03009TZ Scratch 1,008 ECART- RIDGESL500 G03010TZ Scratch 1,009 ECART- RIDGESL500 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 devDevice Device Storage Device Format Est/Max MountClass Access Pool Type Capacity LimitName 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