• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

Understanding multipath Utility to Configure DM-Multipath

by admin

The multipath utility is the device mapper target auto-configurator, which is used to detect and configure multiple paths to devices. Use the following command to display usage:

# multipath -h
multipath-tools v0.4.9 (05/33, 2016)
Usage:
  multipath [-a|-A|-c|-w|-W] [-d] [-T tm:val] [-r] [-i] [-v lvl] [-p pol] [-b fil] [-q] [dev]
  multipath -l|-ll|-f [-v lvl] [-b fil] [dev]
  multipath -F [-v lvl]
  multipath -t
  multipath -h

Where:
  -h      print this usage text
  -l      show multipath topology (sysfs and DM info)
  -ll     show multipath topology (maximum info)
  -f      flush a multipath device map
  -F      flush all multipath device maps
  -a      add a device wwid to the wwids file
  -A      add devices from kernel command line mpath.wwids
          parameters to wwids file
  -c      check if a device should be a path in a multipath device
  -T tm:val
          check if tm matches the multipathd timestamp. If so val is
          whether or not the device is a path in a multipath device
  -q      allow queue_if_no_path when multipathd is not running
  -d      dry run, do not create or update devmaps
  -t      dump internal hardware table
  -r      force devmap reload
  -i      ignore wwids file
  -B      treat the bindings file as read only
  -b fil  bindings file location
  -w      remove a device from the wwids file
  -W      reset the wwids file include only the current devices
  -p pol  force all maps to specified path grouping policy :
          . failover            one path per priority group
          . multibus            all paths in one priority group
          . group_by_serial     one priority group per serial
          . group_by_prio       one priority group per priority lvl
          . group_by_node_name  one priority group per target node
  -v lvl  verbosity level
          . 0 no output
          . 1 print created devmap names only
          . 2 default verbosity
          . 3 print debug information
  dev     action limited to:
          . multipath named 'dev' (ex: mpath0) or
          . multipath whose wwid is 'dev' (ex: 60051..)
          . multipath including the path named 'dev' (ex: /dev/sda)
          . multipath including the path with maj:min 'dev' (ex: 8:0)

Some of the available options are described as follows:

  • -v [verbosity] – Specify the verbosity level when displaying paths and multipaths.
  • -l – List the multipath topology.
  • -ll – List the maximum multipath topology information.
  • -f – Flush a multipath device map. Use –F to flush all multipath device maps.
  • -c – Check if a device should be a path in a multipath device.
  • -p failover | multibus | group_by_serial | group_by_prio |group_by_node_name – Force all maps to the specified path grouping policy.
  • -r – Force device map reload.

You can optionally specify a device name to update only the device map that contains the specified device. Use the /dev/sd# format, the major:minor format, the multipath map name (for example, mpathN), or the WWID to specify a device.

A sample output of the multipath –ll command is as follows:

# multipath -ll
...
mpathb(36001405346939038cc9480caf0dd9a9d) dm-3 LIO-ORG ,IBLOCK size=10g features=‘0’ hwhandler=‘0’ wp=rw
‘-+- policy=‘service-time 0’ prio=1 status=active
‘- 2:0:0:2 sdb 8:16 active ready running 

mpatha(36001405a7c28190541f4d61880050090) dm-2 LIO-ORG ,IBLOCK size=10g features=‘0’ hwhandler=‘0’ wp=rw
‘-+- policy=‘service-time 0’ prio=1 status=active
      ‘- 2:0:0:1 sda 8:0     active ready running
...

The output for mpathb is described as follows:

  • mpathb – User-friendly device name
  • 36001405346939038cc9480caf0dd9a9d – Unique WWID
  • dm-3 – sysfs file name
  • LIO-ORG – Vendor name
  • IBLOCK – Linux BLOCK device
  • size=10g – Size of the DM device
  • features=‘0’ – DM features supported
  • hwhandler=‘0’ – Hardware handler
  • wp=rw – Write permission, set to read-write
  • policy=‘service-time 0’ – Path selector algorithm
  • prio=1 – Path group priority
  • status=active – Path group state
  • 2:0:0:2 – SCSI information: host, channel, scsi_id, and LUN
  • sdb – Linux device name
  • 8:16 – Major and minor numbers
  • active ready running – DM path and physical path state
Beginners guide to Device Mapper (DM) multipathing

Filed Under: CentOS/RHEL 6, CentOS/RHEL 7, Linux

Some more articles you might also be interested in …

  1. How to configure NTP to fall back to local system clock source in CentOS/RHEL
  2. lxterminal: command not found
  3. df Command Examples in Linux
  4. more: command not found
  5. Image optimization with webp
  6. Beginners guide to Apache HTTP Server – Installation and Configuration
  7. Linux OS Service ‘named’
  8. check-support-status: Command Examples in Linux
  9. CentOS / RHEL 6 : How to password protect grub (Password-Protected Booting)
  10. copyq: Clipboard manager with advanced features

You May Also Like

Primary Sidebar

Recent Posts

  • ctags: Generates an index (or tag) file of language objects found in source files for many popular programming languages
  • csvtool: Utility to filter and extract data from CSV formatted sources
  • csvstat: Print descriptive statistics for all columns in a CSV file
  • csvsql: Generate SQL statements for a CSV file or execute those statements directly on a database

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright