Red Hat安装虚拟带库

26 篇文章 0 订阅

1、安装五个包

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

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

2、下载最新版的mhvtl

mhvtl-2014-09-07.tgz

3、编译内核模块

# cd mhvtl-1.5
# cd kernel
# make
# make install

4、创建mhvtl用户

# useradd -c "vitrual mhvtl" -M vtl

5、编译用户空间代码

# cd mhvtl-1.5
# make
# make install

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

# chown -R vtl:vtl /opt/mhvtl

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

7、建立配置文件

# service mhvtl

Could not locate library config file: /etc/mhvtl/library_contents.10
Creating a default one
Please stop mhvtl & edit /etc/mhvtl/library_contents.10 to suit your requirements

Could not locate library config file: /etc/mhvtl/library_contents.30
Creating a default one
Please stop mhvtl & edit /etc/mhvtl/library_contents.30 to suit your requirements
Usage: /etc/init.d/mhvtl {start|stop|shutdown}

8、查看配置文件

# cat /etc/mhvtl/mhvtl.conf 

# Home directory for config file(s)
MHVTL_CONFIG_PATH=/etc/mhvtl

# Default media capacity (500 M)    #磁带容量
CAPACITY=500

# Set default verbosity [0|1|2|3]
VERBOSE=1

# Set kernel module debuging [0|1]
VTL_DEBUG=0

9、启动mhvtl

# /etc/init.d/mhvtl start

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

# lsscsi -g 

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

2个机械臂 (/dev/sg10和/dev/sg11)
8个驱动器

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

# mtx -f /dev/sg10 status

  Storage Changer /dev/sg10:4 Drives, 43 Slots ( 4 Import/Export )
Data Transfer Element 0:Empty
Data Transfer Element 1:Empty
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: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                            
      Storage Element 40 IMPORT/EXPORT:Empty
      Storage Element 41 IMPORT/EXPORT:Empty
      Storage Element 42 IMPORT/EXPORT:Empty
      Storage Element 43 IMPORT/EXPORT:Empty

4个驱动器,43个槽位

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

# mtx -f /dev/sg10 load 1 0
Loading media from Storage Element 1 into drive 0...done
# mtx -f /dev/sg10 status

  Storage 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:Empty
Data Transfer Element 2:Empty
Data Transfer Element 3:Empty
      Storage Element 1:Empty
      Storage Element 2:Full :VolumeTag=E01002L4  

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

13、查看st0状态(mt)

# mt -f /dev/st0 status

SCSI 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=0
General status bits on (41010000):
 BOT ONLINE IM_REP_EN

装入磁带:

  • File number=0
  • DR_OPEN IM_REP_EN

未装磁带:

  • File number=-1
  • BOT ONLINE IM_REP_EN

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

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

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

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

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

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

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

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

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

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

写入数据并使用gzip压缩

16、查看磁带数据(tvf)

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

17、清除磁带内容(erase)

# mt -f /dev/nst0 rewind
# mt -f /dev/nst0 erase

18、卸载磁带库(unload)

# mtx -f /dev/sg10 unload 1 0
Unloading drive 0 into Storage Element 1...done
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
MHVTL的Web图形用户界面(由马克·哈维markh794@gmail.com基于Linux的虚拟带库) 许可: GPL v2的http://www.gnu.org/licenses/gpl-2.0.html 免责声明: 该软件产品是由我提供的“原样”和“所有错误。”我做有关病毒,不准确,拼写错误,或该软件产品的其他有害成分的安全性,适用性,缺少任何陈述或任何形式的担保。有在使用任何软件固有的危险,而你是全权负责确定本软件产品是否与您的设备和安装在设备的其他软件相兼容。您还全权负责为您的设备的数据保护和备份,我不会承担任何损失可能与使用,修改或分发本软件产品的连接受到影响。 MHVTL GUI要求: ======================== 1)您将需要一个支持PHP的Web服务器(必需)    请测试用“的phpinfo();” 2)安装须藤(必填): *让你的Web服务器的用户id在本地以root身份运行命令   例如:运行#回声“阿帕奇ALL=(ALL)NOPASSWD:ALL”>>在/ etc/ sudoers文件 *注释掉在/ etc/ sudoers文件行“默认requiretty” *您可能需要禁用SELinux来运行的httpd sudo的,由crippa.andrea/ MHVTL论坛报 3)安装一些实用OS工具: *使用lsscsi(YUM安装使用lsscsi)(必填) * MTX(YUM安装MTX)(必填) * MT-ST(YUM安装MT-ST)(必填) *混帐更高版本1.7.4.1或百胜安装的git(可选 - 用于Live Update功能) * SYSSTAT(YUM安装SYSSTAT)(可选) * sg3_utils(可选)百胜安装sg3_utils 4)安装MHVTL/最低版本0.18版本15]例如:版本:0.18.15-的git-XXXXXX(必填) *通过公共Git仓库https://github.com/markh794或看到http://sites.google.com/site/linuxvtl2/下载MHVTL 5)互联网连接的Live Update功能(可选) 6)TGT1.17或更高版本的http://stgt.sourceforge.net/(可选)用于iSCSI目标 7)支持的互联网浏览器:Internet Explorer 8中,Firefox和谷歌Chrome浏览器(应用模式)更好的体验 MHVTL Web控制台UI安装: =================================== 1)添加目录别名为MHVTL GUI Web服务器的配置文件: 例如: 别名/ mhvtl“的/ var/ www / html等/ mhvtl” <目录“的/ var/ www / html等/ mhvtl”>    选择无    AllowOverride无    为了允许,拒绝    所有允许 </目录> 2)将所有MHVTL GUI文件到上面指定的别名目录。 3)通过您的互联网浏览器如接入MHVTL GUI HTTP://本地主机/ mhvtl/或http://10.0.0.10/mhvtl/ 4)登录密码为:“mhvtl

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值