LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
LinkBack Search this Thread
Old 02-21-2006, 06:58 AM   #1
mghiya
LQ Newbie
 
Registered: Feb 2006
Posts: 10

Rep: Reputation: 0
How to find Physical Volumes associated with a Logical Volume Group


Regards 's

I am trying to find out all the Physical Volumes a Logical Volume Group is associated with.

I am able to get all the active Logical Volume(LV) Groups on the system through ioctl(VG_STATUS_GET_NAMELIST) and the Logical Volumes in the group through ioctl(LV_STATUS_BYINDEX). But I am unable to find out an ioctl call to get the Physical Volume associated with the LV Group.

I tried out the call, ioctl(VG_STATUS) which returns struct *vg_t which incidentally contains an array of pv_t* structures. But these structures are not populated by this call. How can I do this?

Any help is appreciated...

~Murtaza
 
Old 02-21-2006, 09:11 AM   #2
macemoneta
Senior Member
 
Registered: Jan 2005
Location: Manalapan, NJ
Distribution: Fedora x86 and x86_64, Debian PPC and ARM, Android
Posts: 4,500

Rep: Reputation: 285Reputation: 285Reputation: 285
Take a look at the code in lvdisplay's -m option. It performs mapping of logical to physical volumes:

Code:
# lvdisplay -m /dev/VolGroup00/LogVol00
  --- Logical volume ---
  LV Name                /dev/VolGroup00/LogVol00
  VG Name                VolGroup00
  LV UUID                KWqG5q-wFzR-2BJP-wxSF-sXTt-K7HF-r0R0pg
  LV Write Access        read/write
  LV Status              available
  # open                 1
  LV Size                54.75 GB
  Current LE             1752
  Segments               1
  Allocation             inherit
  Read ahead sectors     0
  Block device           253:0

  --- Segments ---
  Logical extent 0 to 1751:
    Type                linear
    Physical volume     /dev/hda2
    Physical extents    0 to 1751
 
Old 02-21-2006, 10:19 AM   #3
tizzef
Member
 
Registered: Jan 2005
Location: Nice, France
Distribution: Ubuntu,RHES, Mandriva, RHAS, AIX 4.3.3, 5.2 & 5.3, Debian,Solaris8/10
Posts: 117

Rep: Reputation: 20
You can issue a <pvscan> too.

$ pvscan
pvscan -- reading all physical volumes (this may take a while...)
pvscan -- ACTIVE PV "/dev/sda2" of VG "root_vg" [14.64 GB / 7.17 GB free]
pvscan -- ACTIVE PV "/dev/sda4" of VG "omgr_vg" [15.26 GB / 0 free]
pvscan -- total: 2 [29.92 GB] / in use: 2 [29.92 GB] / in no VG: 0 [0]
$

Cheers
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Mounting Logical Volumes acidblue Fedora 6 01-28-2006 10:02 PM
I did not know about logical volumes gezi Linux - Newbie 5 04-27-2005 09:26 AM
FC3 slow boot: scans logical volumes..? tardigrade Fedora 1 04-03-2005 01:45 AM
LVM Problem - vgimport - wrong number of physical volumes to import volume group Anything1 Linux - Software 0 09-06-2003 07:18 PM
how to read the output of df -k and about logical volumes commands jdara1 Linux - Software 3 05-23-2003 12:22 PM


All times are GMT -5. The time now is 03:26 PM.

Main Menu
 
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration