• 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

“map in use” error while removing multipath device in CentOS/RHEL

by admin

The multipathd -k command is an interactive interface to the multipathd daemon. Entering this command brings up an interactive multipath console. After entering this command, you can enter help to get a list of available commands, you can enter a interactive command, or you can enter CTRL-D to quit.

The multipathd interactive console can be used to troubleshoot problems you may be having with your system.

The Problem

Using multipathd -k interface you can add/remove a particular path from the multipath map. Attempting to remove a device map fails with the following error:

# multipath -f mpath1
Jan 1 09:00:00 | mpath1: map in use
# dmsetup remove -f mpath1
device-mapper: remove ioctl on mpath1 failed: Device or resource busy

The Solution

The map in use message denotes that the device map is still in use by a specific process or storage layer e.g. LVM, RAID, etc.

1. Use the mount command to verify the device is not still mounted. For example:

# mount

2. Use the dmsetup command to identify the current device/map mapping:

# dmsetup table | grep [DEVICE NAME]

Ensure no other mapped device are using the device.

3. Identify the kernel device name (dm-X) in /dev/mapper/:

# ls -l /dev/mapper | grep [DEVICE NAME]
 [DEVICE NAME] -> dm-X

4. Use the lsof command to determine which process may be using the device.

# lsof | grep dm-x
# lsof | grep [DEVICE NAME]

If the output above denotes any process(es) using the device, shutdown the application or program. Should that fail, consider killing the process.

# kill -9 [PID]

5. If the issue persists still, use the below command to disable queueing for the problematic multipath device.

# multipathd disablequeueing map mpath1
Note: There may be cases where a process remains indefinitely stuck (e.g. uninterruptable D state) within the kernel stack. In this instance, rebooting the system may be the only method possible to address the issue.

Filed Under: CentOS/RHEL, Linux

Some more articles you might also be interested in …

  1. Secure Shell: Chrome Web Browser ssh client
  2. modprobe: command not found
  3. /var/log/chrony Directory Empty in CentOS/RHEL
  4. CentOS / RHEL : How to make iptable rules persist across reboots
  5. How to extend ASM disk from OS level in CentOS/RHEL
  6. Linux OS Service ‘smartd’
  7. CentOS / RHEL 7 : How to create an Network Bonding (NIC teaming) using nmcli
  8. 520000 – FAQ: Valuated special stock
  9. dpkg-scanpackages: command not found
  10. swapon: command not found

You May Also Like

Primary Sidebar

Recent Posts

  • powertop Command Examples in Linux
  • powertop: command not found
  • powerstat: command not found
  • powerstat Command Examples in Linux

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright