From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx1.redhat.com (mx1.redhat.com [172.16.48.31]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id l3R1ijrO009305 for ; Thu, 26 Apr 2007 21:44:46 -0400 Received: from mail.antypas.net (74-93-0-53-SFBA.hfc.comcastbusiness.net [74.93.0.53] (may be forged)) by mx1.redhat.com (8.13.1/8.13.1) with ESMTP id l3R1ih4C031313 for ; Thu, 26 Apr 2007 21:44:44 -0400 Received: from blucher (unknown [10.0.1.1]) by mail.antypas.net (Postfix) with ESMTP id E83B9F489 for ; Thu, 26 Apr 2007 18:44:34 -0700 (PDT) From: "John Antypas" Date: Thu, 26 Apr 2007 18:44:32 -0700 Message-ID: <000001c7886d$a041fb40$e0c5f1c0$@com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0001_01C78832.F3E32340" Content-Language: en-us Subject: [linux-lvm] New developer question -- API Reply-To: LVM general discussion and development List-Id: LVM general discussion and development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , List-Id: To: linux-lvm@redhat.com This is a multipart message in MIME format. ------=_NextPart_000_0001_01C78832.F3E32340 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit This has probably been asked thousands of times before, but I'll try to be a good 1001 J I'm trying to write some userspace code which can determine what LV, VG and PV a givne file mout belongs to. Yes, I can process the output of a few command lines tools like this: 1. Get the mount from /proc/mounts 2. Run lvs and map that into the LVM 3. Using the LVM, run vgs and get the VG 4. Using VG, use pvs and get the PV 5. Using PV, now some knowledge about how I set things up and get the md 6. Run around proc some more and figure out which disks this md is on These utilities do it - is there an API I can call to do all of this tracing down rather than processing shell processes? ------=_NextPart_000_0001_01C78832.F3E32340 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

This has probably been asked thousands of times = before, but I’ll try to be a good 1001 J

 

I’m trying to write some userspace code which = can determine what  LV, VG and PV a givne file mout belongs to.  = Yes, I can process the output of a few command lines tools like this:

 

1.       Get the mount from /proc/mounts

2.       Run lvs and map that into the LVM

3.       Using the LVM, run vgs and get the = VG

4.       Using VG, use pvs and get the PV

5.       Using PV, now some knowledge about how I set = things up and get the md

6.       Run around proc some more and figure out which = disks this md is on

 

These utilities do it – is there an API I can = call to do all of this tracing down rather than processing shell = processes?

------=_NextPart_000_0001_01C78832.F3E32340--