tsm 识别 Linux7 HP磁带机,可通过FC访问的基于HBA卡target mode的虚拟磁带库(MHVTL+QLogic-FC+SCST+RHEL6.1)安装配置...

news/2024/10/31 1:29:15/

3.安装配置和测试的安装配置:

首先使用yum 安装一些工具软件:

yum install zlib-devel

yum install lsscsi

yum install mt-st

yum install mtx

yum install lzo

还有其他包,可能需要从网上下载:

lzo-devel-2.03-3.1.el6.x86_64

lzo-minilzo-2.03-3.1.el6.x86_64

安装完毕后,从MHVTL网站下载所需的包:

mhvtl-2012-08-08.tgz

首先添加VTL用户:

#useradd vtl

#passwd vtl

#mkdir  /opt/mhvtl (这个目录是存放虚拟磁带的海量存储空间)

#chown –Rf  vtl:vtl  /opt/mhvtl

创建mhvtl的配置目录:

mkdir  /etc/mhvtl

chown  -Rf vtl:vtl  /etc/mhvtl(这个目录是存放mhvtl的存储空间)

MHVTL INSTALL:

# tar xvf mhvtl-2012-08-08.tgz

#cd mhvtl-1.4/

# make distclean

首先安装kernel部分:

# cd kernel/

# make distclean

#make

# make install

然后其他部分:

# cd ..

#make

#make install

安装完成后,/etc/init.d/mhvtl start即可启动mhvtl, 如果没有配置文件,会自动生成缺省的配置文件。

停止mhvtl:

#/etc/init.d/mhvtl stop

停止mhvtl后,为了便于其他的备份软件使用,编辑修改mhvtl配置文件,主要包括device.conf,mhvtl.conf, library_contents.xx ,如下:

[root@mhvtlserver mhvtl]# more  /etc/mhvtl/device.conf

VERSION: 5

# VPD page format:

# ... # NAA format is an 8 hex byte value seperated by ':'

# Note: NAA is part of inquiry VPD 0x83

#

# Each 'record' is separated by one (or more) blank lines.

# Each 'record' starts at column 1

# Serial num max len is 10.

# Compression: factor X enabled 0|1

#     Where X is zlib compression factor        1 = Fastest compression

#                                               9 = Best compression

#     enabled 0 == off, 1 == on

#

# fifo: /var/tmp/mhvtl

# If enabled, data must be read from fifo, otherwise daemon will block

# trying to write.

# e.g. cat /var/tmp/mhvtl (in another terminal)

Library: 10 CHANNEL: 00 TARGET: 00 LUN: 00     (定义带库,这一行中的10是带库的标识,带库的配置则在相应的library_contents.10文件中指定)

Vendor identification: IBM

Product identification: 03584L32

Product revision level: 4.02

Unit serial number: 9890400

NAA: 50:22:33:44:ab:00:00:00

Home directory: /opt/mhvtl

# fifo: /var/tmp/mhvtl

Drive: 11 CHANNEL: 00 TARGET: 01 LUN: 00   (以下定义各个驱动器)

Library ID: 10 Slot: 01

Vendor identification: IBM

Product identification: ULTRIUM-TD3

Product revision level: 51TB

Unit serial number: 9825111

NAA: 10:22:33:44:ab:00:01:00

Compression: factor 1 enabled 1

Compression type: lzo

Backoff: 1000

# fifo: /var/tmp/mhvtl

Drive: 12 CHANNEL: 00 TARGET: 02 LUN: 00

Library ID: 10 Slot: 02

Vendor identification: IBM

Product identification: ULTRIUM-TD3

Unit serial number: 9825112

Product revision level: 51TB

NAA: 10:22:33:44:ab:00:02:00

Compression: factor 1 enabled 1

Compression type: lzo

Backoff: 1000

# fifo: /var/tmp/mhvtl

Drive: 13 CHANNEL: 00 TARGET: 03 LUN: 00

Library ID: 10 Slot: 03

Vendor identification: IBM

Product identification: ULTRIUM-TD3

Unit serial number: 9825113

Product revision level: 51TB

NAA: 10:22:33:44:ab:00:03:00

Compression: factor 1 enabled 1

Compression type: lzo

Backoff: 1000

# fifo: /var/tmp/mhvtl

Drive: 14 CHANNEL: 00 TARGET: 04 LUN: 00

Library ID: 10 Slot: 04

Vendor identification: IBM

Product identification: ULTRIUM-TD3

Unit serial number: 9825114

Product revision level: 51TB

NAA: 10:22:33:44:ab:00:04:00

Compression: factor 1 enabled 1

Compression type: lzo

Backoff: 1000

# fifo: /var/tmp/mhvtl

Library_contents.10中指定磁带,驱动器等的数量,这里磁带类型用L3---因为驱动器是ULTRIUM-TD3:

[root@mhvtlserver mhvtl]# more library_contents.10

Drive 1:

Drive 2:

Drive 3:

Drive 4:

Picker 1:

MAP 1:

MAP 2:

MAP 3:

MAP 4:

# Slot 1 - ?, no gaps

# Slot N: [barcode]

# [barcode]

# a barcode is comprised of three fields: [Leading] [identifier] [Trailing]

# Leading "CLN" -- cleaning tape

# Leading "W" -- WORM tape

# Leading "NOBAR" -- will appear to have no barcode

# If the barcode is at least 8 character long, then the last two characters are Trailing

# Trailing "S3" - SDLT600

# Trailing "X4" - AIT-4

# Trailing "L1" - LTO 1, "L2" - LTO 2, "L3" - LTO 3, "L4" - LTO 4, "L5" - LTO 5

# Training "LT" - LTO 3 WORM, "LU" LTO 4 WORM, "LV" LTO 5 WORM

# Trailing "TA" - T10000+

# Trailing "JA" - 3592+

# Trailing "JB" - 3592E05+

# Trailing "JW" - WORM 3592+

# Trailing "JX" - WORM 3592E05+

#

Slot 1: E01001L3

Slot 2: E01002L3

Slot 3: E01003L3

Slot 4: E01004L3

Slot 5: E01005L3

Slot 6: E01006L3

Slot 7: E01007L3

Slot 8: E01008L3

Slot 9: E01009L3

Slot 10: E01010L3

Slot 11: E01011L3

Slot 12: E01012L3

Slot 13: E01013L3

Slot 14: E01014L3

Slot 15: E01015L3

Slot 16: E01016L3

Slot 17: E01017L3

Slot 18: E01018L3

Slot 19: E01019L3

Slot 20: E01020L3

Slot 21:

Slot 22:

Slot 23:

Slot 24:

Slot 25:

Slot 26:

Slot 27:

Slot 28:

Slot 29:

Slot 30: E01030L3

Slot 31: E01031L3

Slot 32: E01032L3

Slot 33: E01033L3

Slot 34: E01034L3

Slot 35: E01035L3

Slot 36: E01036L3

Slot 37: E01037L3

Slot 38: E01038L3

Slot 39: E01039L3

mhvtl.conf配置文件:

[root@mhvtlserver mhvtl]# more  /etc/mhvtl/mhvtl.conf

# Home directory for config file(s)

MHVTL_CONFIG_PATH=/etc/mhvtl

# Default media capacity (500 M)

CAPACITY=400000   (每盘磁带400G)

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

VERBOSE=1

# Set kernel module debuging [0|1]

VTL_DEBUG=0

修改完毕mhvtl的配置文件后,启动mhvtl:

#/etc/init.d/mhvtl start

将其添加到chkconfig中:

#chkconfig  --add  mhvtl

#chkconfig mhvtl   {on|off}  (设置自动启动,这里设置为off,然后在/etc/rc.local中启动)

查看生成的mhvtl设备:

#lsscsi  -g

[6:0:0:0]    mediumx IBM      03584L32         4.02  -         /dev/sg21

[6:0:1:0]    tape    IBM      ULTRIUM-TD3      51TB  -         /dev/sg17

[6:0:2:0]    tape    IBM      ULTRIUM-TD3      51TB  -         /dev/sg18

[6:0:3:0]    tape    IBM      ULTRIUM-TD3      51TB  -         /dev/sg19

[6:0:4:0]    tape    IBM      ULTRIUM-TD3      51TB  -         /dev/sg20 B.设备测试:

[root@mhvtlserver mhvtl]# mtx  -f  /dev/sg21  status  (/dev/sg21为03584L32 mediumx)

Storage Changer /dev/sg21: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=E01001L3

Storage Element 2:Full :VolumeTag=E01002L3

Storage Element 3:Full :VolumeTag=E01003L3

Storage Element 4:Full :VolumeTag=E01004L3

Storage Element 5:Full :VolumeTag=E01005L3

Storage Element 6:Full :VolumeTag=E01006L3

Storage Element 7:Full :VolumeTag=E01007L3

Storage Element 8:Full :VolumeTag=E01008L3

Storage Element 9:Full :VolumeTag=E01009L3

Storage Element 10:Full :VolumeTag=E01010L3

Storage Element 11:Full :VolumeTag=E01011L3

Storage Element 12:Full :VolumeTag=E01012L3

Storage Element 13:Full :VolumeTag=E01013L3

Storage Element 14:Full :VolumeTag=E01014L3

Storage Element 15:Full :VolumeTag=E01015L3

Storage Element 16:Full :VolumeTag=E01016L3

Storage Element 17:Full :VolumeTag=E01017L3

Storage Element 18:Full :VolumeTag=E01018L3

Storage Element 19:Full :VolumeTag=E01019L3

Storage Element 20:Full :VolumeTag=E01020L3

Storage Element 21:Empty

Storage Element 22:Empty

Storage Element 23:Empty

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=E01030L3

Storage Element 31:Full :VolumeTag=E01031L3

Storage Element 32:Full :VolumeTag=E01032L3

Storage Element 33:Full :VolumeTag=E01033L3

Storage Element 34:Full :VolumeTag=E01034L3

Storage Element 35:Full :VolumeTag=E01035L3

Storage Element 36:Full :VolumeTag=E01036L3

Storage Element 37:Full :VolumeTag=E01037L3

Storage Element 38:Full :VolumeTag=E01038L3

Storage Element 39:Full :VolumeTag=E01039L3

Storage Element 40 IMPORT/EXPORT:Empty

Storage Element 41 IMPORT/EXPORT:Empty

Storage Element 42 IMPORT/EXPORT:Empty

Storage Element 43 IMPORT/EXPORT:Empty

将磁带从1号槽位装入driver 0:

[root@mhvtlserver mhvtl]# mtx -f /dev/sg21 load 1 0

Loading media from Storage Element 1 into drive 0...done

[root@mhvtlserver mhvtl]# mtx -f /dev/sg21 status

Storage Changer /dev/sg21:4 Drives, 43 Slots ( 4 Import/Export )

Data Transfer Element 0:Full (Storage Element 1 Loaded):VolumeTag = E01001L3

Data Transfer Element 1:Empty

Data Transfer Element 2:Empty

Data Transfer Element 3:Empty

Storage Element 1:Empty

Storage Element 2:Full :VolumeTag=E01002L3

将磁带从drive0卸到1号槽位:

[root@mhvtlserver mhvtl]# mtx -f /dev/sg21 unload 1 0

Unloading drive 0 into Storage Element 1...done

[root@mhvtlserver mhvtl]# mtx -f /dev/sg21 status

Storage Changer /dev/sg21: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=E01001L3

读写测试:

载入39号槽位的磁带到drive 0 (/dev/IBMtape0)并读写:

[root@mhvtlserver mhvtl]# mtx -f /dev/sg21 load 39 0

Loading media from Storage Element 39 into drive 0...done

[root@mhvtlserver mhvtl]# cd /opt/mhvtl/E01039L3/

[root@mhvtlserver E01039L3]# ls -l

total 4

-rw-rw---- 1 vtl vtl    0 Aug 14 15:43 data

-rw-rw---- 1 vtl vtl    0 Aug 14 15:43 indx

-rw-rw---- 1 vtl vtl 1536 Aug 29 17:55 meta

查看

[root@mhvtlserver E01039L3]# mt  -f  /dev/IBMtape0  status

SCSI 2 tape drive:

File number=-1, block number=0, partition=0.

Tape block size 0 bytes. Density code 0x44 (LTO-3).

Soft error count since last status=0

General status bits on (41000000):

BOT ONLINE

查看没有磁带的驱动器:

[root@mhvtlserver E01039L3]# mt -f /dev/IBMtape1 status

SCSI 2 tape drive:

File number=-1, block number=-1, partition=0.

Tape block size 0 bytes. Density code 0x44 (LTO-3).

Soft error count since last status=0

General status bits on (40000):

DR_OPEN

写入磁带:

[root@mhvtlserver E01039L3]# tar  cvvf  /dev/IBMtape0 /tmp/software/RHEL6.1X86_64.iso

tar: Removing leading `/' from member names

-rw-r--r-- root/root 3600842752 2012-08-16 16:33 /tmp/software/RHEL6.1X86_64.iso

[root@mhvtlserver E01039L3]# ls -l

total 3617140

-rw-rw---- 1 vtl vtl 3520277200 Aug 29 18:20 data

-rw-rw---- 1 vtl vtl  180043264 Aug 29 18:20 indx

-rw-rw---- 1 vtl vtl       1544 Aug 29 18:20 meta

读:(列出磁带内容)

[root@mhvtlserver E01039L3]# mt -f /dev/IBMtape0 rewind

[root@mhvtlserver E01039L3]# tar tvf /dev/IBMtape0

-rw-r--r-- root/root 3600842752 2012-08-16 16:33 tmp/software/RHEL6.1X86_64.iso

擦掉磁带内容再查看:

[root@mhvtlserver E01039L3]# mt  -f  /dev/IBMtape0  erase

[root@mhvtlserver E01039L3]# tar  tvf /dev/IBMtape0

tar: /dev/IBMtape0: Cannot read: Input/output error

tar: At beginning of tape, quitting now

tar: Error is not recoverable: exiting now

[root@mhvtlserver E01039L3]# ls -l

total 4

-rw-rw---- 1 vtl vtl    0 Aug 29 18:23 data

-rw-rw---- 1 vtl vtl    0 Aug 29 18:23 indx

-rw-rw---- 1 vtl vtl 1536 Aug 29 18:23 meta

[root@mhvtlserver E01039L3]# mt -f /dev/IBMtape0  rewind

[root@mhvtlserver E01039L3]# mt -f /dev/IBMtape0  status

SCSI 2 tape drive:

File number=-1, block number=0, partition=0.

Tape block size 0 bytes. Density code 0x44 (LTO-3).

Soft error count since last status=0

General status bits on (41000000):

BOT ONLINE

将该磁带放回39号槽位:

[root@mhvtlserver E01039L3]# mtx -f  /dev/sg21  unload  39  0

Unloading drive 0 into Storage Element 39...done

[root@mhvtlserver E01039L3]# mtx  -f  /dev/sg21  status

Storage Changer /dev/sg21: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 39:Full :VolumeTag=E01039L3


http://www.ppmy.cn/news/146103.html

相关文章

linux 磁带机备份是否完成,Linux环境下磁带机的直接备份操作

Working with “mt” Commands: reading and writing to tape. The following assumes the tape device is “/dev/st0″ STEP 1 ( rewind the tape) # mt -f /dev/st0 rewind STEP 2 (check to see if you are at block 0) # mt -f /dev/st0 tell At block 0. STEP 3 (Backup …

磁带机故障灯解决方法

磁带机,错误亮灯: 如果灯亮,而不是闪,表示温度过高,以下步骤可以解决: 1:等待磁带就冷却,等磁带机冷却, 这段期间不用做任何装载和备份的操作。 如果磁带机里面有磁带,需…

linux磁带机找不到,如何在Linux下安装磁带机

安装环境: 服务器:LC2. 软件:Red Hat 6.0 (kernel: 2.2.12). 磁带机:DAT8e. 具体步骤:首先将磁带机连接在服务器上,HP的服务器中SCSI卡的类型一般为Adaptec 或者Symbios.当磁带机连接之后加电并启动服务器&…

linux设备连接磁带机,Redhat Enterprise Linux磁带机简单操作方法

Linux下使用磁带机的方式有多种,主要有通过Amanda、Tar等软件进行操作。 Amanda是提供了远程集中备份的功能,通过分别设置客户端、服务器端,实现远程集中存储备份。而Tar主要用于单机环境下,将数据直接写入磁带的备份。针对单一节…

linux虚拟磁带机管理,RHEL6 虚拟磁带机使用指南

【注意事项】 【本文档所带来的系列数据风险作者不予承担】 ################################################ # HP380 G3 DAT72 磁带机启用简明 # DB 2.2 ################################################ # 说明: #echo "engage scsi" >> /pr…

网络存储设备磁带机术语解释

​​​​​​1.存储容量 存储容量是指在数据未被压缩前磁带机所能存储的最大数据量。这个数值取决于两个因素,一是单盒磁带的存储容量,二是磁带机所能容纳的磁带数目。由于磁带机采用多种不同的备份技术所以存储容量也不一致。 2.压缩后存储容量 压缩后…

linux设备连接磁带机,Linux磁带机设备绑定

linux和windows系统下,当主机重启时设备文件名会发生变化,所以需要做绑定 linux: 使用UDEV规则绑定磁带机设备 编辑uedv规则文件 vi /etc/udev/rules.d/90-networker.rules KERNEL"sg*", BUS"scsi", PROGRAM"/sbin/scsi_id --w…

linux虚拟磁带机管理,linux虚拟磁带机

安装依赖库 先不急着安装,要先安装MHVTL的依赖库,可能这些依赖库在你的电脑上已经安装了,这里只列出我安装的时候安装的依赖库, 对于依赖库你可以在安装MHVTL的时候如果不成功会出现提示,安装之后重新安装MHVTL即可。 …