Edit: Link no longer works.
Originally posted June 2, 2015 on AIXchange
In environments with machines containing many volume groups and filesystems, we want easy ways of manipulating that information. There’s always a need to know to know which filesystem is in which volume group. If you want to grow the size of a filesystem, you are going to want to know which volume group it is in so that you will be able to check if that volume group has free space available in it or not.
Brian Smith has a useful post about getting this type of information:
Quick tip: List details of all volume groups with lsvg on AIXThe “lsvg” command has a handy “-i” option, which the man page says, “Reads volume group names from standard input.” This brief description doesn’t explain how useful this option can be.
If you run “lsvg” and pipe the ouput to “lsvg -i” (i.e., “lsvg | lsvg -i”) it will list the volume group information for every volume group on the system. You can also use other lsvg options such as “-l” to list all of the LV’s/Filesystems from every volume group: “lsvg | lsvg -li,”
This is an excellent way to gather LVM [Logical Volume Manager] information from your system quickly and easily. Another way to use lsvg is to incorporate xargs. As noted in its Wikipedia entry, “in many other UNIX-like systems, arbitrarily long lists of parameters cannot be passed to a command, so xargs breaks the list of arguments into sublists small enough to be acceptable.”
So, for example this:
lsvg -o | xargs -n1 lsvg –l is similar to this:
lsvg | lsvg -li
Likewise, this:
lsvg -o | xargs -n1 lsvg
is similar to this:
lsvg | lsvg –i
What methods do you use to examine volume group information?