How To Disable HBA Port on Linux

Sometimes you need to do troubleshooting about storage connectivity but you don’t have access to datacenter or SAN switches and you need to shutdown one of HBA ports to check server side problem. If the port was a network adapter port, disabling was to easy but what about HBA port on operating system?

Possible Solutions About Disabling HBA Port on Server

You can disable a HBA port via:

  • Disable PCI Device in BIOS utility or PCI Device setup utility (Server reboot is required).
  • Disable connected switch port
  • Disconnect the port by remove cable connection
  • Disable port via FC driver

Disable HBA Port via FC Driver

Disabling devices is too easy on Windows but Linux has own ways for administration. The below commands will works if you have QLogic adapter on RHEL/CentOS/Oracle Linux. Other vendors may have same ways on their FC driver.

Unbind HBA Port

First, you should have each port’s PCI bus number. So you can find that by the below commands:

ls -l /sys/class/fc_host

The output would be something like the below:

FC Host PCI Info Linux

Run the below command to unbind and disabling port, put PCI bus ID of each port in a single command:

echo “0000:3c:00.0” > /sys/bus/pci/drivers/qla2xxx/unbind

Bind HBA Port

To active port again:

echo “0000:3c:00.0” > /sys/bus/pci/drivers/qla2xxx/bind

See Also

How to Find EMC Unity FC Port WWN

[Script]: Find ESXi HBA WWN via PowerCLI

VMware ESXi Queue Depth – Overview, Configuration And Calculation

Davoud Teimouri

Davoud Teimouri is as a professional blogger, vExpert 2015/2016/2017/2018/2019, VCA, MCITP. This blog is started with simple posts and now, it has large following readers.

Leave a Reply

Your email address will not be published. Required fields are marked *

Subscribe to our newsletter and join other subscribers

Holler Box