MULTIPATHD(8)
πΈ MULTIPATHD(8) β the multipath daemon, explained by your fave β¨
okay so this is the multipathd(8) page from the System Manager's Manual, and bestie, it's a whole thing. buckle up π
β¨ NAME β¨
multipathd β the Multipath daemon. yep. that's the whole name section. iconic brevity honestly π
π¦ SYNOPSIS π¦
multipathd [-d] [-s] [-v verbosity] [-B] [-w]
multipathd [-v verbosity] -kcommand
multipathd [-v verbosity] -k
three whole moods, pick your fighter π₯
π DESCRIPTION π
so the multipathd daemon is the one in charge of checking for failed paths. that's its literal job, its main character energy π
when a path fails, it reconfigures the multipath map that the path belongs to, so that map gets back to its maximum performance and redundancy. like a glow-up but for storage paths, no cap π«
and then with the -k option? multipathd switches lanes entirely and acts as a client utility that sends commands to a running instance of the multipathd daemon (peep COMMANDS below, iykyk π).
π OPTIONS π
-dβ Foreground Mode. don't daemonize, and print all messages tostdoutandstderr. it's giving "i want to see everything live" π-sβ Suppress timestamps. meaning: do not prefix logging messages with a timestamp. minimalism slay β¨-vlevel β Verbosity level. prints additional information while runningmultipathd. a level of0means only print errors. a level of3or greater prints debugging information as well. crank it up for the full tea βπ₯-Bβ Read-only bindings file.multipathdwill not write to theuser_friendly_namesbindings file. and if auser_friendly_namedoesn't already exist for a device, it will use its WWID as its alias. respectful. hands off. π«Ά-kcommand βmultipathdexecutes the given command (seeCOMMANDSbelow). if the command contains whitespace or shell special characters, it needs to be quoted, like inmultipathd -k'show topology'. and bestie listen β no whitespace is allowed between the-kand the command string. that's a hard rule, periodt π
commands can also be issued without using -k. in that case, the command string should not be quoted. but command arguments that contain whitespace or special characters still need to be quoted, like in multipathd show paths format "%n %w" π¦
-kβmultipathdexecutes themultipathcinteractive shell for entering commands (seeCOMMANDSbelow). it's giving interactive era π-nβ IGNORED. like, literally ignored. use the optionfind_multipathsto control the treatment of newly detected devices bymultipathd. seemultipath.conf(5). don't come for me, it's what the page says π-wβ since kernel4.14a new device-mapper event polling interface is used for updating multipath devices on dmevents. use this flag to force it to use the old event waiting method, based on creating a separate thread for each device. vintage behaviour, lowkey π
π§ COMMUNICATING WITH MULTIPATHD π§
okay so besides the multipathd CLI, there's also the libmpathcmd library, and you can use it to send commands (see COMMANDS below) to the multipathd daemon from other programs. multitasking queen π
by default, multipathd listens on both:
- the
@/org/kernel/linux/storage/multipathdabstract namespace socket, and - the
/run/multipathd.socketsocket file
libmpathcmd will use either of these sockets to connect to multipathd. and the socket file is actually useful β it can be useful to communicate with multipathd from different namespaces since it can be bind mounted in them, unlike the abstract namespace socket. namespace travelling, we love to see it βοΈβ¨
so here's the permissions tea: multipathd will accept list|show commands from any user. all other commands must be issued by root. know your place, respectfully π
and yes, it is possible to change the sockets that multipathd listens on. details:
- if
multipathd.socketis running,multipathdwill use the sockets it listens on. - a maximum of two sockets can be defined by
multipathd.socket, and by default it listens on@/org/kernel/linux/storage/multipathdand/run/multipathd.socket. - if
multipathd.socketis not running, a single socket can be configured for listening on by setting theMULTIPATH_SOCKET_NAMEenvironment variable when startingmultipathd.
and this next bit is important, so read it twice bestie: this environment variable must also be set to makemultipathdCLI commands (or any other program usinglibmpathcmd) connect to themultipathddaemon using a non-default socket β regardless of whether that socket was set for the daemon usingmultipathd.socketor theMULTIPATH_SOCKET_NAMEenvironment variable. π€
to be continuedβ¦ more parts incoming, don't go anywhere πΈπ
π COMMANDS π
okay bestie, the following commands can be used in interactive mode β this is basically the group chat where you tell multipathd what to do, and every command below is exactly what you type:
list|show pathsβ shows the paths thatmultipathdis monitoring, plus their state.list|show paths [raw] format $formatβ shows the paths thatmultipathdis monitoring, using a format string with path format wildcards. Addingrawremoves the headers and alignment padding from the output. See "Path format wildcards" below.list|show path $pathβ shows whether path$pathis offline or running.list|show maps|multipathsβ shows the multipath devices thatmultipathdis monitoring.list|show maps|multipaths [raw] format $formatβ shows the status of all multipath devices thatmultipathdis monitoring, using a format string with multipath format wildcards. Addingrawremoves the headers and alignment padding from the output. See "Multipath format wildcards" below.list|show maps|multipaths statusβ shows the status of all multipath devices thatmultipathdis monitoring.list|show maps|multipaths statsβ shows some statistics of all multipath devices thatmultipathdis monitoring.list|show maps|multipaths topologyβ shows the current multipath topology. Same asmultipath -ll.list|show maps|multipaths jsonβ shows information about all multipath devices in JSON format.list|show topologyβ shows the current multipath topology. Same asmultipath -ll.list|show map|multipath $map topologyβ shows topology of a single multipath device specified by$map, for example36005076303ffc56200000000000010aa. This map could be obtained fromlist maps.list|show map|multipath $map [raw] format $format.β shows the status of multipath device$map, using a format string with multipath format wildcards. Addingrawremoves the headers and alignment padding from the output. See "Multipath format wildcards" below.list|show map|multipath $map jsonβ shows information about multipath device$mapin JSON format.list|show wildcardsβ shows the format wildcards used in interactive commands taking$format. See "Format Wildcards" below.list|show configβ shows the currently used configuration, derived from default values and values specified within the configuration file/etc/multipath.conf.list|show config localβ shows the currently used configuration likeshow config, but limiting the devices section to those devices that are actually present in the system.list|show blacklistβ shows the currently used blacklist rules, derived from default values and values specified within the configuration file/etc/multipath.conf.list|show devicesβ shows all available block devices by name, including the information if they are blacklisted or not.list|show statusβ shows the number of path checkers in each possible state, the number of monitored paths, and whethermultipathdis currently handling a uevent.list|show daemonβ shows the current state of themultipathddaemon.reset maps|multipaths statsβ resets the statistics of all multipath devices.reset map|multipath $map statsβ resets the statistics of multipath device$map.add path $pathβ adds a path to the list of monitored paths.$pathis as listed in/sys/block(e.g.sda).remove|del path $pathβ stops monitoring a path.$pathis as listed in/sys/block(e.g.sda).add map|multipath $mapβ adds a multipath device to the list of monitored devices.$mapcan either be a device-mapper device as listed in/sys/block(e.g.dm-0), or it can be the alias for the multipath device (e.g.mpath1), or the uid of the multipath device (e.g.36005076303ffc56200000000000010aa).remove|del maps|multipathsβ removes all multipath devices.remove|del map|multipath $mapβ removes the multipath device$map.resize map|multipath $mapβ resizes map$mapto the given size.switch|switchgroup map|multipath $map group $groupβ forces a multipath device to switch to a specific path group.$groupis the path group index, starting with1.reconfigureβ rereads the configuration and reloads all changed multipath devices. This also happens at startup, when the service is reload, or when aSIGHUPis received.reconfigure allβ rereads the configuration and reloads all multipath devices regardless of whether or not they have changed. This also happens whenmultipath -ris run.suspend map|multipath $mapβ sets map$mapinto suspend state.resume map|multipath $mapβ resumes map$mapfrom suspend state.reset map|multipath $mapβ reassign existing device-mapper table(s) use the multipath device, instead of its path devices.reload map|multipath $mapβ reloads a multipath device.fail path $pathβ sets path$pathinto failed state.reinstate path $pathβ resumes path$pathfrom failed state.disablequeueing maps|multipathsβ disables queueing on all multipath devices.restorequeueing maps|multipathsβ restores queueing to the configuredno_path_retrysetting on all multipath devices whose queueing has been previously disabled by thedisablequeueingcommand. Note: Ifno_path_path_retryis set to queue for a limited number of retries after all paths have failed, this will not enable queueing if there are no active paths.disablequeueing map|multipath $mapβ disables queuing on multipathed map$map.restorequeueing map|multipath $mapβ restores queueing to the configuredno_path_retrysetting on multipathed map$mapwhose queueing has been previously disabled by thedisablequeueingcommand. Note: Ifno_path_path_retryis set to queue for a limited number of retries after all paths have failed, this will not enable queueing if there are no active paths.forcequeueing daemonβ forcesmultipathdintoqueue_without_daemonmode, so thatno_path_retryqueueing will not be disabled when the daemon stops.restorequeueing daemonβ restores configuredqueue_without_daemonmode.setprstatus map|multipath $mapβ enables persistent reservation management on$map.setprstatus map|multipath $map pathlist $pathlistβ enables persistent reservation management on$map, and notifiesmultipathdof the paths that have been registered, so it doesn't attempt to re-register them.unsetprstatus map|multipath $mapβ disables persistent reservation management on$map.getprstatus map|multipath $mapβ gets the current persistent reservation management status of$map.getprkey map|multipath $mapβ gets the current persistent reservation key associated with$map.setprkey map|multipath $map key $keyβ sets the persistent reservation key associated with$mapto$keyin theprkeys_file. This key will only be used bymultipathdifreservation_keyis set tofilein/etc/multipath.conf.unsetprkey map|multipath $mapβ removes the persistent reservation key associated with$mapfrom theprkeys_file. This will only unset the key used bymultipathdifreservation_keyis set tofilein/etc/multipath.conf.setmarginal path $pathβ moves$pathto a marginal pathgroup. The path will remain in the marginal path group untilunsetmarginalis called. This command will only work ifmarginal_pathgroupsis enabled and there is no Shaky paths detection method configured (see themultipath.confman page for details).unsetmarginal path $pathβ returns marginal path$pathto its normal pathgroup. This command will only work ifmarginal_pathgroupsis enabled and there is no Shaky paths detection method configured (see themultipath.confman page for details).unsetmarginal map $mapβ returns all marginal paths in$mapto their normal pathgroups. This command will only work ifmarginal_pathgroupsis enabled and there is no Shaky paths detection method configured (see themultipath.confman page for details).quit|exitβ ends the interactive session.shutdownβ stopsmultipathd.
π Format Wildcards π
So multipathd has a bunch of commands that take a $format option, and those literally need a format string. That string is what decides how a device gets printed out, and it should have format wildcards in it. When the devices get printed, each wildcard gets swapped out for the actual device info. Here's the whole menu of wildcards, bestie π
β¨ Multipath format wildcards β¨
%nβ the device name.%wβ the device WWID (uuid).%dβ the device sysfs name (dm-<minor_nr>).%Fβ the device failback setting. For deferred failbacks it either includes the configured time (if a deferred failback isn't in progress) or it shows the current progress of a deferred failback in seconds.%Qβ the deviceno_path_retrysetting. Ifno_path_retryis set to a number of retries, it prints the configured number of checker retries if the device isn't in recovery mode, the number of seconds until queueing is disabled if the device is queueing in recovery mode, oroffif the device has disabled queueing.%Nβ how many active paths the device has.%rβ the device write-protect setting, eitherroorrw.%tβ the state of the device in device-mapper.suspendif the device is suspended,activeotherwise.%Sβ the device size, using the suffixesK,M,G,T, andPto stand for kilobytes, megabytes, gigabytes, terabytes, and petabytes, respectively.%fβ the"features"string of the device-mapper table in the kernel.%xβ the number of times the device has entered a state where it will fail IO. This is an alias for the%4wildcard. You can reset this value with the'reset map $map stats'command.%hβ the device table hardware handler string.%Aβ the last action multipathd took on the device. This wildcard is for debugging use, since understanding what it means requires looking at the code π%0β the number of times a path in the device has failed. Resettable with'reset map $map stats'.%1β the number of times multipathd has initiated a pathgroup switch for the device. Resettable with'reset map $map stats'.%2β the number of times multipathd has loaded a new table for the device. Resettable with'reset map $map stats'.%3β the approximate number of seconds multipathd has spent queueing with no usable paths. Resettable with'reset map $map stats'.%4β the number of times the device has entered a state where it will fail IO. This is an alias for the%xwildcard. Resettable with'reset map $map stats'.%sβ the vendor/product string for the device.%vβ the array vendor string for the device.%pβ the array product string for the device.%eβ the array firmware revision string for the device.%Gβ the foreign library used for the device, or--for native device-mapper multipath devices. Peep"FOREIGN MULTIPATH SUPPORT"in/etc/multipath.conf(5).%gβ data from vendor specific vpd pages for the device, if any. Currently multipathd supports VPD page0xc0for HPE 3PAR / Primera / Alletra storage arrays.%kβ the actualmax_sectors_kbsetting for the device (which may be different from the configured one).
π¦ Path format wildcards π¦
%wβ the device WWID (uuid).%iβ the deviceHost:Channel:Id:Lunfor SCSI devices. For NVMe devices it's the device"Controller Instance Number":"Controller ID":"Namespace Instance Number":"Namespace ID". The Controller and Namespace Instance Numbers match the NVMe device name:"nvme<Controller_Instance_Number>n<Namespace_Instance_Number>"%dβ the device sysfs name.%Dβ the device major:minor%tβ the device-mapper state of the device, eitheractiveorfailed.%oβ the offline state of the device. Shows"offline"if the device's"state"attribute in sysfs is"offline"(for SCSI) or"dead"(for NVMe). For all other sysfs states, it shows"running".%Tβ the multipathd path checker state of the device. The possible states are:readyβ the device is ready to handle IO.faultyβ the device is unusable.shakyβ the device is not able to handle IO but can still be accessed to check the priority.ghostβ the device is in stand-by state.i/o pendingβ the checker is in the process of determining the device state.i/o timeoutβ the path checker has timed out, failing the device.delayedβ the device appears usable, but it is being delayed for marginal path checking.undefβ the device either is not part of a multipath device, or its path checker has not yet run.
%sβ the vendor/product/revision string for the device.%cβ the name of the device's path checking algorithm%Cβ the progress towards the next path checker run on the device, in seconds.%pβ the device priority.%Sβ the device size, using the suffixesK,M,G,T, andPto stand for kilobytes, megabytes, gigabytes, terabytes, and petabytes, respectively.%zβ the device serial number.%Mβ the device marginal state, eithermarginalornormal.%mβ the multipath device that this device is a path of, or[offline]if this device couldn't be added to a device because it's offline, or[orphan]if it isn't part of any multipath device.%Nβ the host World Wide Node Name (WWNN) of the device, if any.%nβ the target World Wide Node Name (WWNN) of the device, if any.%Rβ the host World Wide Port Name (WWPN) of the device, if any.%rβ the target World Wide Port Name (WWPN) of the device, if any.%aβ the host adapter name for the device (only SCSI devices).%Gβ the foreign library used for the device, or--for native device-mapper multipath devices. See"FOREIGN MULTIPATH SUPPORT"in/etc/multipath.conf(5).%gβ data from vendor specific vpd pages for the device, if any. Currently multipathd supports VPD page0xc0for HPE 3PAR / Primera / Alletra storage arrays.%0β the number of times this device has failed.%Pβ the device protocol. See/etc/multipath.conf(5).%Iβ the device initialization state. Devices that have been fully initialized are shown asok.%Lβ the device SCSI LUN ID in hexadecimal format. This is only meaningful for SCSI devices.%Aβ the ALUA Target Port Group ID for the device, if applicable.%kβ the actualmax_sectors_kbsetting for the device (which may be different than the configured one).
π§ SYSTEMD INTEGRATION π§
When it's compiled with systemd support, two systemd service files get installed: multipathd.service and multipathd.socket. If enabled, the multipathd.socket service tells systemd to intercept the CLI command socket, so any call to the CLI interface will start up the daemon if it's needed. The multipathd.service file holds the definitions for controlling the multipath daemon. The daemon itself uses the sd_notify(3) interface to talk to systemd. These are the unit keywords it recognizes:
WatchdogSec=β enables the internal watchdog from systemd. multipath will send a notification viasd_notify(3)to systemd to reset the watchdog. If specified, thepolling_intervalandmax_polling_intervalsettings get overridden by the watchdog settings πΈ
Heads up bestie: systemd prior to version207has issues which prevent the systemd-provided watchdog from working correctly. So the watchdog is not enabled per default β you have to enable it manually by updating themultipathd.servicefile.
OOMScoreAdjust=β overrides the internal OOM adjust mechanism.LimitNOFILE=β overrides themax_fdsconfiguration setting.
π SEE ALSO π
multipathc(8), multipath(8), kpartx(8), sd_notify(3), systemd.service(5).
π AUTHORS π
multipath-tools was developed by Christophe Varoqui <christophe.varoqui@opensvc.com> and others.
And that's the whole page, friend!! π«Ά This one's from the Linux gang, dated 2024-05-29, and it's MULTIPATHD(8) β go forth and slay your storage, you've got this π
β¨
π¦ where this page comes from
- arch rolling: multipath-tools 0.15.1-1 Β· GPL-2.0-or-later AND GPL-3.0-or-later AND LGPL-2.0-or-later AND LGPL-2.1-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms