洞察纵观鸿蒙next版本,如何凭借FinClip加强小程序的跨平台管理,确保企业在数字化转型中的高效运营和数据安全?
1042
2022-09-23
nbu UNIX/LINUX平台下面(mtx/robtest/tar)手动测试driver是否正常
相信大家在安装NBU之前都会在操作系统上面测试driver是否正常,也有可以在备份的时候报driver错误,想在系统上面测试一下driver是否正常,不同厂商的带库有各自自己的命令来测试。这里我介绍的是一种通用的方法,不同什么厂商的都可以使用。
方案一:使用mtx和tar命令来测试。
方案二:使用robtest和tar命令来测试。
方案一:
这里的测试环境是linux,如果在solaris等其它操作系统,请安装mtx软件,默认是不安装的。
1.1 查看有那些设备 [root@nbu71 ~]# lsscsi -g [0:0:0:0] disk ATA VBOX HARDDISK 1.0 /dev/sda /dev/sg0 [1:0:0:0] disk ATA VBOX HARDDISK 1.0 /dev/sdb /dev/sg1 [2:0:0:0] mediumx STK L700 550V - /dev/sg4 [2:0:1:0] tape IBM ULT3580-TD5 550V /dev/st0 /dev/sg2 [2:0:2:0] tape IBM ULT3580-TD5 550V /dev/st1 /dev/sg3 [2:0:3:0] tape IBM ULT3580-TD4 550V /dev/st2 /dev/sg5 [2:0:4:0] tape IBM ULT3580-TD4 550V /dev/st3 /dev/sg6 [2:0:8:0] mediumx SPECTRA PYTHON 550V - /dev/sg11 [2:0:9:0] tape IBM ULT3580-TD4 550V /dev/st4 /dev/sg7 [2:0:10:0] tape IBM ULT3580-TD4 550V /dev/st5 /dev/sg8 [2:0:11:0] tape IBM ULT3580-TD4 550V /dev/st6 /dev/sg9 [2:0:12:0] tape IBM ULT3580-TD4 550V /dev/st7 /dev/sg10 1.2 查看机械手的状态 [root@nbu71 ~]# mtx -f /dev/sg4 status Storage Changer /dev/sg4:2 Drives, 39 Slots ( 0 Import/Export ) Data Transfer Element 0:Empty Data Transfer Element 1:Empty Storage Element 1:Full :VolumeTag=E01001L4 Storage Element 2:Full :VolumeTag=E01002L4 Storage Element 3:Full :VolumeTag=E01003L4 Storage Element 4:Full :VolumeTag=E01004L4 Storage Element 5:Full :VolumeTag=E01005L4 Storage Element 6:Full :VolumeTag=E01006L4 Storage Element 7:Full :VolumeTag=E01007L4 Storage Element 8:Full :VolumeTag=E01008L4 Storage Element 9:Full :VolumeTag=E01009L4 Storage Element 10:Full :VolumeTag=E01010L4 Storage Element 11:Full :VolumeTag=E01011L4 Storage Element 12:Full :VolumeTag=E01012L4 Storage Element 13:Full :VolumeTag=E01013L4 Storage Element 14:Full :VolumeTag=E01014L4 Storage Element 15:Full :VolumeTag=E01015L4 Storage Element 16:Full :VolumeTag=E01016L4 Storage Element 17:Full :VolumeTag=E01017L4 Storage Element 18:Full :VolumeTag=E01018L4 Storage Element 19:Full :VolumeTag=E01019L4 Storage Element 20:Full :VolumeTag=E01020L4 Storage Element 21:Empty Storage Element 22:Full :VolumeTag=CLN101L4 Storage Element 23:Full :VolumeTag=CLN102L5 Storage Element 24:Empty Storage Element 25:Empty Storage Element 26:Empty Storage Element 27:Empty Storage Element 28:Empty Storage Element 29:Empty Storage Element 30:Full :VolumeTag=F01030L5 Storage Element 31:Full :VolumeTag=F01031L5 Storage Element 32:Full :VolumeTag=F01032L5 Storage Element 33:Full :VolumeTag=F01033L5 Storage Element 34:Full :VolumeTag=F01034L5 Storage Element 35:Full :VolumeTag=F01035L5 Storage Element 36:Full :VolumeTag=F01036L5 Storage Element 37:Full :VolumeTag=F01037L5 Storage Element 38:Full :VolumeTag=F01038L5 Storage Element 39:Full :VolumeTag=F01039L5 1.3 把槽位20的磁带移动到driver 0上面 [root@nbu71 ~]# mtx -f /dev/sg4 load 20 0 [root@nbu71 ~]# lsscsi -g [0:0:0:0] disk ATA VBOX HARDDISK 1.0 /dev/sda /dev/sg0 [1:0:0:0] disk ATA VBOX HARDDISK 1.0 /dev/sdb /dev/sg1 [2:0:0:0] mediumx STK L700 550V - /dev/sg4 [2:0:1:0] tape IBM ULT3580-TD5 550V /dev/st0 /dev/sg2 [2:0:2:0] tape IBM ULT3580-TD5 550V /dev/st1 /dev/sg3 [2:0:3:0] tape IBM ULT3580-TD4 550V /dev/st2 /dev/sg5 [2:0:4:0] tape IBM ULT3580-TD4 550V /dev/st3 /dev/sg6 [2:0:8:0] mediumx SPECTRA PYTHON 550V - /dev/sg11 [2:0:9:0] tape IBM ULT3580-TD4 550V /dev/st4 /dev/sg7 [2:0:10:0] tape IBM ULT3580-TD4 550V /dev/st5 /dev/sg8 [2:0:11:0] tape IBM ULT3580-TD4 550V /dev/st6 /dev/sg9 [2:0:12:0] tape IBM ULT3580-TD4 550V /dev/st7 /dev/sg10 1.4 向driver 0写数据 [root@nbu71 ~]# tar -cvf /dev/st0 /etc/hosts tar: Removing leading `/' from member names /etc/hosts 1.5 查询数据是否已经成功 [root@nbu71 ~]# tar -tvf /dev/st0 -rw-r--r-- root/root 232 2012-10-13 14:19:05 etc/hosts 1.6 查看driver的状态 [root@nbu71 ~]# mtx -f /dev/st0 status mtx: Request Sense: Long Report=yes mtx: Request Sense: Valid Residual=no mtx: Request Sense: Error Code=0 (Unknown?!) mtx: Request Sense: Sense Key=No Sense mtx: Request Sense: FileMark=no mtx: Request Sense: EOM=no mtx: Request Sense: ILI=no mtx: Request Sense: Additional Sense Code = 00 mtx: Request Sense: Additional Sense Qualifier = 00 mtx: Request Sense: BPV=no mtx: Request Sense: Error in CDB=no mtx: Request Sense: SKSV=no INQUIRY command Failed
方案二:
要使用此方案有个前提条件,就是已经安装了NBU软件,并且已经配置了driver设备。
2.1 删除nbu71上面的所有设备 [root@nbu71 ~]# nbemmcmd -deletealldevices -machinetype master -machinename nbu71 NBEMMCMD, Version:7.1 Command completed successfully. 2.2 自动配置设备 [root@nbu71 ~]# tpautoconf -a TPAC60 - - - -1~-1~-1~-1 2 - - - 0 - - - - - - - 0 0 - - nbu71 4 - - 0 - - - - TPAC60 IBM.ULT3580-TD4.000 IBM~~~~~ULT3580-TD4~~~~~550V /dev/nst7 -1~-1~-1~-1 1 0 - - 0 3 - - - XYZZY_B4 - 5 0 0 nbu71 - nbu71 0 - - 0 - - - - TPAC60 IBM.ULT3580-TD4.001 IBM~~~~~ULT3580-TD4~~~~~550V /dev/nst6 -1~-1~-1~-1 1 0 - - 0 3 - - - XYZZY_B3 - 5 0 0 nbu71 - nbu71 0 - - 0 - - - - TPAC60 IBM.ULT3580-TD4.002 IBM~~~~~ULT3580-TD4~~~~~550V /dev/nst5 -1~-1~-1~-1 1 0 - - 0 3 - - - XYZZY_B2 - 5 0 0 nbu71 - nbu71 0 - - 0 - - - - TPAC60 IBM.ULT3580-TD4.003 IBM~~~~~ULT3580-TD4~~~~~550V /dev/nst4 -1~-1~-1~-1 1 0 - - 0 3 - - - XYZZY_B1 - 5 0 0 nbu71 - nbu71 0 - - 0 - - - - TPAC60 IBM.ULT3580-TD4.004 IBM~~~~~ULT3580-TD4~~~~~550V /dev/nst3 -1~-1~-1~-1 1 0 1 4 8 3 - - - XYZZY_A4 - 5 0 0 - - nbu71 0 - - 0 - - - - TPAC60 IBM.ULT3580-TD4.005 IBM~~~~~ULT3580-TD4~~~~~550V /dev/nst2 -1~-1~-1~-1 1 0 1 3 8 3 - - - XYZZY_A3 - 5 0 0 - - nbu71 0 - - 0 - - - - TPAC60 IBM.ULT3580-TD5.000 IBM~~~~~ULT3580-TD5~~~~~550V /dev/nst1 -1~-1~-1~-1 1 0 1 2 8 10 - - - XYZZY_A2 - 5 0 0 - - nbu71 0 - - 0 - - - - TPAC60 IBM.ULT3580-TD5.001 IBM~~~~~ULT3580-TD5~~~~~550V /dev/nst0 -1~-1~-1~-1 1 0 1 1 8 10 - - - XYZZY_A1 - 5 0 0 - - nbu71 0 - - 0 - - - - TPAC60 0 SPECTRA~PYTHON /dev/sg11 -1~-1~-1~-1 0 0 0 - 8 - 39 4 4 XYZZY_B - 5 0 - nbu71 nbu71 nbu71 0 - - 0 - - - - TPAC60 1 STK~~~~~L700 /dev/sg4 -1~-1~-1~-1 0 0 1 - 8 - 39 4 4 XYZZY_A - 5 0 - nbu71 nbu71 nbu71 0 - - 0 - - - - 2.3 查看已经配置的设备 [root@nbu71 ~]# tpconfig -l Device Robot Drive Robot Drive Device Second Type Num Index Type DrNum Status Comment Name Path Device Path robot 0 - TLD - - - - /dev/sg11 robot 1 - TLD - - - - /dev/sg4 drive - 4 hcart 4 UP - IBM.ULT3580-TD4.004 /dev/nst3 drive - 5 hcart 3 UP - IBM.ULT3580-TD4.005 /dev/nst2 drive - 6 hcart2 2 UP - IBM.ULT3580-TD5.000 /dev/nst1 drive - 7 hcart2 1 UP - IBM.ULT3580-TD5.001 /dev/nst0 drive - 0 hcart - UP - IBM.ULT3580-TD4.000 /dev/nst7 drive - 1 hcart - UP - IBM.ULT3580-TD4.001 /dev/nst6 drive - 2 hcart - UP - IBM.ULT3580-TD4.002 /dev/nst5 drive - 3 hcart - UP - IBM.ULT3580-TD4.003 /dev/nst4 Currently defined robotics are: TLD(0) robotic path = /dev/sg11 TLD(1) robotic path = /dev/sg4 EMM Server = nbu71 2.4 移到磁带到driver上面 [root@nbu71 ~]# robtest Configured robots with local control supporting test utilities: TLD(0) robotic path = /dev/sg11 TLD(1) robotic path = /dev/sg4 Robot Selection --------------- 1) TLD 0 2) TLD 1 3) none/quit Enter choice: 2 Robot selected: TLD(1) robotic path = /dev/sg4 Invoking robotic test utility: /usr/openv/volmgr/bin/tldtest -rn 1 -r /dev/sg4 Opening /dev/sg4 MODE_SENSE complete Enter tld commands (? returns help information) 查看driver状态 s d drive 1 (addr 1) access = 1 Contains Cartridge = yes Source address = 1043 (slot 20) Barcode = E01020L4 drive 2 (addr 2) access = 1 Contains Cartridge = no drive 3 (addr 3) access = 1 Contains Cartridge = no drive 4 (addr 4) access = 1 Contains Cartridge = no READ_ELEMENT_STATUS complete 查看磁带的状态 s s slot 1 (addr 1024) contains Cartridge = yes Source address = 34976 Barcode = E01001L4 slot 2 (addr 1025) contains Cartridge = yes Source address = 8320 Barcode = E01002L4 slot 3 (addr 1026) contains Cartridge = yes Barcode = E01003L4 slot 4 (addr 1027) contains Cartridge = yes Barcode = E01004L4 slot 5 (addr 1028) contains Cartridge = yes Barcode = E01005L4 slot 6 (addr 1029) contains Cartridge = yes Barcode = E01006L4 slot 7 (addr 1030) contains Cartridge = yes Barcode = E01007L4 slot 8 (addr 1031) contains Cartridge = yes Barcode = E01008L4 slot 9 (addr 1032) contains Cartridge = yes Barcode = E01009L4 slot 10 (addr 1033) contains Cartridge = yes Barcode = E01010L4 << Press return to continue, or q and return to stop >> q READ_ELEMENT_STATUS complete 移动槽位4上面的磁带到driver 2上面 m s4 d2 Initiating MOVE_MEDIUM from address 1027 to 2 MOVE_MEDIUM complete s s slot 1 (addr 1024) contains Cartridge = yes Source address = 34976 Barcode = E01001L4 slot 2 (addr 1025) contains Cartridge = yes Source address = 8320 Barcode = E01002L4 slot 3 (addr 1026) contains Cartridge = yes Barcode = E01003L4 slot 4 (addr 1027) contains Cartridge = no slot 5 (addr 1028) contains Cartridge = yes Barcode = E01005L4 slot 6 (addr 1029) contains Cartridge = yes Barcode = E01006L4 slot 7 (addr 1030) contains Cartridge = yes Barcode = E01007L4 slot 8 (addr 1031) contains Cartridge = yes Barcode = E01008L4 slot 9 (addr 1032) contains Cartridge = yes Barcode = E01009L4 slot 10 (addr 1033) contains Cartridge = yes Barcode = E01010L4 << Press return to continue, or q and return to stop >> q READ_ELEMENT_STATUS complete 已经看到driver 2上面有磁带了 s d drive 1 (addr 1) access = 1 Contains Cartridge = yes Source address = 1043 (slot 20) Barcode = E01020L4 drive 2 (addr 2) access = 1 Contains Cartridge = yes Source address = 1027 (slot 4) Barcode = E01004L4 drive 3 (addr 3) access = 1 Contains Cartridge = no drive 4 (addr 4) access = 1 Contains Cartridge = no READ_ELEMENT_STATUS complete quit Robot Selection --------------- 1) TLD 0 2) TLD 1 3) none/quit Enter choice: 2.5 用mtx查看一下状态 [root@nbu71 ~]# mtx -f /dev/sg4 status Storage Changer /dev/sg4:4 Drives, 43 Slots ( 4 Import/Export ) Data Transfer Element 0:Full (Storage Element 20 Loaded):VolumeTag = E01020L4 Data Transfer Element 1:Full (Storage Element 4 Loaded):VolumeTag = E01004L4 Data Transfer Element 2:Empty Data Transfer Element 3:Empty Storage Element 1:Full :VolumeTag=E01001L4 Storage Element 2:Full :VolumeTag=E01002L4 Storage Element 3:Full :VolumeTag=E01003L4 Storage Element 4:Empty Storage Element 5:Full :VolumeTag=E01005L4 Storage Element 6:Full :VolumeTag=E01006L4 Storage Element 7:Full :VolumeTag=E01007L4 Storage Element 8:Full :VolumeTag=E01008L4 Storage Element 9:Full :VolumeTag=E01009L4 Storage Element 10:Full :VolumeTag=E01010L4 Storage Element 11:Full :VolumeTag=E01011L4 Storage Element 12:Full :VolumeTag=E01012L4 Storage Element 13:Full :VolumeTag=E01013L4 Storage Element 14:Full :VolumeTag=E01014L4 2.6 查看设备 [root@nbu71 ~]# lsscsi -g [0:0:0:0] disk ATA VBOX HARDDISK 1.0 /dev/sda /dev/sg0 [1:0:0:0] disk ATA VBOX HARDDISK 1.0 /dev/sdb /dev/sg1 [2:0:0:0] mediumx STK L700 550V - /dev/sg4 [2:0:1:0] tape IBM ULT3580-TD5 550V /dev/st0 /dev/sg2 [2:0:2:0] tape IBM ULT3580-TD5 550V /dev/st1 /dev/sg3 [2:0:3:0] tape IBM ULT3580-TD4 550V /dev/st2 /dev/sg5 [2:0:4:0] tape IBM ULT3580-TD4 550V /dev/st3 /dev/sg6 [2:0:8:0] mediumx SPECTRA PYTHON 550V - /dev/sg11 [2:0:9:0] tape IBM ULT3580-TD4 550V /dev/st4 /dev/sg7 [2:0:10:0] tape IBM ULT3580-TD4 550V /dev/st5 /dev/sg8 [2:0:11:0] tape IBM ULT3580-TD4 550V /dev/st6 /dev/sg9 [2:0:12:0] tape IBM ULT3580-TD4 550V /dev/st7 /dev/sg10 2.8 备份测试 [root@nbu71 ~]# tar -cvf /dev/st1 /etc/hosts tar: Removing leading `/' from member names /etc/hosts 2.9 查看是否已经备份成功 [root@nbu71 ~]# tar -tvf /dev/st1 -rw-r--r-- root/root 232 2012-10-13 14:19:05 etc/hosts
版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。
发表评论
暂时没有评论,来抢沙发吧~