Operating System - HP-UX
1834605 Members
4155 Online
110069 Solutions
New Discussion

Re: How to find out which filesystems belongs to which disk or I/O controller

 
ezhilarasan_1
Occasional Advisor

How to find out which filesystems belongs to which disk or I/O controller


Hi,

How to find out which filesystems belongs to which disk or I/O controller
This info will be useful to distribute I/O load evenly by scattering the datafiles
among filesystems.


Thanks
Ezhil

9 REPLIES 9
Onur Karakan
Advisor

Re: How to find out which filesystems belongs to which disk or I/O controller

hi ezhilarasan,

I think the following command will be userful for you.

lvdisplay -v |more

Best Regards,

Onur

--- Logical volumes ---
LV Name /dev/vg01/lvorasoft
VG Name /dev/vg01
.........................

--- Distribution of logical volume ---
PV Name LE on PV PE on PV
/dev/dsk/c0t3d0 813 813

--- Logical extents ---
LE PV1 PE1 Status 1
00000 /dev/dsk/c0t3d0 00000 current
00001 /dev/dsk/c0t3d0 00001 current
00002 /dev/dsk/c0t3d0 00002 current
00003 /dev/dsk/c0t3d0 00003 current
00004 /dev/dsk/c0t3d0 00004 current
..............................
..............................
RAC_1
Honored Contributor

Re: How to find out which filesystems belongs to which disk or I/O controller

lvdisplay will tell you the about which FS is on which disk.
For i/o controller information, you need to give us more infomration. It depends on what type of SAN/NAS you use. You will have to relate the disks to controller and in turn relate those lvols to controllers. Check primary and alternate paths for lvols.
There is no substitute to HARDWORK
Rajeev  Shukla
Honored Contributor

Re: How to find out which filesystems belongs to which disk or I/O controller

with the bdf get the logical volume corresponding to the filesystem you are looking and then lvdisplay on that logical volume with -v option will give you the disk on which that LV is spread. Now you can then do a ioscan -fn and get the disk and controllers in the system and try to map the controller on which that disk resides.
You could also do a pvdisplay on each disk to see what LV are created on those disks (this is the backward method to go)

Frank de Vries
Respected Contributor

Re: How to find out which filesystems belongs to which disk or I/O controller

Hi Ezhil

I usually do it the other way around.
I mean, I do a vgdisplay first to get the
disks in the volumegroup.

Then I use pvdisplay -v /dev/dsk/cxtxdx |more
to get the list of logical volumes on that disk:
--- Distribution of physical volume ---
LV Name LE of LV PE for LV
/dev/vg00/lvol1 11 11
/dev/vg00/lvol2 128 128
/dev/vg00/lvol3 18 18
/dev/vg00/lvol4 38 38
/dev/vg00/lvol5 3 3
/dev/vg00/lvol6 175 175
/dev/vg00/lvol7 150 150
/dev/vg00/lvol8 200 200
/dev/vg00/lvol9 1000 1000
/dev/vg00/lvorasys 938 938
/dev/vg00/temp 250 250
-
This way you can see if there are more things
going on like mirrorring, striping etc..
The patterns is clearer
Look before you leap
Ninad_1
Honored Contributor

Re: How to find out which filesystems belongs to which disk or I/O controller

Hi,

Try this script

for i in `vgdisplay | grep 'VG Name' | awk '{print $NF}'`
do
for j in `vgdisplay -v $i | grep 'LV Name' | awk '{print $NF}'`
do
echo "$j \c"
lvdisplay -v $j | awk '/Distribution/,/Logical extents/ {print $1}' | grep '/dev/dsk' | cut -f 4 -d "/" | awk 'ORS=" ";{print $0}'
echo "\r"
done
done


This will give you which disks are used by each logical volume. You can develop on this script to get what you want.

Regards,
Ninad
Raj D.
Honored Contributor

Re: How to find out which filesystems belongs to which disk or I/O controller

Hi ezhilarasan ,

1. Do a bdf and check the lvols that refering to to that Filesystem.

Then use lvdisplay -v lvname to check the disk belongs to.

# echo "lvolname \c" ; lvdisplay -v lvolname | grep -v current | grep dsk | awk '{print $1}'

2. Do a ioscan -fnC disk , to check which controller that disk belongs to.


Cheers,
Raj.
" If u think u can , If u think u cannot , - You are always Right . "
ezhilarasan_1
Occasional Advisor

Re: How to find out which filesystems belongs to which disk or I/O controller

Hi Unix experts,

Thanks for your knowledge update in this topic.

I need this also for Sun Solaris and Linux.

Please help. thanks a lot.

Regards
Ezhil

Prasad Joshi
Regular Advisor

Re: How to find out which filesystems belongs to which disk or I/O controller

The script given by Ninad is very good.

But the only thing is it will display each device twice, as the rule is matched twice.

Replace this command

lvdisplay -v $j | awk '/Distribution/,/Logical extents/ {print $1}' | grep '/dev/dsk' | cut -f 4 -d "/" | awk 'ORS=" ";{print $0}'

with

lvdisplay -v $j | awk '/Distribution/,/Logical extents/ {print $1}' | grep '/dev/dsk' | cut -f 4 -d "/" | awk 'BEGIN { ORS=" "} ; {print $0}'
ezhilarasan_1
Occasional Advisor

Re: How to find out which filesystems belongs to which disk or I/O controller


Hi Unix gurus,

Thanks once again.

Please see my previous update.

Also I need this for Sun Solaris and Linux.

Please help with commands for these Unix.

Regards
Ezhil