- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: How to get LVM info from inside a C program?
Operating System - HP-UX
1753659
Members
5908
Online
108798
Solutions
Forums
Categories
Company
Local Language
юдл
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
юдл
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-26-2001 06:49 PM
тАО02-26-2001 06:49 PM
Re: How to get LVM info from inside a C program?
What I really need to know is the names of the volume groups on the system and which disks belong to the group. I did a strings on the /etc/lvmtab file and this did give somoe useful info. I can use a similar algorithm to strings inside my program. But is this a reliable method of getting this information. Is /etc/lvmtab automatically updated to reflect changes in the system or is it only updated under certain conditions?
I have also done the same on the files under /etc/lvmconf which also give this information but from what I read these files are not updated automatically but only by the user - if the user doesn't do it they won't be updated - is this correct? Is ths the same for the lvmtab file?
I have also done the same on the files under /etc/lvmconf which also give this information but from what I read these files are not updated automatically but only by the user - if the user doesn't do it they won't be updated - is this correct? Is ths the same for the lvmtab file?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-26-2001 10:11 PM
тАО02-26-2001 10:11 PM
Re: How to get LVM info from inside a C program?
/etc/lvmtab 'should' always be correct, and by default will be.
lvmtab is a binary file, and therefore working out the file format wouldn't be difficult to achieve. Just dump it out in hex and compare a few machines, it's pretty simple.
lvmtab is a binary file, and therefore working out the file format wouldn't be difficult to achieve. Just dump it out in hex and compare a few machines, it's pretty simple.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-26-2001 10:28 PM
тАО02-26-2001 10:28 PM
Re: How to get LVM info from inside a C program?
Thanks for your help I have quite alot of what I need. The main info missing now is the size info. I can find out the size of a disk and a logical volume using ioctl() with the DIOC_CAPACITY cmd on the character special file ie /dev/rdsk/c1t2d0 or /dev/vg00/rlvol1. Is there a character special file for the volume group (that I could use to determine the vg size) I tried the /dev/vg00/group file but it didn't work (ioctl failed with errno = 22 (bad argument)). Is there any other way to determine the size of the volume group?
I would also like to get alloc/unalloc MB for the disks and the volume groups. This can be determined from the output of the executable you sent so I guess I can do this the same way - by reading the lvmrec, VGDA, etc from the disk character special file - but I don't know the format of the structures to read this info into. Do you know the structure definitions or can you point me to some documentation on this?
I would also like to get alloc/unalloc MB for the disks and the volume groups. This can be determined from the output of the executable you sent so I guess I can do this the same way - by reading the lvmrec, VGDA, etc from the disk character special file - but I don't know the format of the structures to read this info into. Do you know the structure definitions or can you point me to some documentation on this?
- « Previous
-
- 1
- 2
- Next »
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
News and Events
Support
© Copyright 2024 Hewlett Packard Enterprise Development LP