Operating System - HP-UX
1833780 Members
2178 Online
110063 Solutions
New Discussion

Re: LVM: any way to know to konow on which disk file is located

 
Mihails Nikitins
Super Advisor

LVM: any way to know to konow on which disk file is located

I have vxfs filesystem based on a logical volume residing on several physical disks (disks are mirrored). I'd like to know which physical disks are used to store a given file. Could you recommend me an easier solution that does not require sophisticated programming in C?

Thanks and points in advance!
KISS - Keep It Simple Stupid
7 REPLIES 7
Torsten.
Acclaimed Contributor

Re: LVM: any way to know to konow on which disk file is located

Your file be "anywhere" within the LVOL, but you are able to find out on which disk(s) the LVOL resides. The filesystem is using the LVOL and does not care about the underlying disk. That's why you are using a volume manager.

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
Torsten.
Acclaimed Contributor

Re: LVM: any way to know to konow on which disk file is located

BTW, where should be the use of this information?

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
Ninad_1
Honored Contributor

Re: LVM: any way to know to konow on which disk file is located

If your LVM is striped or using multiple disks then there is no simple/direct method to determine on which part of the disks is a file located - I think that true for any OS as you will appreciate.
You can determine which disks the LVM is using by lvdisplay -v | more
This will show the disks (PV) on which the LVM is residing on.


Regards,
Ninad
Kenan Erdey
Honored Contributor

Re: LVM: any way to know to konow on which disk file is located

perhaps, it can be found disk's chunk size and file's block number.
i found in forum :

ncheck -oblock=- /dev/vg00/lvolx lists files and its' blocks.

i am not sure. just a suggestion.

Computers have lots of memory but no imagination
Mihails Nikitins
Super Advisor

Re: LVM: any way to know to konow on which disk file is located

Thank you!

I know basic LVM concepts, there are no problems with "*display" commands.

I see that some disks in a given lvol get a very heavy load. I'd like to have an idea of what database files are put on them.
KISS - Keep It Simple Stupid
Ninad_1
Honored Contributor

Re: LVM: any way to know to konow on which disk file is located

Do you have glance installed ?
If yes try the glance -u and -v options [ I dont remember if its u and v options - just do man glance and will display you which option shows what. these options are for IO by disk and IO by logical volumes - These options are not working for my system but you can check if its working for you ] Check the IO by lvol to see which are highly used lvols. If you have filesystems on these volumes then you can also see in glance IO by filesystems.
Another way is at databae level. If its Oracle databae just check with your DBA - he should be able to tell you IO by datafiles and table spaces, then map the datafiles to see which filesystem they are on to understand if your IO is distributed properly.

Hope this helps.

Regards,
Ninad
Mihails Nikitins
Super Advisor

Re: LVM: any way to know to konow on which disk file is located

Thanks for your feedback. Looks like it's not easy to answer the question if one logical volume is speread over several disks.
KISS - Keep It Simple Stupid