Operating System - HP-UX
1832861 Members
2761 Online
110048 Solutions
New Discussion

Re: relation between disk device and lvol

 
SOLVED
Go to solution
Xavier BLANC
Frequent Advisor

relation between disk device and lvol

Hello
a sar -d produce something like
12:42:12 device %busy avque r+w/s blks/s avwait avserv
12:42:15 c1t2d0 0,66 0,50 1 11 0,31 12,06
in vgdisplay I have eventualy several lvol for a device.
in the example attached :
is /dev/dsk/c5t10d0 related to : /dev/vg04/lvol1 or /dev/vg04/lvol2





6 REPLIES 6
Slawomir Gora
Honored Contributor

Re: relation between disk device and lvol

Hi,

you have use lvdisplay command to check distribution over disks

ex:

lvdisplay -v /dev/vg04/lvol1
Chris Wilshaw
Honored Contributor
Solution

Re: relation between disk device and lvol

If you use

pvdisplay -v /dev/dsk/c5t10d0

you will get the details of the lvols that are located on that disk.
Hein van den Heuvel
Honored Contributor

Re: relation between disk device and lvol


You may want to create a little relationship table for dsk -> vg -> lv(s).
For example with the perl scripts below

cat dsk-to-lv

while (<>) {
if (/^VG Name\s+\/dev\/(\w+)/) { $vg=$1; $lv="" }
$lv .= " $1" if (/$vg\/(\w+)/);
printf "%-10s%-10s%s\n",$1,$vg,$lv if (/PV Name .*\/(\w+)$/);
}

vgdisplay -p | perl dsk-to-lv
c0t6d0s2 vg00 lvol1 lvol2 lvol3 lvol4 lvol5 lvol6 lvol7 lvol8 lvol9 lvol0
c73t0d1 vg_nfs lv_nfs
c73t0d2 vg_nfs lv_nfs
c73t0d0 vg_02...
:
:

hth,
Hein.


Sยภเl Kย๓คг
Respected Contributor

Re: relation between disk device and lvol

I would suggest u to follow the same order
#pvdisplay -v /dev/dsk/c5t10d0 to identify how many lvols are configured on that pv

#lvdisplay -v /dev/vg04/lvol1 to identify the PVs in lvol1
regards
SK


Your imagination is the preview of your life's coming attractions
Xavier BLANC
Frequent Advisor

Re: relation between disk device and lvol

Thanks to everybody
I do this script if it can help :
device=$1
pvdisplay -v /dev/dsk/$device | awk ' {
if ( ( NR == 2 ) || ( NR == 3 ) ) { print $0 }
if ( ( NR == 19 ) ) {cmd = "grep "$1" /etc/fstab | cut -d \" \" -f 1,2";lv
= system(cmd) }
}'
Xavier
Xavier BLANC
Frequent Advisor

Re: relation between disk device and lvol

use this script :
device=$1
pvdisplay -v /dev/dsk/$device | awk ' {
if ( ( NR == 2 ) || ( NR == 3 ) ) { print $0 }
if ( ( NR == 19 ) ) {cmd = "grep "$1" /etc/fstab | cut -d \" \" -f 1,2";lv
= system(cmd) }
}'