Showing results for 
Search instead for 
Did you mean: 

Clean up file /etc/multipath/bindings

Go to solution
Valued Contributor

Clean up file /etc/multipath/bindings

I have a script that I use to make snapshots of 3PAR vv's and present them to my host. As part of the script it removes the mpath and deletes the related disks from the system. I noticed that even though I use multipath -f <mp_device> the friendly name is still held in /etc/multipath/bindings with the wwid of the disk that was last used by that name. The snapshots will have a different wwid each time, so that file will fill up overtime. I manually removed the entries from the file, but it is somehow still holding friendly names somewhere. When I first started usinf the script I was at mpathb and now I am at mpathg.


# Multipath bindings, Version : 1.0
# NOTE: this file is automatically maintained by the multipath program.
# You should not need to edit this file in normal circumstances.
# Format:
# alias wwid
mpatha 3600508b1001034323720202020200000
mpathd 350002ac92e6c1340
mpathe 350002ac92ec31340
mpathf 350002ac92ec81340

I am wondering if there is a way to recycle the names. I have been digging around google and hove not been able to find anything. ANy ideas would be appreciated.




Honored Contributor

Re: Clean up file /etc/multipath/bindings

The bindings file is literally the only thing that keeps the names from getting recycled.


Note that it says "you should not need to edit this in normal circumstances" - well, having to deal with snapshots that have new WWIDs each time apparently places you outside the programmer's idea of "normal circumstances", so feel free to edit the file. Just make sure you don't remove any lines that currently have active multipath devices associated with them.


After editing the file, restart multipathd; it reads the bindings file at startup and might be remembering the lines you've deleted from the bindings file.


Alternatively, you could switch the friendly_names off: that way, you would get the WWID numbers as multipath device names. If you have some static WWIDs and the rest are snapshots (and thus keep changing), you could still specify human-friendly alias names for the static WWIDs in /etc/multipath.conf, and let the snapshots have WWID-based names.

Valued Contributor

Re: Clean up file /etc/multipath/bindings

I ended up rebooting the server and now when I edit the bindings and wwids file it seems to be working fine. Before I would remove a friendly name and the next time it would still go to the next letter, instead of reusing the existing one. I added some lines to my script to remove the lines based on the wwid of the lun. Everything is working well. Thanks for the reply.