相信大家在安装NBU之前都会在操作系统上面测试driver是否正常,也有可以在备份的时候报driver错误,想在系统上面测试一下driver是否正常,不同厂商的带库有各自自己的命令来测试。这里我介绍的是一种通用的方法,不同什么厂商的都可以使用。

    方案一:使用mtx和tar命令来测试。

    方案二:使用robtest和tar命令来测试。

 

方案一:

这里的测试环境是linux,如果在solaris等其它操作系统,请安装mtx软件,默认是不安装的。

 
  
  1. 1.1 查看有那些设备 
  2. [root@nbu71 ~]# lsscsi -g 
  3. [0:0:0:0]    disk    ATA      VBOX HARDDISK    1.0   /dev/sda  /dev/sg0 
  4. [1:0:0:0]    disk    ATA      VBOX HARDDISK    1.0   /dev/sdb  /dev/sg1 
  5. [2:0:0:0]    mediumx STK      L700             550V  -         /dev/sg4 
  6. [2:0:1:0]    tape    IBM      ULT3580-TD5      550V  /dev/st0  /dev/sg2 
  7. [2:0:2:0]    tape    IBM      ULT3580-TD5      550V  /dev/st1  /dev/sg3 
  8. [2:0:3:0]    tape    IBM      ULT3580-TD4      550V  /dev/st2  /dev/sg5 
  9. [2:0:4:0]    tape    IBM      ULT3580-TD4      550V  /dev/st3  /dev/sg6 
  10. [2:0:8:0]    mediumx SPECTRA  PYTHON           550V  -         /dev/sg11 
  11. [2:0:9:0]    tape    IBM      ULT3580-TD4      550V  /dev/st4  /dev/sg7 
  12. [2:0:10:0]   tape    IBM      ULT3580-TD4      550V  /dev/st5  /dev/sg8 
  13. [2:0:11:0]   tape    IBM      ULT3580-TD4      550V  /dev/st6  /dev/sg9 
  14. [2:0:12:0]   tape    IBM      ULT3580-TD4      550V  /dev/st7  /dev/sg10 
  15. 1.2 查看机械手的状态 
  16. [root@nbu71 ~]# mtx -f /dev/sg4 status 
  17.   Storage Changer /dev/sg4:2 Drives, 39 Slots ( 0 Import/Export ) 
  18. Data Transfer Element 0:Empty 
  19. Data Transfer Element 1:Empty 
  20.       Storage Element 1:Full :VolumeTag=E01001L4                             
  21.       Storage Element 2:Full :VolumeTag=E01002L4                             
  22.       Storage Element 3:Full :VolumeTag=E01003L4                             
  23.       Storage Element 4:Full :VolumeTag=E01004L4                             
  24.       Storage Element 5:Full :VolumeTag=E01005L4                             
  25.       Storage Element 6:Full :VolumeTag=E01006L4                             
  26.       Storage Element 7:Full :VolumeTag=E01007L4                             
  27.       Storage Element 8:Full :VolumeTag=E01008L4                             
  28.       Storage Element 9:Full :VolumeTag=E01009L4                             
  29.       Storage Element 10:Full :VolumeTag=E01010L4                             
  30.       Storage Element 11:Full :VolumeTag=E01011L4                             
  31.       Storage Element 12:Full :VolumeTag=E01012L4                             
  32.       Storage Element 13:Full :VolumeTag=E01013L4                             
  33.       Storage Element 14:Full :VolumeTag=E01014L4                             
  34.       Storage Element 15:Full :VolumeTag=E01015L4                             
  35.       Storage Element 16:Full :VolumeTag=E01016L4                             
  36.       Storage Element 17:Full :VolumeTag=E01017L4                             
  37.       Storage Element 18:Full :VolumeTag=E01018L4                             
  38.       Storage Element 19:Full :VolumeTag=E01019L4                             
  39.       Storage Element 20:Full :VolumeTag=E01020L4                             
  40.       Storage Element 21:Empty 
  41.       Storage Element 22:Full :VolumeTag=CLN101L4                             
  42.       Storage Element 23:Full :VolumeTag=CLN102L5                             
  43.       Storage Element 24:Empty 
  44.       Storage Element 25:Empty 
  45.       Storage Element 26:Empty 
  46.       Storage Element 27:Empty 
  47.       Storage Element 28:Empty 
  48.       Storage Element 29:Empty 
  49.       Storage Element 30:Full :VolumeTag=F01030L5                             
  50.       Storage Element 31:Full :VolumeTag=F01031L5                             
  51.       Storage Element 32:Full :VolumeTag=F01032L5                             
  52.       Storage Element 33:Full :VolumeTag=F01033L5                             
  53.       Storage Element 34:Full :VolumeTag=F01034L5                             
  54.       Storage Element 35:Full :VolumeTag=F01035L5                             
  55.       Storage Element 36:Full :VolumeTag=F01036L5                             
  56.       Storage Element 37:Full :VolumeTag=F01037L5                             
  57.       Storage Element 38:Full :VolumeTag=F01038L5                             
  58.       Storage Element 39:Full :VolumeTag=F01039L5                             
  59. 1.3 把槽位20的磁带移动到driver 0上面 
  60. [root@nbu71 ~]# mtx -f /dev/sg4 load 20 0 
  61. [root@nbu71 ~]# lsscsi -g 
  62. [0:0:0:0]    disk    ATA      VBOX HARDDISK    1.0   /dev/sda  /dev/sg0 
  63. [1:0:0:0]    disk    ATA      VBOX HARDDISK    1.0   /dev/sdb  /dev/sg1 
  64. [2:0:0:0]    mediumx STK      L700             550V  -         /dev/sg4 
  65. [2:0:1:0]    tape    IBM      ULT3580-TD5      550V  /dev/st0  /dev/sg2 
  66. [2:0:2:0]    tape    IBM      ULT3580-TD5      550V  /dev/st1  /dev/sg3 
  67. [2:0:3:0]    tape    IBM      ULT3580-TD4      550V  /dev/st2  /dev/sg5 
  68. [2:0:4:0]    tape    IBM      ULT3580-TD4      550V  /dev/st3  /dev/sg6 
  69. [2:0:8:0]    mediumx SPECTRA  PYTHON           550V  -         /dev/sg11 
  70. [2:0:9:0]    tape    IBM      ULT3580-TD4      550V  /dev/st4  /dev/sg7 
  71. [2:0:10:0]   tape    IBM      ULT3580-TD4      550V  /dev/st5  /dev/sg8 
  72. [2:0:11:0]   tape    IBM      ULT3580-TD4      550V  /dev/st6  /dev/sg9 
  73. [2:0:12:0]   tape    IBM      ULT3580-TD4      550V  /dev/st7  /dev/sg10 
  74. 1.4 向driver 0写数据 
  75. [root@nbu71 ~]# tar -cvf /dev/st0 /etc/hosts 
  76. tar: Removing leading `/' from member names 
  77. /etc/hosts 
  78. 1.5 查询数据是否已经成功 
  79. [root@nbu71 ~]# tar -tvf /dev/st0 
  80. -rw-r--r-- root/root       232 2012-10-13 14:19:05 etc/hosts 
  81. 1.6 查看driver的状态 
  82. [root@nbu71 ~]# mtx -f /dev/st0 status 
  83. mtx: Request Sense: Long Report=yes 
  84. mtx: Request Sense: Valid Residual=no 
  85. mtx: Request Sense: Error Code=0 (Unknown?!) 
  86. mtx: Request Sense: Sense Key=No Sense 
  87. mtx: Request Sense: FileMark=no 
  88. mtx: Request Sense: EOM=no 
  89. mtx: Request Sense: ILI=no 
  90. mtx: Request Sense: Additional Sense Code = 00 
  91. mtx: Request Sense: Additional Sense Qualifier = 00 
  92. mtx: Request Sense: BPV=no 
  93. mtx: Request Sense: Error in CDB=no 
  94. mtx: Request Sense: SKSV=no 
  95. INQUIRY command Failed 

方案二:

   要使用此方案有个前提条件,就是已经安装了NBU软件,并且已经配置了driver设备。

 
  
  1. 2.1 删除nbu71上面的所有设备 
  2. [root@nbu71 ~]# nbemmcmd -deletealldevices  -machinetype master -machinename nbu71 
  3. NBEMMCMD, Version:7.1 
  4. Command completed successfully. 
  5. 2.2 自动配置设备 
  6. [root@nbu71 ~]# tpautoconf  -a 
  7. TPAC60 - - - -1~-1~-1~-1 2 - - - 0 - - - - - - - 0 0 - - nbu71 4 - - 0 - - - - 
  8.  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 - - - - 
  9.  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 - - - - 
  10.  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 - - - - 
  11.  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 - - - - 
  12.  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 - - - - 
  13.  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 - - - - 
  14.  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 - - - - 
  15.  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 - - - - 
  16.  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 - - - - 
  17.  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 - - - - 
  18. 2.3 查看已经配置的设备 
  19. [root@nbu71 ~]# tpconfig -l 
  20. Device Robot Drive       Robot                    Drive                Device     Second 
  21. Type     Num Index  Type DrNum Status  Comment    Name                 Path       Device Path 
  22. robot      0    -    TLD    -       -  -          -                    /dev/sg11 
  23. robot      1    -    TLD    -       -  -          -                    /dev/sg4 
  24.   drive    -    4  hcart    4      UP  -          IBM.ULT3580-TD4.004  /dev/nst3 
  25.   drive    -    5  hcart    3      UP  -          IBM.ULT3580-TD4.005  /dev/nst2 
  26.   drive    -    6 hcart2    2      UP  -          IBM.ULT3580-TD5.000  /dev/nst1 
  27.   drive    -    7 hcart2    1      UP  -          IBM.ULT3580-TD5.001  /dev/nst0 
  28. drive      -    0  hcart    -      UP  -          IBM.ULT3580-TD4.000  /dev/nst7 
  29. drive      -    1  hcart    -      UP  -          IBM.ULT3580-TD4.001  /dev/nst6 
  30. drive      -    2  hcart    -      UP  -          IBM.ULT3580-TD4.002  /dev/nst5 
  31. drive      -    3  hcart    -      UP  -          IBM.ULT3580-TD4.003  /dev/nst4 
  32.  
  33.  
  34. Currently defined robotics are: 
  35.   TLD(0)     robotic path = /dev/sg11 
  36.   TLD(1)     robotic path = /dev/sg4 
  37.  
  38. EMM Server = nbu71 
  39. 2.4 移到磁带到driver上面 
  40. [root@nbu71 ~]# robtest  
  41. Configured robots with local control supporting test utilities: 
  42.   TLD(0)     robotic path = /dev/sg11 
  43.   TLD(1)     robotic path = /dev/sg4 
  44.  
  45. Robot Selection 
  46. --------------- 
  47.   1)  TLD 0 
  48.   2)  TLD 1 
  49.   3)  none/quit 
  50. Enter choice: 2 
  51.  
  52. Robot selected: TLD(1)   robotic path = /dev/sg4 
  53.  
  54. Invoking robotic test utility: 
  55. /usr/openv/volmgr/bin/tldtest -rn 1 -r /dev/sg4  
  56.  
  57. Opening /dev/sg4 
  58. MODE_SENSE complete 
  59. Enter tld commands (? returns help information) 
  60. 查看driver状态 
  61. s d 
  62. drive 1 (addr 1) access = 1 Contains Cartridge = yes 
  63. Source address = 1043 (slot 20) 
  64. Barcode = E01020L4                            
  65. drive 2 (addr 2) access = 1 Contains Cartridge = no 
  66. drive 3 (addr 3) access = 1 Contains Cartridge = no 
  67. drive 4 (addr 4) access = 1 Contains Cartridge = no 
  68. READ_ELEMENT_STATUS complete 
  69. 查看磁带的状态 
  70. s s 
  71. slot 1 (addr 1024) contains Cartridge = yes 
  72. Source address = 34976 
  73. Barcode = E01001L4                            
  74. slot 2 (addr 1025) contains Cartridge = yes 
  75. Source address = 8320 
  76. Barcode = E01002L4                            
  77. slot 3 (addr 1026) contains Cartridge = yes 
  78. Barcode = E01003L4                            
  79. slot 4 (addr 1027) contains Cartridge = yes 
  80. Barcode = E01004L4                            
  81. slot 5 (addr 1028) contains Cartridge = yes 
  82. Barcode = E01005L4                            
  83. slot 6 (addr 1029) contains Cartridge = yes 
  84. Barcode = E01006L4                            
  85. slot 7 (addr 1030) contains Cartridge = yes 
  86. Barcode = E01007L4                            
  87. slot 8 (addr 1031) contains Cartridge = yes 
  88. Barcode = E01008L4                            
  89. slot 9 (addr 1032) contains Cartridge = yes 
  90. Barcode = E01009L4                            
  91. slot 10 (addr 1033) contains Cartridge = yes 
  92. Barcode = E01010L4                            
  93. << Press return to continueor q and return to stop >> 
  94. READ_ELEMENT_STATUS complete 
  95. 移动槽位4上面的磁带到driver 2上面 
  96. m s4 d2 
  97. Initiating MOVE_MEDIUM from address 1027 to 2 
  98. MOVE_MEDIUM complete 
  99. s s 
  100. slot 1 (addr 1024) contains Cartridge = yes 
  101. Source address = 34976 
  102. Barcode = E01001L4                            
  103. slot 2 (addr 1025) contains Cartridge = yes 
  104. Source address = 8320 
  105. Barcode = E01002L4                            
  106. slot 3 (addr 1026) contains Cartridge = yes 
  107. Barcode = E01003L4                            
  108. slot 4 (addr 1027) contains Cartridge = no 
  109. slot 5 (addr 1028) contains Cartridge = yes 
  110. Barcode = E01005L4                            
  111. slot 6 (addr 1029) contains Cartridge = yes 
  112. Barcode = E01006L4                            
  113. slot 7 (addr 1030) contains Cartridge = yes 
  114. Barcode = E01007L4                            
  115. slot 8 (addr 1031) contains Cartridge = yes 
  116. Barcode = E01008L4                            
  117. slot 9 (addr 1032) contains Cartridge = yes 
  118. Barcode = E01009L4                            
  119. slot 10 (addr 1033) contains Cartridge = yes 
  120. Barcode = E01010L4                            
  121. << Press return to continueor q and return to stop >> 
  122. READ_ELEMENT_STATUS complete 
  123. 已经看到driver 2上面有磁带了 
  124. s d    
  125. drive 1 (addr 1) access = 1 Contains Cartridge = yes 
  126. Source address = 1043 (slot 20) 
  127. Barcode = E01020L4                            
  128. drive 2 (addr 2) access = 1 Contains Cartridge = yes 
  129. Source address = 1027 (slot 4) 
  130. Barcode = E01004L4                            
  131. drive 3 (addr 3) access = 1 Contains Cartridge = no 
  132. drive 4 (addr 4) access = 1 Contains Cartridge = no 
  133. READ_ELEMENT_STATUS complete 
  134. quit 
  135.  
  136. Robot Selection 
  137. --------------- 
  138.   1)  TLD 0 
  139.   2)  TLD 1 
  140.   3)  none/quit 
  141. Enter choice: 
  142. 2.5 用mtx查看一下状态 
  143. [root@nbu71 ~]# mtx -f /dev/sg4 status 
  144.   Storage Changer /dev/sg4:4 Drives, 43 Slots ( 4 Import/Export ) 
  145. Data Transfer Element 0:Full (Storage Element 20 Loaded):VolumeTag = E01020L4                             
  146. Data Transfer Element 1:Full (Storage Element 4 Loaded):VolumeTag = E01004L4                             
  147. Data Transfer Element 2:Empty 
  148. Data Transfer Element 3:Empty 
  149.       Storage Element 1:Full :VolumeTag=E01001L4                             
  150.       Storage Element 2:Full :VolumeTag=E01002L4                             
  151.       Storage Element 3:Full :VolumeTag=E01003L4                             
  152.       Storage Element 4:Empty 
  153.       Storage Element 5:Full :VolumeTag=E01005L4                             
  154.       Storage Element 6:Full :VolumeTag=E01006L4                             
  155.       Storage Element 7:Full :VolumeTag=E01007L4                             
  156.       Storage Element 8:Full :VolumeTag=E01008L4                             
  157.       Storage Element 9:Full :VolumeTag=E01009L4                             
  158.       Storage Element 10:Full :VolumeTag=E01010L4                             
  159.       Storage Element 11:Full :VolumeTag=E01011L4                             
  160.       Storage Element 12:Full :VolumeTag=E01012L4                             
  161.       Storage Element 13:Full :VolumeTag=E01013L4                             
  162.       Storage Element 14:Full :VolumeTag=E01014L4        
  163.  2.6 查看设备      
  164. [root@nbu71 ~]# lsscsi -g 
  165. [0:0:0:0]    disk    ATA      VBOX HARDDISK    1.0   /dev/sda  /dev/sg0 
  166. [1:0:0:0]    disk    ATA      VBOX HARDDISK    1.0   /dev/sdb  /dev/sg1 
  167. [2:0:0:0]    mediumx STK      L700             550V  -         /dev/sg4 
  168. [2:0:1:0]    tape    IBM      ULT3580-TD5      550V  /dev/st0  /dev/sg2 
  169. [2:0:2:0]    tape    IBM      ULT3580-TD5      550V  /dev/st1  /dev/sg3 
  170. [2:0:3:0]    tape    IBM      ULT3580-TD4      550V  /dev/st2  /dev/sg5 
  171. [2:0:4:0]    tape    IBM      ULT3580-TD4      550V  /dev/st3  /dev/sg6 
  172. [2:0:8:0]    mediumx SPECTRA  PYTHON           550V  -         /dev/sg11 
  173. [2:0:9:0]    tape    IBM      ULT3580-TD4      550V  /dev/st4  /dev/sg7 
  174. [2:0:10:0]   tape    IBM      ULT3580-TD4      550V  /dev/st5  /dev/sg8 
  175. [2:0:11:0]   tape    IBM      ULT3580-TD4      550V  /dev/st6  /dev/sg9 
  176. [2:0:12:0]   tape    IBM      ULT3580-TD4      550V  /dev/st7  /dev/sg10 
  177. 2.8 备份测试 
  178. [root@nbu71 ~]# tar -cvf /dev/st1 /etc/hosts 
  179. tar: Removing leading `/' from member names 
  180. /etc/hosts 
  181. 2.9 查看是否已经备份成功 
  182. [root@nbu71 ~]# tar -tvf /dev/st1 
  183. -rw-r--r-- root/root       232 2012-10-13 14:19:05 etc/hosts