Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

lslv command question...Logical Volumes/ Oracle

Status
Not open for further replies.

bartDG

Programmer
Feb 5, 2004
1
0
0
US
I am trying to find a way to get the disk name that a logical volume resides on. I know the lslv command returns the information I need, but I want to find a command that will only return the disk name.

Here is what I have so far...
$lslv -l dm2t_0128_003 | cut -d" " -f1
dm2t_0128_003:N/A
PV
hdisk11


Can I always be sure that the third line will contain the disk?

Thanks for the help!
 
Yes. But if the LV is across multiple disks then you will have more than 3 lines.

I would do it this way:
lslv -l hd2 | grep hdisk | awk '{print $1}'
 
hi

try lslv -m lvname

shows you what disk LV is on second column is mirror copy
 
Hi,

In general you would have entries like hdisk....
We are using SDD disks with gives vpath entries instead

The command used should then be:

lslv -l dm2t_0128_003 | awk 'NR>2 {print $1}'

 
flatwater's command
lslv -l hd2 | grep hdisk | awk '{print $1}'

would be more efficient like so
lslv -l hd2|awk '/hdisk/{print$1}'

IBM Certified -- AIX 4.3 Obfuscation
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top