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:

1# vi /etc/multipath.conf
2...
3ESC ZZ
4
5# service multipathd reload

Afterwards, the device was removed from the multipath topology:

1# 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:

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

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

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

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

1# dmsetup remove -f mpathf
2# multipath -f mpathf

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

Translations: