Operating System - HP-UX
1753556 Members
5633 Online
108796 Solutions
New Discussion юеВ

HP-UX LVM (LV Extent Mapping)

 
Sundeep Saini
Occasional Contributor

HP-UX LVM (LV Extent Mapping)

HI,
I am working on HP-UX 11i OS on my HP Visualize workstation. My query is about Logical volume and their extents information. I am writing the module in C that can read all the partition information like how many VG, PV and how many Lv on which file system resides. If LV is extended or mapped on different PVs then how the information is stored on HDD and in which structure.

Ya i am using the C programm and before writing the complete module i am using the a Hexeditor for tarversing the harddisk manually.
I am giving one example to elaborate my problem.
I create a logical volume of 500mb called /test1 on PV1, after this LV in PV1 there is huge free space.
Then i add one more hdd on the same volume group VG00 and hen i extented the size of /test1 by 1000MB on the second PV02 now its total length became 1500 Mb. And now it is laying on two hdds(PVs).
When i search for superblock of this LV (Bcoz i dont know the structure where all LV information is stored like VTOC in Unixware or Solaris).From superblock i got the filesystem length.
now i have a problem that how i can determine that how many PV Extents are occupied on First PV and address of second PV on which next Extents are stored.
How this information is stored on the Hdd.



Sandy
5 REPLIES 5
RAC_1
Honored Contributor

Re: HP-UX LVM (LV Extent Mapping)

I do know where such information is stored.
But you can get this information with lvdisplay -v /dev/vg00/lvolx

It will show which extent sit on which which pvs.
There is no substitute to HARDWORK
AwadheshPandey
Honored Contributor

Re: HP-UX LVM (LV Extent Mapping)

see attached pdf file

Awadhesh
It's kind of fun to do the impossible
AwadheshPandey
Honored Contributor

Re: HP-UX LVM (LV Extent Mapping)

See attached file

Awadhesh
It's kind of fun to do the impossible
saju_2
Respected Contributor

Re: HP-UX LVM (LV Extent Mapping)

Hi sandy

There are 3 basic commands to get the stats about a VG, LV and PV. They are vgdisplay, lvdisplay and pvdisplay.

vgdisplay -v vgname (vgdisplay -v vg00)
lvdisplay -v lvname (lvdisplay -v /dev/vg00/lvol1)
pvdisplay -v pvname (pvdisplay -v /dev/dsk/c0t0d0)

Go through the outputs in your case and revert back if you need any specific information other than those from the output.

Regards
CS
Sundeep Saini
Occasional Contributor

Re: HP-UX LVM (LV Extent Mapping)

HI ,
I read all your comments and i already work on that commands. But my problem is not solved by your suggestions.
I want to ask that when any logical volume is created then LVM alloted few LV extents/PVextens for that logical volume. FRom which location these extents starts, i mean from the start of File system or after the boot block?
IN HP-UX is there any structure like partition table?
Mr. Awdesh give me a link of a PDF file in which One "LVM structure Information" is given in which there are few structure like LIF header, PVRA,BDRA, LIF vOlume and VGRA .
Can i get any link from where i can find very elaborate view of LVM internals.

Sandy