硬件:
服务器:Dell PowerEdge 6650
HBA卡:Qlogic 2312
软件:
OS:RedFlag Linux DC Server 4.1 SP3 x86
mtx:mtx-1.2.18-1.i386.rpm
HBA卡驱动:
(SP1系统核心默认用的qla驱动为7.02,只要qla驱动高于或者等于7.06都可以识别到机械手)
qla2x00-7.07.06-dc4.1-sp3-ia32.tgz (邮件附件驱动包)
几点需要注意:
1.系统能否识别磁带库的机械手,主要取决于HBA的驱动;若通过HBA能够识别到磁带库的驱动器(st0)设备,而不能识别机械手,可以通过更新HBA驱动解决(HBA驱动建议用磁带库厂家提供的)
2.使用mtx作磁带库操作建议会阅读MAN文档
红旗Linux使用MSL 6000磁带库操作步骤如下:
一.更新qla驱动
1. 确认系统核心:
uname -r
2.4.21-47.22AXsmp
此显示的系统版本号为RedFlag DC Server 4.1 SP3
RedFlag DC Server 4.1 标准版,核心版本为:2.4.21-9.30
RedFlag DC Server 4.1 SP3,核心版本为:2.4.21-47.22
2. 确认QLA驱动版本型号
cat /proc/scsi/qla2300/2或者3,文件头会显示QLA Driver version
QLogic PCI to Fibre Channel Host Adapter for QLA2340 :
Firmware version: 3.03.19, Driver version 7.07.0
3.更新驱动
tar zxvf qla2x00-7.07.06-dc4.1-sp3-ia32.tgz -C /
rmmod qla2300
depmod -a
cd /lib/modules/`uname-r `/kernel/drivers/scsi
modprobe qla2300
dmesg | grep -B 10 -A 10 st0
dmesg | grep -B 10 -A 10 sg0
检测是否有st及sg设备挂载的信息,如
[1] 若系统能够识别出机械手,在cat /proc/scsi/scsi中会显示出以下信息,
[2] Model信息为磁带库型号:MSL 6000 series
[3] Type信息为Medium Changer,这个type的信息无论是HP磁带库或者IBM磁带库都为此信息
[4] 请记住cat /proc/scsi/sci信息中的“Host: scsi3 Channel: 00 Id: 00 Lun: 00”,可以以此识别系统上真正的机械手挂载点
详细的/proc/scsi/scsi信息
cat /proc/scsi/scsi
Host: scsi3 Channel: 00 Id: 00 Lun: 00
Vendor: HP Model: MSL6000 Series Rev: 0430
Type: Medium Changer ANSI SCSI revision: 02
Host: scsi3 Channel: 00 Id: 00 Lun: 01
Vendor: HP Model: Ultrium 2-SCSI Rev: F43W
Type: Sequential-Access ANSI SCSI revision: 03
Host: scsi3 Channel: 00 Id: 00 Lun: 02
Vendor: HP Model: Ultrium 2-SCSI Rev: F43W
Type: Sequential-Access ANSI SCSI revision: 03
Host: scsi3 Channel: 00 Id: 00 Lun: 03
Vendor: HP Model: Ultrium 2-SCSI Rev: F43W
Type: Sequential-Access ANSI SCSI revision: 03
Host: scsi3 Channel: 00 Id: 00 Lun: 04
Vendor: HP Model: Ultrium 2-SCSI Rev: F43W
Type: Sequential-Access ANSI SCSI revision: 03
Host: scsi3 Channel: 00 Id: 00 Lun: 05
Vendor: HP Model: NS E1200-160 Rev: 5669
Type: Unknown ANSI SCSI revision: 0
dmesg信息
st: Version 20040102, bufsize 32768, max init. bufs 4, s/g segs 16
Attached scsi tape st0 at scsi3, channel 0, id 0, lun 1
Attached scsi tape st1 at scsi3, channel 0, id 0, lun 2
Attached scsi tape st2 at scsi3, channel 0, id 0, lun 3
Attached scsi tape st3 at scsi3, channel 0, id 0, lun 4
Attached scsi generic sg1 at scsi1, channel 4, id 6, lun 0, type 3
Attached scsi generic sg42 at scsi3, channel 0, id 0, lun 0, type 8
Attached scsi generic sg47 at scsi3, channel 0, id 0, lun 5, type 1
note:一般磁带库有四个驱动器(st),一个机械手(sg),N多个slot(也就是放磁带的插槽)
[1] 从dmesg信息显示驱动器已(st[0-3])已经识别
[2] 从dmesg信息显示有三个机械手,这里就有问题,需要确认哪一个是真正的机械手
从cat /proc/scsi/scsi和dmesg的信息可以判断出哪个是真正的机械手
Host: scsi3 Channel: 00 Id: 00 Lun: 00
Vendor: HP Model: MSL6000 Series Rev: 0430
Attached scsi generic sg1 at scsi1, channel 4, id 6, lun 0, type 3
Attached scsi generic sg42 at scsi3, channel 0, id 0, lun 0, type 8
Attached scsi generic sg47 at scsi3, channel 0, id 0, lun 5, type 1
很明显,从host、channel、id、lun的设备号可以分析得出机械手是挂载在sg42上
二. 磁带库操作
1. 使用mtx包,主要用于控制机械手作导带换带、连接slot(插槽)到driver(驱动器)操作
红旗Linux DC Server 4.1有自带mtx-1.2.18-1.i386.rpm安装包,在第一张光盘,安装完之后,会在/usr/sbin/mtx
[1] mtx作检查磁带库状态操作
[root@wylonwong scsidev]#mtx -f /dev/sg42 status
Storage Changer /dev/sg42:4 Drives, 60 Slots ( 2 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
Storage Element 2:Full
Storage Element 3:Full
Storage Element 4:Full
Storage Element 5:Full
Storage Element 6:Full
Storage Element 7:Full
Storage Element 8:Full
Storage Element 9:Full
Storage Element 10:Full
Storage Element 11:Empty
Storage Element 12:Empty
Storage Element 13:Empty
Storage Element 14:Empty
Storage Element 15:Full
Storage Element 16:Full
Storage Element 17:Full
Storage Element 18:Full
Storage Element 19:Full
Storage Element 20:Full
Storage Element 21:Full
Storage Element 22:Empty
Storage Element 23:Full
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=NK0224L1
Storage Element 31:Full :VolumeTag=NK0225L1
Storage Element 32:Full
Storage Element 33:Full
Storage Element 34:Full
Storage Element 35:Full
Storage Element 36:Full
Storage Element 37:Full
Storage Element 38:Full
Storage Element 39:Full
Storage Element 40:Empty
Storage Element 41:Empty
Storage Element 42:Empty
Storage Element 43:Empty
Storage Element 44:Empty
Storage Element 45:Full
Storage Element 46:Full
Storage Element 47:Empty
Storage Element 48:Empty
Storage Element 49:Empty
Storage Element 50:Empty
Storage Element 51:Full
Storage Element 52:Full
Storage Element 53:Full
Storage Element 54:Full
Storage Element 55:Empty
Storage Element 56:Full
Storage Element 57:Full
Storage Element 58:Full
Storage Element 59 IMPORT/EXPORT:Empty
Storage Element 60 IMPORT/EXPORT:Empty
从以上信息显示4个驱动器(driver)全为空,有60个slot,其中有磁带的slot显示为Full,那么我们可以做将slot中的磁带放到驱动器中
[2] 放带操作
命令格式为mtx -f 机械手设备号 slot号 driver号
[root@wylonwong scsidev]#mtx -f /dev/sg42 load 56 0
[3] 拨带操作
[root@wylonwong scsidev]#mtx -f /dev/sg42 unload 56 0
除了以上简单操作之外,还可以实现将slot移位,如将原有的slot 56的磁带移动到50,这只是逻辑上的移动;
更详细的操作请查阅man mtx
三. 重做核心
加载QLA驱动之后,必须重启系统测试QLA驱动是否加载成功,重启之后再检查磁带机的驱动器(st)和机械手(sg)是否识别到,若识别到,一切OK
[1] 备份原先操作核心
cp -a /boot/initrd-`uname -r`.img /boot/initrd-`uname -r`-`date +%Y%m%d`.img
[2] 重做核心命令:
mkinitrd -f /boot/initrd-`uname -r`.img `uname -r`