Short tip: Removing orphaned SAN multipath devices under Enterprise Linux

Recently, I had to remove a SAN LUN on a physical Enterprise Linux system. The first step was to alter the multipath service configuration file (/etc/multipath.conf) and make the daemon reload its configuration:

# vi /etc/multipath.conf
...
ESC ZZ
# service multipathd reload

Afterwards, the device was removed from the multipath topology:

# multipath -l

After removing the LUN in the SAN backend, a unnamed LUN was added to the multipath topology. Removing this device was not possible as it seemed to be in use:

# multipath -f mpathf
May 04 23:32:31 | mpathf: map in use

As expected – the multipath topology listed that the SAN paths were removed:

# multipath -l
...
mpathf (xxx) dm-0 IBM,1337XIV
size=20G features='1 queue_if_no_path' hwhandler='0' wp=rw
`-+- policy='round-robin 0' prio=1 status=active
|- 1:0:6:1 sdi 8:118 failed faulty running
|- 0:0:9:1 sdf 8:80 failed faulty running
|- 1:0:7:1 sdj 8:134 failed faulty running
|- 0:0:6:1 sda 8:0 failed faulty running

To remove the dead device, the following commands needed to be executed:

# dmsetup remove -f mpathf
# multipath -f mpathf

The first command removed the device mapper drive while the second one removed the drive from the multipath configuration.

Sharing is caring

Leave a Reply