- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: /etc/lvmtab file format/structure
Categories
Company
Local Language
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
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
Community
Resources
Forums
Blogs
- 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-01-2011 11:02 PM
тАО02-01-2011 11:02 PM
/etc/lvmtab file format/structure
I want to read the /etc/lvmtab file programmatically to get the vgid, pvid. Can some body tell me how its structured? Or, if anyone has a sample program/script would help me a lot.
thanks for your time,
Prince
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-01-2011 11:08 PM - last edited on тАО09-29-2011 02:25 PM by Kevin_Paul
тАО02-01-2011 11:08 PM - last edited on тАО09-29-2011 02:25 PM by Kevin_Paul
Re: /etc/lvmtab file format/structure
lvmtab dies not have PVID /VGID ,you may read the file using "strings /etc/lvmtab"
Commnand for VGID /PVID
echo "0x2008?4D" | adb /dev/dsk/c-t-d-
It will report 5 columns starting with
2008: <5th column=VGID>
You may load a script "lvminfo" to get VGID/PVID
http://h30499.www3.hp.com/t5/System-Administration/HOW-to-know-the-PVID-and-VGID-of-disk/m-p/4620707#M377468
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-01-2011 11:10 PM - last edited on тАО09-29-2011 02:25 PM by Kevin_Paul
тАО02-01-2011 11:10 PM - last edited on тАО09-29-2011 02:25 PM by Kevin_Paul
Re: /etc/lvmtab file format/structure
do "strings /etc/lvmtab" -its binary file , i don`t think it has PVID /VGID.
echo "0x2008?4D" | adb /dev/dsk/c-t-d-
It will report 5 columns starting with
2008: <5th column=VGID>
Load the script "lvminfo" to get the best information
http://h30499.www3.hp.com/t5/System-Administration/HOW-to-know-the-PVID-and-VGID-of-disk/m-p/4620707#M377468
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-02-2011 06:04 AM
тАО02-02-2011 06:04 AM
Re: /etc/lvmtab file format/structure
For example: "od -t x1a /etc/lvmtab".
On one of my systems, the showLVMinfo reports this:
# ./showLVMinfo /dev/rdsk/c2t2d0
Local CPU ID = 580706587, hex value=0x229ce11b
/dev/rdsk/c2t2d0:
CPUID=0x229ce11b (580706587), VGID 0x48845169, PVID 0x48845169
The relevant part of the output of the od command:
0002000 0 0 0 0 0 0 0 0 0 0 0 0 22 9c e1 1b
nul nul nul nul nul nul nul nul nul nul nul nul " fs a esc
0002020 48 84 51 69 0 0 0 0 0 0 0 0 0 2 0 0
H eot Q i nul nul nul nul nul nul nul nul nul stx nul nul
0002040 0 0 0 0 0 0 0 0 0 0 2f 64 65 76 2f 64
nul nul nul nul nul nul nul nul nul nul / d e v / d
0002060 73 6b 2f 63 32 74 32 64 30 0 0 0 0 0 0 0
s k / c 2 t 2 d 0 nul nul nul nul nul nul nul
0002100 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
nul nul nul nul nul nul nul nul nul nul nul nul nul nul nul nul
MK
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-02-2011 06:17 AM
тАО02-02-2011 06:17 AM
Re: /etc/lvmtab file format/structure
I was not sure about it ,so that is another way to get that info apart from Bill`s script.
Thanks
Manix
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-02-2011 06:36 AM
тАО02-02-2011 06:36 AM
Re: /etc/lvmtab file format/structure
The '/etc/lvmtab' is a binary data file. Hence, the 'stings' command only makes a "best attempt" to produce printable characters from groups of 4-characters.
Aside from the device file and volume group names, a 'strings /etc/lvmtab' will not generally expose much meaningful data. As Matti noted, an octal (or hex) dump will be more informative.
The file actually contains the physical device paths for each volume group defined to the system. In addition, the VGID (Volume Group Identification) and some other state information about each volume group is recorded.
One way to decode the file is (knowing its internal layout) to use Perl. I did it some years ago as an exercise but no longer have the script.
The best way, in my opinion, to evaluate PVID and VGID information is to read the physical disk itself as any of the aforementioned links will show. Remember that a 'vgexport' of a volume group will remove it from '/etc/lvmtab'. You still might want to assess something more about its origin, though, and the PVID and VGID signatures are there on the disk for the reading.
Regards!
...JRF...
- Tags:
- lvmtab strings
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-02-2011 06:54 AM
тАО02-02-2011 06:54 AM
Re: /etc/lvmtab file format/structure
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-02-2011 03:28 PM
тАО02-02-2011 03:28 PM
Re: /etc/lvmtab file format/structure
Reemmber with 11iv2 we have LVMv2 which is totally different and has a different LVM header.
cat display_lvmids
#!/usr/bin/sh
#
# $1 should be /dev/rdsk/c_t_d_ or /dev/rdisk/diskxxxx
#
typeset RDEV=$1
KIND=`xd -An -j 8192 -N8 -tc ${RDEV} 2> /dev/null | xargs`
if [ "$KIND" = "L V M R E C 0 1" ]; then
INFO=`xd -An -j8200 -N16 -tx ${RDEV}`
PVID=`echo ${INFO} | awk '{print $1 $2}'`
VGID=`echo ${INFO} | awk '{print $3 $4}'`
echo "${RDEV} pvid = ${PVID} vgid = ${VGID}"
elif [ "$KIND" = "L V M R E C 0 2" ]; then
VGID=`xd -An -j8208 -N84 -tc ${RDEV} | cut -c5- | cut -c 1,5,9,13,17,21,25,29,33,37,41,45,49,53,57,61|tr -d '\n'`
echo "${RDEV} vgid = ${VGID}"
else
echo did not reconize $RDEV as a LVM disk
fi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-15-2011 03:13 AM
тАО04-15-2011 03:13 AM