RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 849652 - multipath -f <device name> says "map in use"
Summary: multipath -f <device name> says "map in use"
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: device-mapper-multipath
Version: 6.5
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Ben Marzinski
QA Contact: Red Hat Kernel QE team
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-08-20 13:29 UTC by Ralf Wagner
Modified: 2016-09-12 16:18 UTC (History)
10 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-10-14 14:25:33 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Ralf Wagner 2012-08-20 13:29:35 UTC
Hi,

i try to remove a storage device on a standard 6.3 RHEL system according to this guide:

http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/5/html/Online_Storage_Reconfiguration_Guide/removing_devices.html

umounting succeeded, lvm is not used on that device.

the command: multipath   -f <device name> s 

says "map in use" instead of flushing the device.

how can i fix this?

regards

ralph

Comment 2 Ben Marzinski 2012-08-21 15:29:48 UTC
Did you run

# multipath -f <device_name>

instead of

# multipath -f <path_to_device>

multipath was recently fixed to work with a path to the device. Before that, removing by path failed.

Otherwise, could you try checking with lsof and fuser to make sure the device isn't in use by some process.

You could also look at

/sys/block/<dm-id>/holders/

If you have kpartx devices, could you try forcibly removing them with

# kpartx -d <path_to_device>

and then try removing the multipath device.  If that works, then there would appear to be a bug dealing with the kpartx partitions, which are built on top of the device.

Comment 3 Ralf Wagner 2012-08-22 14:38:13 UTC
Hi Ben,

thanks for your reply.

- i did run 

# multipath -f <device_name>

and not

# multipath -f <path_to_device>

- lsof /dev/mapper/<device name> --> empty

- ls /sys/block/dm-<number>/holders/ --> empty

there were no partitions on the lun, so i guess kpartx isnt involved

any other things to check?

regards, ralf

Comment 4 Ben Marzinski 2012-08-23 21:44:02 UTC
Hrm... How about this. Can you run

# dmsetup info <device_name>

Is Open count 0? If so then multipath should be able to remove it.  If not, then something is holding onto the device according to the kernel, and multipath will not be able to remove it.

If Open count is 0, you can run

# dmsetup remove <device_name>

To remove the device.  This shouldn't change anything at all, but you can run

# service multipathd stop

to stop multipathd if it's running, just to be certain that it has nothing to do with the open device.

Comment 5 Ralf Wagner 2012-08-24 09:50:34 UTC
dmsetup info <device_name> shows:

....
Open count:        1
....

how can this be explained, as lsof did not find any open files on that device?

Comment 6 Ben Marzinski 2012-08-28 18:59:03 UTC
I'm really not sure.

Can you run

# losetup -a

To make sure you don't have a loop device opened on it. And run

# dmsetup table

and make sure that the device isn't listed in another device's table. The problem is that both of these should show up as holders.

Is multipathd running?  If so, could you stop it, and then try removing the device.  I don't have high hopes for this, but it's worth a chance.

Here's a thought.  The only thing I can think of that doesn't make
a device show up in holders or a process show up in fuser or lsof but keeps
the device open is mounting it.  So, my best guess is that it's mounted.

# df

should show you if it's mounted in general.  However, if a process has set up a private namespace it can inherit mounts of devices.  Multipath did this in RHEL 5, and so it was able to keep devices open even when they didn't appear to be
mounted with df.  However in RHEL6, that doesn't happen.  But some other process could be doing it.  I don't have an idea which one it could be.

You could check this by running something like

# grep <device_path> /proc/*/mounts

and seeing if any processes list the device as mounted.

Comment 7 Ben Marzinski 2012-10-11 02:42:43 UTC
Did you ever figure out what was keeping the device open?

Comment 8 RHEL Program Management 2012-12-14 08:50:29 UTC
This request was not resolved in time for the current release.
Red Hat invites you to ask your support representative to
propose this request, if still desired, for consideration in
the next release of Red Hat Enterprise Linux.

Comment 9 Ben Marzinski 2015-10-14 14:25:33 UTC
There are many reasons why a map may be in use. Without more information I don't have any reason to believe this is a multipath bug.


Note You need to log in before you can comment on or make changes to this bug.