centos65+mhvtl+gui+iscsi-tgt虚拟磁带库的安装与应用_第1页
centos65+mhvtl+gui+iscsi-tgt虚拟磁带库的安装与应用_第2页
centos65+mhvtl+gui+iscsi-tgt虚拟磁带库的安装与应用_第3页
centos65+mhvtl+gui+iscsi-tgt虚拟磁带库的安装与应用_第4页
centos65+mhvtl+gui+iscsi-tgt虚拟磁带库的安装与应用_第5页
已阅读5页,还剩13页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、一Mhvtl+mhvtl gui+iscsi1.安装:yum install lsscsi mt-st mtx zlib-devel sg3_utils zlib lzo-devel kernel-devel kernel-headers gcc接着创建vtl用户:#useradd vtl#passwd vtl#mkdir /opt/mhvtl# mkdir /etc/mhvtl# chown -Rf vtl:vtl /opt/mhvtl#chown -Rf vtl:vtl /etc/mhvtl(/etc/mhvtl为配置文件路径 /opt/mhvtl为虚拟带库存储路径)2. 编译安装

2、0;MHVLT# tar -zxvf mhvtl-2013-03-22.tgzrootcentos001 tool# cd mhvtl-1.4rootcentos001 mhvtl-1.4# cd kernelrootcentos001 kernel# make;make installrootcentos001 mhvtl-1.4# make;make install如果未安装lzo和lzo-devel开发环境将收到如下报错:Note: Since mhvtl-1.3, both lzo and zlib are required to build vtltapeTypical e

3、rror (missing lzo devel package) looks like:cc -Wall -Wshadow -g -O2 -D_LARGEFILE64_SOURCE  -I./kernel -DMHVTL_VERSION="1.4.0" -DMHVTL_DEBUG -DUSR="vtl" -DMHVTL_HOME_PATH="/opt/mhvtl" -DMHVTL_CONFIG_PATH="/etc/mhvtl"   -c -o vtltape.o vtltape.cv

4、tltape.c:92:25: error: lzo/lzoconf.h: No such file or directoryvtltape.c:93:23: error: lzo/lzo1x.h: No such file or directoryvtltape.c: In function 'uncompress_lzo_block'rootcentos001 mhvtl-1.4# service mhvtl statusCould not locate library config file: /etc/mhvtl/lib

5、rary_contents.10Creating a default onePlease stop mhvtl & edit /etc/mhvtl/library_contents.10 to suit your requirementsCould not locate library config file: /etc/mhvtl/library_contents.30Creating a default onePlease stop mhvtl & edit /etc/mhvtl/library_contents.30 to suit your requirementsUs

6、age: /etc/init.d/mhvtl start|stop|shutdownrootcentos001 mhvtl-1.4# service mhvtl startvtllibrary process PID is 1729vtllibrary process PID is 1733查看虚拟带库状态信息 rootcentos001 mhvtl-1.4# lsscsi -g1:0:0:0 cd/dvd NECVMWar VMware IDE CDR10 1.00 /dev/sr0 /dev/sg02:0:0:0 disk VMware, VMware Virtual S 1.0

7、 /dev/sda /dev/sg13:0:0:0 mediumx STK L700 0104 /dev/sch0 /dev/sg103:0:1:0 tape IBM ULT3580-TD5 0104 /dev/st0 /dev/sg23:0:2:0 tape IBM ULT3580-TD5 0104 /dev/st1 /dev/sg33:0:3:0 tape IBM ULT3580-TD4 0104 /dev/st2 /dev/sg43:0:4:0 tape IBM ULT3580-TD4 0104 /dev/st3 /dev/sg53:0:8:0 mediumx STK L80 0104

8、/dev/sch1 /dev/sg113:0:9:0 tape STK T10000B 0104 /dev/st4 /dev/sg63:0:10:0 tape STK T10000B 0104 /dev/st5 /dev/sg73:0:11:0 tape STK T10000B 0104 /dev/st6 /dev/sg83:0:12:0 tape STK T10000B 0104 /dev/st7 /dev/sg9rootcentos001 mhvtl-1.4# lsscsi -l1:0:0:0 cd/dvd NECVMWar VMware IDE CDR10 1.00 /dev/sr0 s

9、tate=running queue_depth=1 scsi_level=6 type=5 device_blocked=0 timeout=302:0:0:0 disk VMware, VMware Virtual S 1.0 /dev/sda state=running queue_depth=32 scsi_level=3 type=0 device_blocked=0 timeout=303:0:0:0 mediumx STK L700 0104 /dev/sch0 state=running queue_depth=32 scsi_level=6 type=8 device_blo

10、cked=0 timeout=03:0:1:0 tape IBM ULT3580-TD5 0104 /dev/st0 state=running queue_depth=32 scsi_level=6 type=1 device_blocked=0 timeout=9003:0:2:0 tape IBM ULT3580-TD5 0104 /dev/st1 state=running queue_depth=32 scsi_level=6 type=1 device_blocked=0 timeout=9003:0:3:0 tape IBM ULT3580-TD4 0104 /dev/st2 s

11、tate=running queue_depth=32 scsi_level=6 type=1 device_blocked=0 timeout=9003:0:4:0 tape IBM ULT3580-TD4 0104 /dev/st3 state=running queue_depth=32 scsi_level=6 type=1 device_blocked=0 timeout=9003:0:8:0 mediumx STK L80 0104 /dev/sch1 state=running queue_depth=32 scsi_level=6 type=8 device_blocked=0

12、 timeout=03:0:9:0 tape STK T10000B 0104 /dev/st4 state=running queue_depth=32 scsi_level=0 type=1 device_blocked=0 timeout=9003:0:10:0 tape STK T10000B 0104 /dev/st5 state=running queue_depth=32 scsi_level=0 type=1 device_blocked=0 timeout=9003:0:11:0 tape STK T10000B 0104 /dev/st6 state=running que

13、ue_depth=32 scsi_level=0 type=1 device_blocked=0 timeout=9003:0:12:0 tape STK T10000B 0104 /dev/st7 state=running queue_depth=32 scsi_level=0 type=1 device_blocked=0 timeout=900这里的/dev/sg10和/dev/sg11是机械手。这个默认的容量是500MB,这个可以查看mhvtl的配置文件mhvtl.conf:rootcentos001 mhvtl-1.4# cat /etc/mhvtl/mhvtl.conf# Hom

14、e directory for config file(s)MHVTL_CONFIG_PATH=/etc/mhvtl# Default media capacity (500 M)CAPACITY=500# Set default verbosity 0|1|2|3VERBOSE=1# Set kernel module debuging 0|1VTL_DEBUG=0capacity=500就是指默认容量为500MB。3.简单应用:查看机械手状态:rootcentos001 mhvtl-1.4# mtx -f /dev/sg10 status Storage Changer /dev/sg10

15、:4 Drives, 43 Slots ( 4 Import/Export )Data Transfer Element 0:EmptyData Transfer Element 1:EmptyData Transfer Element 2:EmptyData Transfer Element 3:Empty Storage Element 1:Full :VolumeTag=E01001L4 Storage Element 2:Full :VolumeTag=E01002L4 Storage Element 3:Full :VolumeTag=E01003L4 Storage Element

16、 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 Eleme

17、nt 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 Stora

18、ge 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 El

19、ement 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

20、=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 Storage Element 40 IMPORT/EXPORT:Empty Storage Element 41 IMPORT/EXPOR

21、T:Empty Storage Element 42 IMPORT/EXPORT:Empty Storage Element 43 IMPORT/EXPORT:Emptyrootcentos001 mhvtl-1.4# mtx -f /dev/sg11 status Storage Changer /dev/sg11:4 Drives, 44 Slots ( 4 Import/Export )Data Transfer Element 0:EmptyData Transfer Element 1:EmptyData Transfer Element 2:EmptyData Transfer E

22、lement 3:Empty Storage Element 1:Full :VolumeTag=G03001TA Storage Element 2:Full :VolumeTag=G03002TA Storage Element 3:Full :VolumeTag=G03003TA Storage Element 4:Full :VolumeTag=G03004TA Storage Element 5:Full :VolumeTag=G03005TA Storage Element 6:Full :VolumeTag=G03006TA Storage Element 7:Full :Vol

23、umeTag=G03007TA Storage Element 8:Full :VolumeTag=G03008TA Storage Element 9:Full :VolumeTag=G03009TA Storage Element 10:Full :VolumeTag=G03010TA Storage Element 11:Full :VolumeTag=G03011TA Storage Element 12:Full :VolumeTag=G03012TA Storage Element 13:Full :VolumeTag=G03013TA Storage Element 14:Ful

24、l :VolumeTag=G03014TA Storage Element 15:Full :VolumeTag=G03015TA Storage Element 16:Full :VolumeTag=G03016TA Storage Element 17:Full :VolumeTag=G03017TA Storage Element 18:Full :VolumeTag=G03018TA Storage Element 19:Full :VolumeTag=G03019TA Storage Element 20:Full :VolumeTag=G03020TA Storage Elemen

25、t 21:Full :VolumeTag=G03021TA Storage Element 22:Full :VolumeTag=G03022TA Storage Element 23:Full :VolumeTag=G03023TA Storage Element 24:Full :VolumeTag=G03024TA Storage Element 25:Full :VolumeTag=G03025TA Storage Element 26:Full :VolumeTag=G03026TA Storage Element 27:Full :VolumeTag=G03027TA Storag

26、e Element 28:Full :VolumeTag=G03028TA Storage Element 29:Full :VolumeTag=G03029TA Storage Element 30:Full :VolumeTag=G03030TA Storage Element 31:Full :VolumeTag=G03031TA Storage Element 32:Full :VolumeTag=G03032TA Storage Element 33:Full :VolumeTag=G03033TA Storage Element 34:Full :VolumeTag=G03034T

27、A Storage Element 35:Full :VolumeTag=G03035TA Storage Element 36:Full :VolumeTag=G03036TA Storage Element 37:Full :VolumeTag=G03037TA Storage Element 38:Full :VolumeTag=G03038TA Storage Element 39:Full :VolumeTag=G03039TA Storage Element 40:Full :VolumeTag=CLN303TA Storage Element 41 IMPORT/EXPORT:E

28、mpty Storage Element 42 IMPORT/EXPORT:Empty Storage Element 43 IMPORT/EXPORT:Empty Storage Element 44 IMPORT/EXPORT:Empty将磁带从1号槽位装入driver 0:rootcentos001 mhvtl-1.4# mtx -f /dev/sg10 load 1 0sLoading media from Storage Element 1 into drive 0.donerootcentos001 mhvtl-1.4# mtx -f /dev/sg10 status Storag

29、e Changer /dev/sg10:4 Drives, 43 Slots ( 4 Import/Export )Data Transfer Element 0:Full (Storage Element 1 Loaded):VolumeTag = E01001L4 Data Transfer Element 1:EmptyData Transfer Element 2:EmptyData Transfer Element 3:Empty Storage Element 1:Empty Storage Element 2:Full :VolumeTag=E01002L4 Storage El

30、ement 3:Full :VolumeTag=E01003L4查看磁带状态:rootcentos001 mhvtl-1.4# mt -f /dev/st0 statusSCSI 2 tape drive:File number=0, block number=0, partition=0.Tape block size 0 bytes. Density code 0x46 (LTO-4).Soft error count since last status=0General status bits on (41010000): BOT ONLINE IM_REP_EN使用tar命令测试下,能

31、否写入文件:rootcentos001 mhvtl-1.4# tar -cvvf /dev/st1 /boottar: Removing leading /' from member namesdr-xr-xr-x root/root 0 2014-09-11 16:58 /boot/-rw-r-r- root/root 2519609 2014-07-25 17:00 /boot/System.map-2.6.32-431.20.5.el6.x86_64drwxr-xr-x root/root 0 2013-11-13 18:04 /boot/efi/drwxr-xr-x root/

32、root 0 2013-11-13 18:04 /boot/efi/EFI/drwxr-xr-x root/root 0 2014-07-30 14:55 /boot/efi/EFI/redhat/-rwxr-xr-x root/root 252990 2014-07-25 20:08 /boot/efi/EFI/redhat/grub.efi-rw-r-r- root/root 105200 2014-09-10 06:02 /boot/config-2.6.32-431.29.2.el6.x86_64-rw-r-r- root/root 193945 2014-09-10 06:02 /b

33、oot/symvers-2.6.32-431.29.2.el6.x86_64.gzdrwxr-xr-x root/root 0 2014-09-10 15:45 /boot/grub/-rw-r-r- root/root 13268 2013-11-13 18:09 /boot/grub/jfs_stage1_5-rw-r-r- root/root 12620 2013-11-13 18:09 /boot/grub/fat_stage1_5-rw-r-r- root/root 13380 2013-11-13 18:09 /boot/grub/e2fs_stage1_5-rw-r-r- roo

34、t/root 512 2013-11-13 18:09 /boot/grub/stage1-rw-r-r- root/root 13964 2013-11-13 18:09 /boot/grub/xfs_stage1_5-rw-r-r- root/root 11748 2013-11-13 18:09 /boot/grub/ffs_stage1_5-rw-r-r- root/root 11364 2013-11-13 18:09 /boot/grub/vstafs_stage1_5-rw-r-r- root/root 14412 2013-11-13 18:09 /boot/grub/reis

35、erfs_stage1_5-rw-r-r- root/root 11756 2013-11-13 18:09 /boot/grub/iso9660_stage1_5lrwxrwxrwx root/root 0 2013-11-13 18:09 /boot/grub/menu.lst -> ./grub.conf写入成功了,测试是否能读取呢:rootcentos001 mhvtl-1.4# tar -tvvf /dev/st1dr-xr-xr-x root/root 0 2014-09-11 16:58 boot/-rw-r-r- root/root 2519609 2014-07-25

36、17:00 boot/System.map-2.6.32-431.20.5.el6.x86_64drwxr-xr-x root/root 0 2013-11-13 18:04 boot/efi/drwxr-xr-x root/root 0 2013-11-13 18:04 boot/efi/EFI/drwxr-xr-x root/root 0 2014-07-30 14:55 boot/efi/EFI/redhat/-rwxr-xr-x root/root 252990 2014-07-25 20:08 boot/efi/EFI/redhat/grub.efi-rw-r-r- root/roo

37、t 105200 2014-09-10 06:02 boot/config-2.6.32-431.29.2.el6.x86_64-rw-r-r- root/root 193945 2014-09-10 06:02 boot/symvers-2.6.32-431.29.2.el6.x86_64.gz查看磁带位置:rootcentos001 mhvtl-1.4# cd /opt/mhvtlrootcentos001 mhvtl# du -sm *1 CLN101L41 CLN102L51 CLN303TA1 E01001L4141 E01002L4接下来测试倒带:rootcentos001 mhv

38、tl-1.4# mt -f /dev/st1 rewindrootcentos001 mhvtl-1.4#卸载磁带:rootcentos001 mhvtl-1.4# mtx -f /dev/sg10 unload 1 0Unloading drive 0 into Storage Element 1.donerootcentos001 mhvtl-1.4#4. 配置linux iscsi发起端,使用tgtd,安装tgtd(tgtd:iscsi服务器端进程),安装iSCSI taget安装iSCSI taget 前先安装perl-Config-Genera

39、l-2.52-1.el6.noarch.rpm,然后安装 scsi-target-utils-1.0.24-12.el6_5.x86_64.rpmrootcentos001 mhvtl# yum install scsi-target-utils-> Running transaction check-> Package scsi-target-utils.x86_64 0:1.0.24-12.el6_5 will be installed-> Processing Dependency: perl(Config:General) for package: scsi-targ

40、et-utils-1.0.24-12.el6_5.x86_64-> Running transaction check-> Package perl-Config-General.noarch 0:2.52-1.el6 will be installed-> Finished Dependency ResolutionDependencies Resolved= Package Arch Version Repository Size=Installing: scsi-target-utils x86_64 1.0.24-12.el6_5 updates 175 kInsta

41、lling for dependencies: perl-Config-General noarch 2.52-1.el6 base 72 kTransaction Summary=Install 2 Package(s)Total download size: 247 kInstalled size: 623 kIs this ok y/N: yDownloading Packages:(1/2): perl-Config-General-2.52-1.el6.noarch.rpm | 72 kB 00:00(2/2): scsi-target-utils-1.0.24-12.el6_5.x

42、86_64.rpm | 175 kB 00:00-Total 950 kB/s | 247 kB 00:00Running rpm_check_debugRunning Transaction TestTransaction Test SucceededRunning Transaction Installing : perl-Config-General-2.52-1.el6.noarch 1/2 Installing : scsi-target-utils-1.0.24-12.el6_5.x86_64 2/2 Verifying : perl-Config-General-2.52-1.e

43、l6.noarch 1/2 Verifying : scsi-target-utils-1.0.24-12.el6_5.x86_64 2/2启动tgtd服务rootcentos001 mhvtl# service tgtd start把带库映射给iscsirootcentos001 mhvtl# lsscsi -g1:0:0:0 cd/dvd NECVMWar VMware IDE CDR10 1.00 /dev/sr0 /dev/sg02:0:0:0 disk VMware, VMware Virtual S 1.0 /dev/sda /dev/sg13:0:0:0 mediumx STK

44、L700 0104 /dev/sch0 /dev/sg103:0:1:0 tape IBM ULT3580-TD5 0104 /dev/st0 /dev/sg23:0:2:0 tape IBM ULT3580-TD5 0104 /dev/st1 /dev/sg33:0:3:0 tape IBM ULT3580-TD4 0104 /dev/st2 /dev/sg43:0:4:0 tape IBM ULT3580-TD4 0104 /dev/st3 /dev/sg53:0:8:0 mediumx STK L80 0104 /dev/sch1 /dev/sg113:0:9:0 tape STK T1

45、0000B 0104 /dev/st4 /dev/sg63:0:10:0 tape STK T10000B 0104 /dev/st5 /dev/sg73:0:11:0 tape STK T10000B 0104 /dev/st6 /dev/sg83:0:12:0 tape STK T10000B 0104 /dev/st7 /dev/sg9rootcentos001 mhvtl# vim /etc/tgt/targets.conf 添加<target iqn.2014-.example:server.targetmhvtl> backing-store /dev/sg10 bac

46、king-store /dev/sg2 backing-store /dev/sg3 backing-store /dev/sg4 backing-store /dev/sg5 backing-store /dev/sg11 backing-store /dev/sg6 backing-store /dev/sg7 backing-store /dev/sg8 backing-store /dev/sg9 device-type pt bs-type sg</target>initiator-address ALLrootcentos001 mhvtl# service tgtd

47、restartStopping SCSI target daemon: OK Starting SCSI target daemon: OK 可以查询一下映射的带库rootcentos001 mhvtl# tgtadm -lld iscsi -op show -mode targetTarget 1: iqn.2014-.example:server.targetmhvtl System information: Driver: iscsi State: ready I_T nexus information: LUN information: LUN: 0 Type: controller SCSI ID: IET 00010000 SCSI SN: beaf10 Size: 0 MB, Block size: 1 Online: Yes Removable media: No Prevent removal: No Readonly: No Backing store type: null Backing store path: None Backing store flags: LUN: 1 Type: passthrough SCSI ID: IET 00010001 SCSI

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论