Unsolved

This post is more than 5 years old

28 Posts

2851

October 29th, 2007 05:00

Identify what app is using device before removing dead device from PPath

Hello there!

Every now and then I need to remove devices from PowerPath under Solaris. Sometimes there are applications managing these devices, and PowerPath doesn't allow me to remove some of those paths (for example, when all paths are dead, using global removal «powermt remove dev=all» or «powermt check force», then «devfsadm -C»).

Usualy the applications managing these devices are Sun Cluster, Veritas Volume Manager (VxVM), or others.

My question is: is there an easy way to detect what application is using a specific device before I can plan its removal? Something different then a «lsof» check...

Many thanks,

Celso Capao.

9 Legend

 • 

20.4K Posts

October 29th, 2007 06:00

i am not sure it's easy ..but since you have volume manager (veritas in your case), trace it back from that end. Look at which logical volume disk belongs to, then with disk group and then mount point.

4 Operator

 • 

2.8K Posts

October 29th, 2007 08:00

AFAIK there is an unix command called "fuser" .. it can be used to identify if some process opened your /dev/rdsk device. Never used it in a PowerPath environment .. but I think that googling around may give more infos ;-)

4 Operator

 • 

2.8K Posts

October 29th, 2007 08:00

If you trust symcli, you can also use symrslv .. :-)

clst01t/root> symrslv -h

NAME

symrslv - Displays detailed mapping information about
a disk storage object.

SYNOPSIS

symrslv [-h] [-version] [-kb|-blocks|-mb]

pd PdevName
[-no_extents|-expand|-pdev_extents]

lv LVolName -g VgName
[-no_extents|-expand|-pdev_extents]
[-stripe_column] [-type VgType]

file FileName
[-no_extents|-expand|-pdev_extents|
-collapse|-phys_collapse]

dir Directory
[-no_extents|-expand|-pdev_extents]

fs MountPoint
[-no_extents|-expand|-pdev_extents]

28 Posts

October 29th, 2007 19:00

Thanks Stefano.

I think "fuser" will only work for mount points, and my problem is that usually those devices are already unmounted, but still managed by third party applications (VxVM, SUNClu, etc); Non-the-less I'll double-check this.

Unfortunately «/usr/local/bin/lsof» doesn't report me that those power devices are in use, and thats why I'm asking this...

About SYMCLI commands, thats very good if you have them installed and properly licensed, but there are some costumer scenarios where I don't have those tools. But in the end, I'll be stuck with the limitations of that command. I think I'll really need an O.S. command to help me with this...


Many thanks once again :-)


Celso Capao.

4 Operator

 • 

2.8K Posts

October 30th, 2007 00:00

I think "fuser" will only work for mount points, and
my problem is that usually those devices are already
unmounted, but still managed by third party
applications (VxVM, SUNClu, etc); Non-the-less I'll
double-check this.


I've found something that may be usefull .. :-)

http://www.google.it/url?sa=t&ct=res&cd=2&url=http%3A%2F%2Fwww.sunmanagers.org%2Fpipermail%2Fsunmanagers%2F2005-March%2F035108.html&ei=yN8mR57AIJjAwwHuwbBy&usg=AFQjCNF--ideLdIFBNOBX4HC8LsiXmu_GQ&sig2=HEBq5DTWVRy4cfFqAkWnVA

About SYMCLI commands, thats very good if you have
them installed and properly licensed, but there are
some costumer scenarios where I don't have those
tools. But in the end, I'll be stuck with the
limitations of that command. I think I'll really need
an O.S. command to help me with this...


You are right .. you need licenses .. but I work for EMC .. ;-)
I need to earn my salary ..
I have a family, an house .. and we want to paint our house .. :D

-s-

9 Legend

 • 

20.4K Posts

October 30th, 2007 03:00


You are right .. you need licenses .. but I work for
EMC .. ;-)
I need to earn my salary ..
I have a family, an house .. and we want to paint our
house .. :D


man ..you are so needy :)

2 Intern

 • 

131 Posts

October 30th, 2007 06:00

I'm surprised "lsof" doesn't work, but "fuser" should. You can use it on disk devices, and raw disk devices.

You'll need to check all the powerpath children and the power device itself, for both raw & disk devices.

For example:

sun2# powermt display dev=c1t80d160s0
Pseudo name=emcpower19a
Symmetrix ID=x
Logical device ID=00B2
state=alive; policy=SymmOpt; priority=0; queued-IOs=0
==============================================================================
---------------- Host --------------- - Stor - -- I/O Path - -- Stats ---
### HW Path I/O Paths Interf. Mode State Q-IOs Errors
==============================================================================
2304 sbus@1f/lpfs@1 c1t80d160s0 FA 3aA active alive 0 0
2305 sbus@1f/lpfs@3 c2t81d160s0 FA 14aA active alive 0 1

sun2# fuser /dev/rdsk/c1t80d160s0
/dev/rdsk/c1t80d160s0:
sun2# fuser /dev/rdsk/c2t81d160s0
/dev/rdsk/c2t81d160s0:
sun2# fuser /dev/rdsk/emcpower19a
/dev/rdsk/emcpower19a:

sun2# fuser /dev/dsk/c1t80d160s0
/dev/dsk/c1t80d160s0: 1300c 1164c
^^^^^^^^^^^^^^

sun2# fuser /dev/dsk/c2t81d160s0
/dev/dsk/c2t81d160s0:
sun2# fuser /dev/dsk/emcpower19a
/dev/dsk/emcpower19a:

As you can see, there are some processes accessing the /dev/dsk/c1t80d160s0 device in this example.

Hope that helps!

4 Operator

 • 

2.8K Posts

October 30th, 2007 06:00

Dynamox .. you already know that I need a lot of money .. I need to feed my childs, I need to paint the house .. And I need to buy some Nikon lenses :D .. So please go out and buy something from your local friendly (very friendly) account manager !! :-)

9 Legend

 • 

20.4K Posts

October 30th, 2007 06:00

i am ..looking at NS80 right now ;)

36 Posts

October 30th, 2007 08:00

First find the major minor number of the device:

# ls -l /dev/dsk/emcpower3a
lrwxrwxrwx 1 root root 33 Jan 4 2007 /dev/dsk/emcpower3a -> ../../devices/pseudo/emcp@3:a,blk
# ls -l /devices/pseudo/emcp@3:a,blk
brw------- 1 root root 254, 24 Dec 21 2006 /devices/pseudo/emcp@3:a,blk

In this case: major = 254, minor = 24. Then put lsof to work:

# lsof | grep ' 254,24 '
bash 16845 root cwd VDIR 254,24 512 75712 /vob/store4/views
lsof 16915 root cwd VDIR 254,24 512 75712 /vob/store4/views
grep 16916 root cwd VDIR 254,24 512 75712 /vob/store4/views
lsof 16917 root cwd VDIR 254,24 512 75712 /vob/store4/views

Note, there are spaces before and after 254,24 to ensure an exact match.

28 Posts

October 31st, 2007 12:00

You are right .. you need licenses .. but I work for
EMC .. ;-)
I need to earn my salary ..
I have a family, an house .. and we want to paint our
house .. :D

-s-


LOL

Stefano, that was hilarious; please keep up that humor!

Many thanks you all guys; I'll test your suggestions this night (yeah, this night.. I also have so much to pay :-) )

Celso Capao.

4 Operator

 • 

2.8K Posts

November 16th, 2007 02:00

Celso have you been able to test the various commands suggested here and there ?? :-)

28 Posts

November 22nd, 2007 02:00

Hi there,

Sorry for the delay, I've been out!

Unfortunately it didn't worked.

Weirdly «lsof» isn't identifying disk/lun locations. Though, I've mounted those filesystems and done a «tail -f » to some files there, just to check. Even doing this I was unable to identify the lun; files are shown in the lsof output, but I noticed that there is an error displayed in those lsof lines; this seems to be the reason.

fuser isn't working also; I think the problem is the same.

I'll try to get back to the costumer and show you guys some output.

Many thanks,

Celso Capao

Top