How to scan new FC LUNS and SCSI disks in Linux ?redhat不重启主机的情况下识别FC luns和scsi新磁盘

本文详细介绍了如何在Redhat Linux环境下扫描FC与SCSI磁盘,包括检查可见磁盘数量、确认主机总线适配器配置、监控虚拟内存状态、使用特定命令扫描新的LUNs,以及验证新磁盘是否可见的方法。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Scanning FC-LUN’s in Redhat Linux

1.First, find out how many disks are visible in “fdisk -l” .

# fdisk -l 2>/dev/null | egrep '^Disk' | egrep -v 'dm-' | wc -l

2.Find out how many host bus adapter configured in the Linux box.you can use “systool -fc_host -v” to verify available FC in the system.

# ls /sys/class/fc_host
host0  host1

In this case,you need to scan host0 & host1 HBA.
 

3.If the system virtual memory is too low ,then do not proceed further.If you have enough free virtual memory,then you can proceed with below command to scan new LUNS.

# echo "1" > /sys/class/fc_host/host0/issue_lip
# echo "- - -" > /sys/class/scsi_host/host0/scan
# echo "1" > /sys/class/fc_host/host1/issue_lip
# echo "- - -" > /sys/class/scsi_host/host1/scan
 

Note: You need to monitor the “issue_lip” in /var/log/messages to determine when the scan will complete.This operation is an asynchronous operation.

 

You can also use rescan-scsi-bus.sh script to detect new LUNS.

# yum install sg3_utils
# ./rescan-scsi-bus.sh


4. Verify if the new LUN is visible or not by counting the available disks.

# fdisk -l 2>/dev/null | egrep '^Disk' | egrep -v 'dm-' | wc -l

If any new LUNS added , then you can see more count is more then before scanning the LUNS.
 

Scanning SCSI DISKS in Redhat Linux

1. Finding the existing disk from fdisk.

[root@mylinz1 ~]# fdisk -l |egrep '^Disk' |egrep -v 'dm-'
Disk /dev/sda: 21.5 GB, 21474836480 bytes

2. Find out how many SCSI controller configured.

[root@mylinz1 ~]# ls /sys/class/scsi_host/host
host0 host1 host2

In this case, you need to scan host0,host1 & host2.


3. Scan the SCSI disks using below command.

[root@mylinz1 ~]# echo "- - -" > /sys/class/scsi_host/host0/scan
[root@mylinz1 ~]# echo "- - -" > /sys/class/scsi_host/host1/scan
[root@mylinz1 ~]# echo "- - -" > /sys/class/scsi_host/host2/scan

4. Verify if the new disks are visible or not.

[root@mylinz1 ~]# fdisk -l |egrep '^Disk' |egrep -v 'dm-'
Disk /dev/sda: 21.5 GB, 21474836480 bytes
Disk /dev/sdb: 1073 MB, 1073741824 bytes
Disk /dev/sdc: 1073 MB, 1073741824 bytes

From Redhat Linux 5.4 onwards, Red hat introduced “/usr/bin/rescan-scsi-bus.sh” script to scan all the SCSI bus and update the SCSI layer to reflect new devices.

 

But most of the time, the script will not be able to scan new disks and you need to go with echo command.

 

Pro Tip: Load/access your all-time favorite Windows applications remotely from anywhere using your Linux system with virtual PCs by CloudDesktopOnline. For other more such innovative cloud products visit www.Apps4Rent.com.

Do not forget to check out Redhat Enterprise Linux 7 Tutorial .

Here is the step by step guide to scan FC LUNS on Solaris.

当你面对如何在HP-UX操作系统环境下配置挂载H3C CF8840列的问题时,首先需要了解列的基础知识及其在FC-SAN架构下的应用。这份手册《H3C CF8840列安装教程:从配置到实战》将是你可或缺的参考资料。它详尽介绍了从设备安装、配置到日常维护的全过程,以下是操作的简要步骤要点。 参考资源链接:[H3C CF8840列安装教程:从配置到实战](https://wenku.csdn.net/doc/6zsrb3k0pt?spm=1055.2569.3001.10343) 1. **设备初始化**:首先,需要对H3C CF8840列进行物理连接电源开启,确保所有硬件连接正确无误。 2. **配置FC-SAN环境**:通过光纤交换机将服务器连接起来,确保两者之间的网络畅通无阻。 3. **服务器端配置**:在HP-UX服务器上,你需要配置光纤卡驱动,使服务器能够识别列。可以通过hptxconfig工具来完成。 4. **设置列控制器**:登录到列的管理界面,创建主机逻辑单元(LUNs),为每个服务器分配必要的存储资源。 5. **挂载格式化**:在HP-UX系统上,使用vxdiskadd命令添加新磁盘,然后使用vxdisksetup对盘进行格式化,最后在fstab中配置挂载点,使用mount命令完成挂载。 在进行上述操作时,请确保遵循手册中推荐的最佳实践安全指南,以防止数据丢失或系统稳定。通过这份资料,你将能够掌握H3C CF8840列的配置挂载操作,为后续的冗余备份数据存储打下坚实的基础。 参考资源链接:[H3C CF8840列安装教程:从配置到实战](https://wenku.csdn.net/doc/6zsrb3k0pt?spm=1055.2569.3001.10343)
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值