关于SLES动态加载存储或磁带设备

SLES动态添加存储及多路径配置
本文介绍如何在SLES系统中动态添加存储并设置多路径I/O,无需重启系统。通过特定命令使HBA卡重新扫描SAN,识别新增的存储区域,并通过中间层SCSI子系统使新设备可见。

地址:http://www.52zhe.cn/read.php/224.htm

内容:
之前曾经写过一个利用Qlogic官方的脚本,识别新设备的文章,链接如下:http://www.52zhe.cn/read.php/189.htm

适用情况:经常会有客户扩容,增加存储的Lun,multipath,或者存储交换机调整,再或者磁带什么调整之类的。这个时候重启会解决所有问题。自动重新识别新增的设备。可是有的时候主机就是不能重启。

实际情况:最近做的客户磁带在调整交换机层,系统识别到了新增的磁带设备,但是设备ID号码增加,原来的设备ID仍然存在。这个时候就是混乱的状态了,因为0-5的设备ID已经应该是不存在的了,新的设备ID从6-11开始。重启肯定可以解决问题。现场的时候,由于时间比较紧,当时准备不充分,以为重新加载一下st模块就可以了,其实完全不是那么回事。必须让HBA卡重新加载一遍识别的设备才可以,所以当时先用重启解决问题。

目的:我们要做到不重启,然后删除掉旧的ID,让新的ID从0开始,而非6开始。由于当时没有机会验证,下面的相关方案是为了下次做的时候验证。

注意:存储抑或磁带,肯定都是在使用中的,存在IO,确保应用服务已经关闭,其中的连接都被关闭。要么卸载,要么应用的备份软件已经关闭。

引用

相关链接
http://www.novell.com/support/search.do?searchString=3955167

1:Dynamically adding storage for use with multipath I/O   
2:Troubleshooting SCSI (LUN) scanning issues
3:Troubleshooting SLES Multipathing (MPIO) problems

http://www.novell.com/support/search.do?searchString=3000817

 


总结如下:

sles9
A: Qlogic HBA
echo "scsi-qlascan" > /proc/scsi/qla2300/0
echo "scsi-qlascan" > /proc/scsi/qla2300/1
B: EmuleX HBA
echo 1 > /sys/class/scsi_host/host0/issue_lip
echo 1 > /sys/class/scsi_host/host1/issue_lip

sles10
way1:
echo 1 > /sys/class/fc_host/host0/issue_lip
echo 1 > /sys/class/fc_host/host1/issue_lip
way2:
echo "- - -" > /sys/class/scsi_host/host0/scan
echo "- - -" > /sys/class/scsi_host/host1/scan

具体操作,看自己的具体情况,是不是多路径,有几个hba卡。

 

原文如下:

Dynamically adding storage for use with multipath I/O

This document (3000817) is provided subject to the disclaimer at the end of this document.
Environment
SUSE Linux Enterprise Server 10
SUSE Linux Enterprise Server 9
Novell Open Enterprise Server (Linux based)

SAN suited for multiple paths to storage

The Linux installation has already been configured to use Device-Mapper Multipath I/O (DM-MPIO) per the article "How to setup / use multipathing on SLES".

The Linux driver for the host base adapters (HBAs) on the system supports rescanning the HBA to detect the addition or deletion of storage areas ("SAN disks"). For example, a QLogic or Emulex HBA is being used.

The system has been booted with kernel parameters for SCSI device scanning that are appropriate for the SCSI device numbering plan being followed in the SAN and for the SCSI levels reported by the HBAs as discussed in TID 3955167 - Troubleshooting SCSI (LUN) scanning issues.
Situation
Purpose
Adding SAN storage to the Linux system and setting up multiple I/O paths to it without needing to reboot the system.
Resolution
Follow these steps to allocate new storage on the SAN, make it visible to the Linux system and use it to create new filesystems or to expand existing filesystems residing on logical volumes:
Allocate the storage on the SAN and update its access control settings to allow the Linux system access to the new storage. How this is done in detail is highly dependent on the components of the SAN and its architecture; refer to the SAN vendor's documentation for details.

On the Linux system, instruct the HBA driver to rescan the SAN to discover the new storage area ("LUN"). The exact commands depend on the kernel version and driver.

With SLES10, a LIP (Loop Initialization Procedure) can be issued to both Qlogic and Emulex drivers through sysfs:
echo 1 > /sys/class/fc_host/host/issue_lip

With SLES9 and OES/Linux, the Qlogic and Emulex drivers require different commands for rescanning. For example, for a QLogic 2300 HBA, the command is
echo scsi-qlascan > /proc/scsi/qla2xxx/
whereas for an Emulex HBA, it is
echo 1 > /sys/class/scsi_host/host/issue_lip

If the HBA driver supports it, check that the new disk is seen by the HBA driver correctly (at this point, the newly added LUN will not yet be known to the higher layers of the Linux kernel's SCSI subsystem and will not yet be usable).

With SLES10, after the LIP, a directory for the new disk should have been created under /sys/class/fc_remote_ports/ containing information such as port ID and port name.

With SLES9 or OES/Linux, for a QLogic 2300 HBA, run
less /proc/scsi/qla2xxx/
and check the "SCSI LUN information" section. The entries for the newly added disks are indicated by a "*" after the flags.
Unfortunately, there is no equivalent for Emulex cards.

Make the new device known to the middle layer of the Linux kernel's SCSI subsystem. This can be done in two ways.
Through the
rescan-scsi-bus.sh
command which rescans the SCSI subsystem for changes. Depending on the SCSI device numbering plan in use, arguments may need to be used to enlarge the scope of the search or to control it more carefully, e.g through
rescan-scsi-bus.sh -l -w -c
which will search LUNs other than 0, scan for more device IDs and for more channels, or through
rescan-scsi-bus.sh --hosts="hostlist" --channels="channellist" --ids="idlist" --luns="lunlist"
Alternatively, one can
echo "scsi add-single-device 0 1 2 3" > /proc/scsi/scsi
to add the storage with host ID 0, channel ID 1, target ID 2, LUN ID 3, or, with kernel 2.6.5-7.257 or newer,
echo "- - -" > /sys/class/scsi_host/host/scan
to rescan all targets on a host.

Run
multipath
to have the new devices be picked up for DM-MPIO.
Examine /dev/disk/by-id to identify the persistent device names for the new storage area(s) and use the persistent device names for further operations (including filesystem creation and addition to /etc/fstab).
If LVM is to be used for the new storage area(s), configure LVM at this point, either through YaST or using the LVM command line tools, starting with pvcreate.

 

I got this from Metalink Note:603868.1

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/611609/viewspace-620146/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/611609/viewspace-620146/

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符  | 博主筛选后可见
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值