Operating System - Linux
1753316 Members
5068 Online
108792 Solutions
New Discussion юеВ

get volume status function

 
anat heilper
Frequent Advisor

get volume status function

Hi,
I'm trying to find a function(like lvdisplay, but through C code) that get the status of a device ( volume), weather it is online/offline according to it's major and minor number. Is there such functions?
Thaks,
anat
5 REPLIES 5
Ivan Ferreira
Honored Contributor

Re: get volume status function

Maybe your best option is to check the lvdisplay/lvs source code. This is why the open source world is too great.

Cheers.
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Stuart Browne
Honored Contributor

Re: get volume status function

That, or you could start with an 'strace lvdisplay /dev//', and see if that gives you any clues.

..

unfortunately, my test box at home which has LVM is LVM 1, so it's rather different.. All my LVM2 boxes aren't using LVM.. Go figure.. ;)
One long-haired git at your service...
rajdev
Valued Contributor

Re: get volume status function

Hi,

I am not sure what you are actually looking, but there is a pstat interface which can give you a lot of status information on processes,disk,lv,memory etc.

see the following for details :
man pstat
/usr/include/sys/pstat.h
/usr/include/sys/pstat/*
pstat_getlv
pstat_getdisk

Regards,
RD
anat heilper
Frequent Advisor

Re: get volume status function

Hi, on linux i don't see no man entry for pstat nor the include files that you mentioned
Vitaly Karasik_1
Honored Contributor

Re: get volume status function

Shalom, Anat,

AFAIK, pstat is HP-UX specific utility.

As for your question - I suggest you to ask it on some LVM forum/maillist, see for more info http://www.ibm.com/developerworks/library/l-lvm2/?ca=dgr-lnxw02aLinuxLVM2&S_TACT=105AG