Dec
10
[转]红旗Linux下使用HP MSL 6060磁带库
HP MSL 6060是6000系列带库的其中一个细型号。在客户现场,原红旗DC Server 4.1 SP1 for x86通过QLA2312的HBA卡无法识别到带库的机械手设备。通过升级相应的HBA卡驱动,以及使用mtx套件,实现检查磁带库状态及使用磁带库作备份操作。
一、系统平台
硬件:
软件:
驱动下载:
SP1用的驱动:
SP3用的驱动:
注意事项:
二、更新HBA卡驱动
请根据核心版本,选择正确的驱动:
1.确认QLA驱动版本型号
# cat /proc/scsi/qla2300/2或者3,文件头会显示QLA Driver version:
2.更新驱动
检测是否有st及sg设备挂载的信息:
详细的/proc/scsi/scsi信息:
dmesg信息:
一般磁带库有四个驱动器(st),一个机械手(sg),N多个slot(也就是放磁带的插槽)
从cat /proc/scsi/scsi和dmesg的信息可以判断出哪个是真正的机械手
很明显,从host、channel、id、lun的设备号可以分析得出机械手是挂载在sg42上。
三、绑定红旗linux系统的设备名
红旗linux系统允许为设备起便于记忆的名称,但是这带来了另一个问题,每次启动新设备的名称是可变的。如果由于管理原因,某次启动没有加载磁带库驱动程序,那么下一次启动后磁带库设备的名称有可能发生变化。特别对于设备多的时候,会造成很大的麻烦。(note:似乎是udev的问题吧?)
为了避免此麻烦,建议安装使用scsidev。
scsidev的设备名是根据设备的scsi属性对应的,scsidev的设备名即使在设备不可用的时候也不改变。
下载:
1.安装
2.创建scsidev的设备名
3.得到scsidev设备
一、系统平台
硬件:
引用
服务器:Dell PowerEdge 6650
HBA卡:Qlogic 2312
HBA卡:Qlogic 2312
软件:
引用
OS:RedFlag Linux DC Server 4.1 SP1 x86
mtx:mtx-1.2.18-1.i386.rpm
HBA卡驱动:
(SP1系统核心默认用的qla驱动为7.03,SP3是7.07.04b6,所以,需要qla驱动高于或者等于7.07.04以上可以识别到机械手)
qla2x00-v7.07.06-dc4.1-sp1-ia32.tgz
hp_qla2x00-7.07.05.08-dc4.1-sp1-ia32.tgz
mtx:mtx-1.2.18-1.i386.rpm
HBA卡驱动:
(SP1系统核心默认用的qla驱动为7.03,SP3是7.07.04b6,所以,需要qla驱动高于或者等于7.07.04以上可以识别到机械手)
qla2x00-v7.07.06-dc4.1-sp1-ia32.tgz
hp_qla2x00-7.07.05.08-dc4.1-sp1-ia32.tgz
驱动下载:
SP1用的驱动:
下载文件
SP3用的驱动:
下载文件
注意事项:
引用
1.系统能否识别磁带库的机械手,主要取决于HBA的驱动;若通过HBA能够识别到磁带库的驱动器(st0)设备,而不能识别机械手,可以通过更新HBA驱动解决(HBA驱动建议用磁带库厂家提供的)
2.系统识别机械手的设备号在重启系统之后会改变,可以通过scsidev软件来绑定
3.使用mtx作磁带库操作建议会阅读MAN文档
2.系统识别机械手的设备号在重启系统之后会改变,可以通过scsidev软件来绑定
3.使用mtx作磁带库操作建议会阅读MAN文档
二、更新HBA卡驱动
请根据核心版本,选择正确的驱动:
1.确认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.03.0
Firmware version: 3.03.19, Driver version 7.03.0
2.更新驱动
# tar zxvf qla2x00-7.07.06-dc4.1-sp1-ia32.zip -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
# 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”,可以以此识别系统上真正的机械手挂载点
[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
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
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
一般磁带库有四个驱动器(st),一个机械手(sg),N多个slot(也就是放磁带的插槽)
引用
[1]从dmesg信息显示驱动器已(st[0-3])已经识别
[2]从dmesg信息显示有三个机械手,这里就有问题,需要确认哪一个是真正的机械手
[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
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上。
三、绑定红旗linux系统的设备名
红旗linux系统允许为设备起便于记忆的名称,但是这带来了另一个问题,每次启动新设备的名称是可变的。如果由于管理原因,某次启动没有加载磁带库驱动程序,那么下一次启动后磁带库设备的名称有可能发生变化。特别对于设备多的时候,会造成很大的麻烦。(note:似乎是udev的问题吧?)
为了避免此麻烦,建议安装使用scsidev。
scsidev的设备名是根据设备的scsi属性对应的,scsidev的设备名即使在设备不可用的时候也不改变。
下载:
下载文件
1.安装
引用
# tar xzf scsidev-2.22.tar.gz
# cd scsidev
# ./configure
creating cache ./config.cache
checking for gcc... gcc
checking whether the C compiler (gcc ) works... yes
checking whether the C compiler (gcc ) is a cross-compiler... no
checking whether we are using GNU C... yes
checking whether gcc accepts -g... yes
checking for working const... yes
checking how to run the C preprocessor... gcc -E
checking for linux/scsi.h... no
checking for scsi/scsi.h... yes
checking for /usr/src/linux/drivers/scsi/scsi.h... yes
checking for a BSD compatible install... /usr/bin/install -c
updating cache ./config.cache
creating ./config.status
creating Makefile
creating config.h
# make
gcc -g -O2 -Wall -DVERSION=\"2.22\" -o scsidev scsidev.c
# make install
install -o root -g root -m 755 -s scsidev /bin
install -o root -g root -m 644 scsidev.8 /usr/share/man/man8
gzip -9f /usr/share/man/man8/scsidev.8
if [ ! -d /dev/scsi ]; then mkdir /dev/scsi; fi
# install -d /usr/share/doc/packages/scsidev
# install COPYING boot.diff README scsi.alias /usr/share/doc/packages/scsidev/
# cd scsidev
# ./configure
creating cache ./config.cache
checking for gcc... gcc
checking whether the C compiler (gcc ) works... yes
checking whether the C compiler (gcc ) is a cross-compiler... no
checking whether we are using GNU C... yes
checking whether gcc accepts -g... yes
checking for working const... yes
checking how to run the C preprocessor... gcc -E
checking for linux/scsi.h... no
checking for scsi/scsi.h... yes
checking for /usr/src/linux/drivers/scsi/scsi.h... yes
checking for a BSD compatible install... /usr/bin/install -c
updating cache ./config.cache
creating ./config.status
creating Makefile
creating config.h
# make
gcc -g -O2 -Wall -DVERSION=\"2.22\" -o scsidev scsidev.c
# make install
install -o root -g root -m 755 -s scsidev /bin
install -o root -g root -m 644 scsidev.8 /usr/share/man/man8
gzip -9f /usr/share/man/man8/scsidev.8
if [ ! -d /dev/scsi ]; then mkdir /dev/scsi; fi
# install -d /usr/share/doc/packages/scsidev
# install COPYING boot.diff README scsi.alias /usr/share/doc/packages/scsidev/
2.创建scsidev的设备名
引用
# scsidev -sdn
Found /dev/scsi/sgh0-0c0i0l0 (Type 01) R on Adaptec AHA274x/284x/294x
(EISA/VLB/PCI-Fast SCSI) 5.2.4/5.2.0
Found /dev/scsi/sgh0-0c0i1l0 (Type 01) R on Adaptec AHA274x/284x/294x
(EISA/VLB/PCI-Fast SCSI) 5.2.4/5.2.0
Found /dev/scsi/sgh0-0c0i6l0 (Type 08) R on Adaptec AHA274x/284x/294x
(EISA/VLB/PCI-Fast SCSI) 5.2.4/5.2.0
Serial number of /dev/scsi/sgh0-0c0i6l0: "IBM7801954"
Serial number of /dev/scsi/sth0-0c0i1l0: "6811007030"
Serial number of /dev/scsi/sgh0-0c0i1l0: "6811007030"
Serial number of /dev/scsi/sth0-0c0i0l0: "6811020764"
Serial number of /dev/scsi/sgh0-0c0i0l0: "6811020764"
Found /dev/scsi/sgh0-0c0i0l0 (Type 01) R on Adaptec AHA274x/284x/294x
(EISA/VLB/PCI-Fast SCSI) 5.2.4/5.2.0
Found /dev/scsi/sgh0-0c0i1l0 (Type 01) R on Adaptec AHA274x/284x/294x
(EISA/VLB/PCI-Fast SCSI) 5.2.4/5.2.0
Found /dev/scsi/sgh0-0c0i6l0 (Type 08) R on Adaptec AHA274x/284x/294x
(EISA/VLB/PCI-Fast SCSI) 5.2.4/5.2.0
Serial number of /dev/scsi/sgh0-0c0i6l0: "IBM7801954"
Serial number of /dev/scsi/sth0-0c0i1l0: "6811007030"
Serial number of /dev/scsi/sgh0-0c0i1l0: "6811007030"
Serial number of /dev/scsi/sth0-0c0i0l0: "6811020764"
Serial number of /dev/scsi/sgh0-0c0i0l0: "6811020764"
3.得到scsidev设备
引用
# ls /dev/scsi/
nsth0-0c0i0l0 sgh0-0c0i0l0 sgh0-0c0i6l0 sth0-0c0i1l0
nsth0-0c0i1l0 sgh0-0c0i1l0 sth0-0c0i0l0
nsth0-0c0i0l0 sgh0-0c0i0l0 sgh0-0c0i6l0 sth0-0c0i1l0
nsth0-0c0i1l0 sgh0-0c0i1l0 sth0-0c0i0l0
内文分页: [1] [2]