Re: Clean up file /etc/multipath/bindings (939 Views)
Reply
Valued Contributor
feeble
Posts: 33
Registered: ‎06-30-2011
Message 1 of 3 (954 Views)
Accepted Solution

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.

 

Thanks,

Court

Please use plain text.
Honored Contributor
Matti_Kurkela
Posts: 6,271
Registered: ‎12-02-2001
Message 2 of 3 (945 Views)

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.

MK
Please use plain text.
Valued Contributor
feeble
Posts: 33
Registered: ‎06-30-2011
Message 3 of 3 (939 Views)

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.
Please use plain text.
The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation