15 Linux multipath examples for Linux admin

Updated: Dec 23, 2020

Linux Multipath command is used to manage storage SAN (storage area network) disks on OS side. Linux multipath provides a way of organizing the I/O paths logically, by creating a single multipath device on top of the underlying devices.



Flush/Remove all the multipath device on Linux

# multipath -F

Flush/Remove selected multipath device

First of all the the WWID of the multipath device which you want to flush using multipath -ll

# multipath -ll
3600c0ff00013b88fdc53e35a01000000 dm-0 PURE      ,P2000 G3 FC
size=186G features='1 queue_if_no_path' hwhandler='0' wp=rw
|-+- policy='service-time 0' prio=50 status=active
| |- 1:0:0:0 sda 8:0  active ready running
| `- 2:0:1:0 sdd 8:48 active ready running
`-+- policy='service-time 0' prio=10 status=enabled
  |- 1:0:1:0 sdb 8:16 active ready running
  `- 2:0:0:0 sdc 8:32 active ready running
Next flush the selected multipath using below command

# multipath -f 3600c0ff000144876065be35a01000000
NOTE: This multipath must not be in used state

Show the existing multipath configuration in detail on Linux

Below command will show the existing configuration loaded on your Linux box

# multipathd show config


How to Get complete HBA details on Linux

systool uses APIs provided by libsysfs to gather information and will give detailed information about the available HBA and the LUN status


NOTE: systool is delivered with sysfsutils rpm so make sure it is installed before using this tool


# systool -c fc_host -v
Class = "fc_host"
  Class Device = "host0"
  Class Device path = "/sys/devices/pci0000:00/0000:00:02.0/0000:04:00.2/host0/fc_host/host0"
    active_fc4s         = "0x00 0x00 0x01 0x00 0x00 0x00 0x00 0x01 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 "
    dev_loss_tmo        = "30"
    fabric_name         = "0x2003547fee1188d9"
    issue_lip           = <store method only>
    max_npiv_vports     = "255"
    maxframe_size       = "2048 bytes"
    node_name           = "0x50060b0000c2a67d"
    npiv_vports_inuse   = "0"
    port_id             = "0x310305"
    port_name           = "0x50060b0000c2a67c"
    port_state          = "Online"
    port_type           = "NPort (fabric via point-to-point)"
    speed               = "unknown"
    supported_classes   = "Class 3"
    supported_fc4s      = "0x00 0x00 0x01 0x00 0x00 0x00 0x00 0x01 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 "
    supported_speeds    = "10 Gbit"
    symbolic_name       = "Emulex 554FLB FV11.1.183.23 DV11.2.0.6 HN:ban33-be002-2b OS:Linux"
    tgtid_bind_type     = "wwpn (World Wide Port Name)"
    uevent              =
    vport_create        = <store method only>
    vport_delete        = <store method only>

    Device = "host0"
    Device path = "/sys/devices/pci0000:00/0000:00:02.0/0000:04:00.2/host0"
      uevent              = "DEVTYPE=scsi_host"

  Class Device = "host1"
  Class Device path = "/sys/devices/pci0000:00/0000:00:02.0/0000:04:00.3/host1/fc_host/host1"
    active_fc4s         = "0x00 0x00 0x01 0x00 0x00 0x00 0x00 0x01 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 "
    dev_loss_tmo        = "30"
    fabric_name         = "0x2003547fee357a81"
    issue_lip           = <store method only>
    max_npiv_vports     = "255"
    maxframe_size       = "2048 bytes"
    node_name           = "0x50060b0000c2a67f"
    npiv_vports_inuse   = "0"
    port_id             = "0x25030f"
    port_name           = "0x50060b0000c2a67e"
    port_state          = "Online"
    port_type           = "NPort (fabric via point-to-point)"
    speed               = "unknown"
    supported_classes   = "Class 3"
    supported_fc4s      = "0x00 0x00 0x01 0x00 0x00 0x00 0x00 0x01 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 "
    supported_speeds    = "10 Gbit"
    symbolic_name       = "Emulex 554FLB FV11.1.183.23 DV11.2.0.6 HN:ban33-be002-2b OS:Linux"
    tgtid_bind_type     = "wwpn (World Wide Port Name)"
    uevent              =
    vport_create        = <store method only>
    vport_delete        = <store method only>

    Device = "host1"
    Device path = "/sys/devices/pci0000:00/0000:00:02.0/0000:04:00.3/host1"
      uevent              = "DEVTYPE=scsi_host"


47 views

Join our mail group. Get a free Linux account on Cloud.

Never miss a post!

Want a free Linux account?  This account can be used to login to our cloud server and practice Linux commands.

 
kamateravps.gif
topbackgroud.png

✔ Linux Commands   ✔ Linux Skills    ✔ LinuxPerformance   ✔ Linux Interview

Some articles are from the public internet. If you find your article misused or undesired here and you don't want us to display it, please let us know and we'll remove it immediately.