当前位置: 首页 > Conf, Linux > 正文

Check and list luns attached to HBA in RHEL6

http://fibrevillage.com/storage/8-check-and-list-luns-attached-to-hba-in-rhel6

This article will show you the mapping from physical HBA card to luns, I use SAN as example below, in general, it’s also applys to any other devices whichever use sysfs, for example direct sas connect.

First, use lspci get HBA card  info installed on the host

HBA detail info

It tells you that one HBA card in PCI slot2, two FC ports

Find pci slot and scsi_host mapping

You can easily tell that the first port of pcs slot 2(15:00.0) mapped to host5, the other mapped to host6

Find target luns by HBA port

Once you know the pci info of a HBA card, then you can find its port0 target luns or SAN devices.

Note 41:00.0 is used in this case

It should be consistent with the devices in /proc/scsi/scsi

Note: if use the command for sas direct attached devices, change ‘rport’ to ‘port’, same applies to the example below.

Find block devices

If you are only interested in block devices, like tape drive, disk lun or cd rom, here is a way similar.

Reverse search, find the physical port that a lun connected to

/proc/scsi/scsi doesn’t tell you which physical port target luns are connected to In the reverse look, for a given device name, for example /dev/sdd, how do I know which hba port it connected to?

Is is clear?

Or
Multipath also can tell you some hint

Get HBA WWNA info:

Dynamically insert and remove SCSI devices

If a newer kernel and the /proc file system is running, a non-busy device can be removed and installed ‘on the fly’.

To hot remove a SCSI device:

and similar, to hot add a SCSI device, do

where

See this article for more detail about SCSI device scan,rescan,delete

If you think it’s too complicated to remember, here is a sysfs Fibre channel tool set.

本文固定链接: http://t.yjsec.com/index.php/2018/03/02/410/ | 下一站

该日志由 admin 于2018年03月02日发表在 Conf, Linux 分类下, 你可以发表评论,并在保留原文地址及作者的情况下引用到你的网站或博客。
原创文章转载请注明: Check and list luns attached to HBA in RHEL6 | 下一站

Check and list luns attached to HBA in RHEL6:等您坐沙发呢!

发表评论

快捷键:Ctrl+Enter