1、安装五个包

  1. # yum -y install lzo-devel sg3_utils lsscsi mtx mt-st

mtx源码:http://sourceforge.net/

2、下载最新版的mhvtl

  1. mhvtl-2014-09-07.tgz

3、编译内核模块

  1. # cd mhvtl-1.5
  2. # cd kernel
  3. # make
  4. # make install

4、创建mhvtl用户

  1. # useradd -c "vitrual mhvtl" -M vtl

5、编译用户空间代码

  1. # cd mhvtl-1.5
  2. # make
  3. # make install

6、修改权限,不修改启动不了mhvtl

  1. # chown -R vtl:vtl /opt/mhvtl

/etc/mhvtl 是放配置文件的地方

/opt/mhvtl 是放模拟磁带文件的地方

7、建立配置文件

  1. # service mhvtl
  2. Could not locate library config file: /etc/mhvtl/library_contents.10
  3. Creating a default one
  4. Please stop mhvtl & edit /etc/mhvtl/library_contents.10 to suit your requirements
  5. Could not locate library config file: /etc/mhvtl/library_contents.30
  6. Creating a default one
  7. Please stop mhvtl & edit /etc/mhvtl/library_contents.30 to suit your requirements
  8. Usage: /etc/init.d/mhvtl {start|stop|shutdown}

8、查看配置文件

  1. # cat /etc/mhvtl/mhvtl.conf
  2. # Home directory for config file(s)
  3. MHVTL_CONFIG_PATH=/etc/mhvtl
  4. # Default media capacity (500 M) #磁带容量
  5. CAPACITY=500
  6. # Set default verbosity [0|1|2|3]
  7. VERBOSE=1
  8. # Set kernel module debuging [0|1]
  9. VTL_DEBUG=0

9、启动mhvtl

  1. # /etc/init.d/mhvtl start

10、查看虚拟带库状态信息(lsscsi)

  1. # lsscsi -g
  2. [2:0:0:0] disk VMware, VMware Virtual S 1.0 /dev/sda /dev/sg0
  3. [4:0:0:0] cd/dvd NECVMWar VMware SATA CD01 1.00 /dev/sr0 /dev/sg1
  4. [33:0:0:0] mediumx STK L700 0105 /dev/sch0 /dev/sg10
  5. [33:0:1:0] tape IBM ULT3580-TD5 0105 /dev/st0 /dev/sg2
  6. [33:0:2:0] tape IBM ULT3580-TD5 0105 /dev/st1 /dev/sg3
  7. [33:0:3:0] tape IBM ULT3580-TD4 0105 /dev/st2 /dev/sg4
  8. [33:0:4:0] tape IBM ULT3580-TD4 0105 /dev/st3 /dev/sg5
  9. [33:0:8:0] mediumx STK L80 0105 /dev/sch1 /dev/sg11
  10. [33:0:9:0] tape STK T10000B 0105 /dev/st4 /dev/sg6
  11. [33:0:10:0] tape STK T10000B 0105 /dev/st5 /dev/sg7
  12. [33:0:11:0] tape STK T10000B 0105 /dev/st6 /dev/sg8
  13. [33:0:12:0] tape STK T10000B 0105 /dev/st7 /dev/sg9

2个机械臂 (/dev/sg10和/dev/sg11)

8个驱动器

11、查看机械臂状态(mtx)

  1. # mtx -f /dev/sg10 status
  2. Storage Changer /dev/sg10:4 Drives, 43 Slots ( 4 Import/Export )
  3. Data Transfer Element 0:Empty
  4. Data Transfer Element 1:Empty
  5. Data Transfer Element 2:Empty
  6. Data Transfer Element 3:Empty
  7. Storage Element 1:Full :VolumeTag=E01001L4
  8. Storage Element 2:Full :VolumeTag=E01002L4
  9. Storage Element 3:Full :VolumeTag=E01003L4
  10. Storage Element 4:Full :VolumeTag=E01004L4
  11. Storage Element 5:Full :VolumeTag=E01005L4
  12. Storage Element 6:Full :VolumeTag=E01006L4
  13. Storage Element 7:Full :VolumeTag=E01007L4
  14. Storage Element 8:Full :VolumeTag=E01008L4
  15. Storage Element 9:Full :VolumeTag=E01009L4
  16. Storage Element 10:Full :VolumeTag=E01010L4
  17. Storage Element 11:Full :VolumeTag=E01011L4
  18. Storage Element 12:Full :VolumeTag=E01012L4
  19. Storage Element 13:Full :VolumeTag=E01013L4
  20. Storage Element 14:Full :VolumeTag=E01014L4
  21. Storage Element 15:Full :VolumeTag=E01015L4
  22. Storage Element 16:Full :VolumeTag=E01016L4
  23. Storage Element 17:Full :VolumeTag=E01017L4
  24. Storage Element 18:Full :VolumeTag=E01018L4
  25. Storage Element 19:Full :VolumeTag=E01019L4
  26. Storage Element 20:Full :VolumeTag=E01020L4
  27. Storage Element 21:Empty
  28. Storage Element 22:Full :VolumeTag=CLN101L4
  29. Storage Element 23:Full :VolumeTag=CLN102L5
  30. Storage Element 24:Empty
  31. Storage Element 25:Empty
  32. Storage Element 26:Empty
  33. Storage Element 27:Empty
  34. Storage Element 28:Empty
  35. Storage Element 29:Empty
  36. Storage Element 30:Full :VolumeTag=F01030L5
  37. Storage Element 31:Full :VolumeTag=F01031L5
  38. Storage Element 32:Full :VolumeTag=F01032L5
  39. Storage Element 33:Full :VolumeTag=F01033L5
  40. Storage Element 34:Full :VolumeTag=F01034L5
  41. Storage Element 35:Full :VolumeTag=F01035L5
  42. Storage Element 36:Full :VolumeTag=F01036L5
  43. Storage Element 37:Full :VolumeTag=F01037L5
  44. Storage Element 38:Full :VolumeTag=F01038L5
  45. Storage Element 39:Full :VolumeTag=F01039L5
  46. Storage Element 40 IMPORT/EXPORT:Empty
  47. Storage Element 41 IMPORT/EXPORT:Empty
  48. Storage Element 42 IMPORT/EXPORT:Empty
  49. Storage Element 43 IMPORT/EXPORT:Empty

4个驱动器,43个槽位

12、 将1槽位的磁带放到0驱动器中(Media Changer Tools)

  1. # mtx -f /dev/sg10 load 1 0
  2. Loading media from Storage Element 1 into drive 0...done
  1. # mtx -f /dev/sg10 status
  2. Storage Changer /dev/sg10:4 Drives, 43 Slots ( 4 Import/Export )
  3. Data Transfer Element 0:Full (Storage Element 1 Loaded):VolumeTag = E01001L4
  4. Data Transfer Element 1:Empty
  5. Data Transfer Element 2:Empty
  6. Data Transfer Element 3:Empty
  7. Storage Element 1:Empty
  8. Storage Element 2:Full :VolumeTag=E01002L4

成功将磁带装入磁带驱动器中

13、查看st0状态(mt)

  1. # mt -f /dev/st0 status
  2. SCSI 2 tape drive:
  3. File number=0, block number=0, partition=0.
  4. Tape block size 0 bytes. Density code 0x46 (LTO-4).
  5. Soft error count since last status=0
  6. General status bits on (41010000):
  7. BOT ONLINE IM_REP_EN

装入磁带:

  • File number=0
  • DR_OPEN IM_REP_EN

未装磁带:

  • File number=-1
  • BOT ONLINE IM_REP_EN

14、检查驱动器中磁头的位置(tell)

  1. # mt -f /dev/st0 tell
  2. At block 0.

15、向磁带中写入数据(cvf)

  1. # tar cvf /dev/st0 mhvtl-2014-09-07.tgz
  2. mhvtl-2014-09-07.tgz
  3. # mt -f /dev/st0 tell
  4. At block 0.

st打头的表示写入完成后会自动倒带,下次写入会覆盖之前的数据

  1. # tar cvf /dev/nst0 mhvtl-2014-09-07.tgz
  2. # mt -f /dev/nst0 tell
  3. At block 37.

nst打头的表示写入完成后不会自动倒带

  1. # tar rvf /dev/st0 mhvtl-2014-09-07.tgz

继续写入数据(不覆盖前边的内容)

  1. # tar -zcvf /dev/st0 mhvtl-2014-09-07.tgz

写入数据并使用gzip压缩

16、查看磁带数据(tvf)

  1. # mt -f /dev/nst0 rewind //倒带
  2. # tar -tvf /dev/nst0
  3. -rw-rw-r-- test/test 357615 2015-04-10 00:13 mhvtl-2014-09-07.tgz
  1. # mt -f /dev/nst0 rewind
  2. # mt -f /dev/nst0 fsf 1 //让磁头前进一个文件
  3. # mt -f /dev/nst0 tell
  4. At block 37.

17、清除磁带内容(erase)

  1. # mt -f /dev/nst0 rewind
  2. # mt -f /dev/nst0 erase

18、卸载磁带库(unload)

  1. # mtx -f /dev/sg10 unload 1 0
  2. Unloading drive 0 into Storage Element 1...done

Red Hat安装虚拟带库的更多相关文章

  1. red hat安装mysql二进制包

    数据包命名格式解释 mysql-5.7.15-linux-glibc2.5-x86_64.tar.gz 黑色粗体表示为包名称 蓝色表示linux系统二进制包 红色表示构架     1.上传mysql- ...

  2. linux red hat 安装svn

    安装步骤如下: 1.yum install subversion   2.输入rpm -ql subversion查看安装位置,如下图:   我们知道svn在bin目录下生成了几个二进制文件. 输入 ...

  3. Red Hat Enterprise Server 6.0 安装Sendmail相关包

    由于需要在Linux服务器(Red Hat Enterprise Linux Server release 6.0)上配置邮件服务,需要安装Sendmail包,一般Sendmail的安装有两种方式:R ...

  4. Red Hat Enterprise Linux 6.6安装体验

    Red Hat Enterprise Linux 6.6的安装首界面有五个选项,这跟以前的Red Hat Enterprise Linux 5.x的安装界面是有一些区别的.   安装或者升级现有系统( ...

  5. Red hat 6.4下面的qt安装

    运行环境:Red hat 6.4 去官网下载qt5.2并且安装 当启动的时候会出现如下错误 核心载入失败: /opt/Qt5.2.0/Tools/QtCreator/lib/qtcreator/plu ...

  6. Red Hat Enterprise Server 5.8+oracle10g(中文界面)安装

    Red Hat Enterprise Server 5.8+oracle10g(中文界面)安装 VMware workstation10(虚拟机)下面安装红帽企业版5.8 创建虚拟机 新建虚拟机,选择 ...

  7. 如何安装win10+Red Hat Enterprise Linux双系统?

    1,如何安装win10+Red Hat Enterprise Linux双系统???? 有很多人(没做过调查,可能就我自己想装吧)想要安装Red Hat Enterprise Linux系统,但是又不 ...

  8. Linux(Red Hat 6 32位) 下安装Mysql5.6.30

    转载地址:http://my.oschina.net/fusxian/blog/300480 1. 下载MySQL 5.6 下载页面:http://dev.mysql.com/downloads/my ...

  9. 小白安装linux(虚拟机)red hat enterprise linux 6

    额,这篇貌似是我名义上的第一篇博客,但是我好像没有第一写他,没事,都一样.(我会假装它是人生中第一篇博客的) 上大学之后,很久之后才发现自己听喜欢linux的,因为感觉很高大上,所以自己自学了很多关于 ...

随机推荐

  1. semantic功能介绍

    semantic功能介绍 gnu Semantic Manual 1,代码自动补全 3,代码导航 启动semantic功能:(semantic-mode 1) 1,Semantic mode 是辅助模 ...

  2. [日常] 前端资源测试机上忽略版本号的的nginx配置

    利用nginx的rewrite的指令,可以实现url的重新跳转,rewrtie有四种不同的flag,分别是redirect(临时重定向).permanent(永久重定向).break和last.其中前 ...

  3. 【转】UML之类图和对象图

    思路呈现 什么是类图? 描述类.接口.协作及他们之间的关系的图.显示系统中类的静态结构. 有什么作用? 描述软件系统的静态结构 ①对系统的词汇建模 ②对简单协作建模 ③对逻辑数据库模式建模 什么是对象 ...

  4. gradle是什么

    Gradle是JVM生态下又一款开源的自动化构建工具,以基于Groovy的DSL描述构建过程,在结合了ant和maven的优点的基础上,提供了更为简洁,灵活和高效的build体验. Task代表了构建 ...

  5. Educational Codeforces Round 69 (Rated for Div. 2) C. Array Splitting 水题

    C. Array Splitting You are given a sorted array

  6. 使用mybatis动态where字句方法

    上篇文章介绍了如何使用mybatis-generator生成实体类.Mapper接口代码,其中生成的Mapper接口代码是不带ByExample方法的.本篇文章将介绍如何使用mybatis-gener ...

  7. Jupyter Notebook使用

    不论你是刚开始学 Python,还是正在啃数据分析的骨头,对你来说,不断在各种命令行窗口和编辑器里切来切去,或者不断打开各种窗口查看 matplotlib 的输出之类的繁琐操作,一定是家常便饭了.哎呀 ...

  8. LeetCode 155:最小栈 Min Stack

    LeetCode 155:最小栈 Min Stack 设计一个支持 push,pop,top 操作,并能在常数时间内检索到最小元素的栈. push(x) -- 将元素 x 推入栈中. pop() -- ...

  9. 记录一个终端入网小助手的bug

    背景:技术leader拿到一台超薄笔记本,系统标准化安装,笔记本一开机风扇嗡嗡响,键盘也开始发烫,资源占用排名前三的进程都是终端管理软件,一下子就找上门了.处理:进程分析发现异常,卸载入网小助手后恢复 ...

  10. JDBC解耦案例

    原始JDBC连接 package jdbc; import org.junit.jupiter.api.Test; import java.sql.Connection; import java.sq ...