This post is more than 5 years old
155 Posts
0
992
awk question using symcli commands
I have a question on awk.
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}'
raffs1
2 Posts
0
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
$
Sanjit1
45 Posts
0
July 29th, 2010 04:00
Here is a simple way
unmap dev SymDevName[:SymDevName] from dir
DirectorNum:ALL | DirectorNum:PortNum>
[, emulation=CELERRA_FBA]
[, devmask_access=remove | retain];
rawstorage
419 Posts
0
July 29th, 2010 04:00
what is it you are trying to achieve ? there may be another way of doing this without grep and awk.
KD8EWE
155 Posts
0
July 30th, 2010 10:00
This is indeed simple way to unmap from all the FAs,
but I want some of the FAs only, should be unmapped, before that I need to check each device which are mapped, and for that I have my own script
and I want to eliminate the FAs which I dont want to be unmapped.
dynamox
1 Rookie
1 Rookie
•
20.4K Posts
0
July 30th, 2010 13:00
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 ?
ZepHead
88 Posts
1
August 2nd, 2010 19:00
Hello,
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..
KD8EWE
155 Posts
0
August 5th, 2010 08:00
Thank You Raff, Your solution worked, And giving points as Correct Answer ,Thanks for all your answers.
but From Dir all:all; can unmap the devices from all the FAs, that will be useful only if you are completely reclaiming the device from all the hosts.
These devices are already migrated from one host to another and I want to take out the FAs of previous hosts. Hope I am clear now.