1752806 Members
5938 Online
108789 Solutions
New Discussion юеВ

multipath

 
ossupport55
Frequent Advisor

multipath

Dear all, In DM-Multipath is there a way that i could offline all the devices in one path rather than doing it one-by-one?
cheers
6 REPLIES 6
dirk dierickx
Honored Contributor

Re: multipath

not that i know of, but you can write a simple script for it.
F Verschuren
Esteemed Contributor

Re: multipath

you can built the script as follows:


"command to list your devices" |while reand line
do
"command to offline the divices" $line
done
Van Cotoco
Advisor

Re: multipath

Let me get one step back, how do I take a single path offline using dm multipath command?

Then how do I put it back online?

I need to change the domain ID of a Switch so I need to take the switch offline.

Before that, I want to make sure all i/o through that switch are stopped.

OS is RHEL 5 and RHEL 6

 

Thanks,

Van

 

Matti_Kurkela
Honored Contributor

Re: multipath

In RHEL 5. you'll need a version of dm-multipath that is patched to support the -k option of multipathd; I think it was added at about RHEL 5.4. In RHEL 6, this functionality was included in the initial release.


Edit: sorry, the -k option was added to multipathd in the middle of the RHEL 4 release cycle, so it should be included with both RHEL 5 and 6 of any patch level.

 

For example, to stop all I/O through /dev/sdx, you can run:

# multipathd -k 
multipathd> del path sdx
multipathd>

 To exit the multipathd> command prompt, press Control-D.

 

To re-enable:

# multipathd -k
multipathd> add path sdx
multipathd>
MK
Van Cotoco
Advisor

Re: multipath

Hi MK:

 

Thanks for directing me to the multipathd -k command.

From the manual, del path  stops monitoring a path, and add path puts back the path to list of monitored paths.

 

There is another pair of commands.

fail path sets the path into failed state.

reinstate path  resumes path from failed state.

 

Should I use fail path and reinstate path instead?

 

Thanks for sharing your experience.

 

Van

 

Matti_Kurkela
Honored Contributor

Re: multipath

Hmm... my test VM did not have those commands, but they sound even better for your purpose than using the add/del path commands. Try them... if they work, fine, if not, you can use add/del path instead.

 

Looks like I've got to update my test VM!

MK