I need to unmap some of the devices from the FAs using the below line to eliminate the FAs which I want to keep. but it is not working as desired. can any one help me with this awk statement?
symdev -sid XX show $i | grep FA | awk ' $5 != "9a:0" || $5 !="8a:0" {print $4,$5,$9}'
would it be faster to dump info with "symdev list -sid 123 -FA XX -p X" and then run your device list through a loop and grep them out from the FAs dump files ?
Sanjit is right, you can designate specific directors and ports (not just ALL:ALL) for unmapping - which is quite common for a variety of reasons.. See the "Array Controls" guide for more information. But appears you know this.
My suggestion is to first make a run through this manually and using the "preview" option for symconfigure. Pulling out devices from FA ports when not expected is of course dangerous - especially with filesystems, VG's, etc..
However, I believe what you are trying to do is list all devices on a specific array that is mapped: "symdev -sid xxxx list -multiport" and on the flip side you have the "-noport" for devices that are not mapped..
Give it a shot, review the output and perhaps this will help in a different angle. Let me know if I am in the ballpark of what you are trying to achieve..
raffs1
2 Posts
630
0
Posted July 28th, 2010 23:00
you don't have to use awk, egrep -v will suffice....
$symdev -sid xxxx show 1234 | grep -w "FA" | egrep -v "9a:0|8a:0" | awk '{ print $4,$5,$9}'
FA 07C:1 114
FA 10C:1 114
$