Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have following situation:

=$ LC_ALL=C df -hP | column -t
Filesystem              Size  Used  Avail  Use%  Mounted  on
/dev/mapper/vg0-rootlv  19G   854M  17G    5%    /
/dev/mapper/vg0-homelv  19G   343M  18G    2%    /home
/dev/mapper/vg0-optlv   19G   192M  18G    2%    /opt
/dev/mapper/vg0-varlv   19G   357M  18G    2%    /var

I'd like to know what physical disks are used by these volumes, and how much free disk space (unallocated) I have, so that I will know how much I can grow these.

share|improve this question
up vote 11 down vote accepted

This is relatively easy. Use lvdisplay to show logical volumes, vgdisplay to show volume groups (including free space available) and pvdisplay to show physical volumes.

You should get all the data you need from those three commands, albeit with some work to figure out what all the various bits of data mean.

share|improve this answer

pvs, vgs and lvs are convenient easy-to-read alternatives to pvdisplay, vgdisplay and lvdisplay if you only need a summary. E.g. :

# pvs
  PV         VG     Fmt  Attr PSize   PFree 
  /dev/sda2  fedora lvm2 a--  232,59g 20,87g
share|improve this answer

The "maps" option is what you are after. This works at the lv level as well as pv.

So if you want to see what room an LV is taking up on a volume, do

lvdisplay -m <volumegroupname>

If you want to see the usage of PVs, do

pvdisplay -m
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.
{"cc_re__cc_re__cc_by_sa_3_0": ["                       <li><a href=\"//area51.stackexchange.com\" title=\"proposing new sites in the Stack Exchange network\">Area 51</a></li>\r\n                        <li><a href=\"//careers.stackoverflow.com\">Stack Overflow Careers</a></li>\r\n                    \r\n                </ol>\r\n            </td>\r\n    </tr>\r\n</table>\n                </div>\n            </div>\n\n            <div id=\"copyright\">\n                site design / logo &#169; 2016 Stack Exchange Inc; user contributions licensed under <a href=\"https://creativecommons.org/licenses/by-sa/3.0/\" rel=\"license\">cc by-sa 3.0</a> \n                with <a href=\"http://blog.stackoverflow.com/2009/06/attribution-required/\" rel=\"license\">attribution required</a>\n            </div>\n            <div id=\"svnrev\">\n                rev 2016.2.12.3248\n            </div>\n            \n        </div>\n    </div>\n    <noscript>\n        <div id=\"noscript-warning\">Server Fault works best with JavaScript enabled<img src=\"http://pixel.quantserve.com/pixel/p-c1rF4kxgLUzNc.gif\" alt=\"\" class=\"dno\"></div>\n    </noscript>\n<scrip"], "copyright__copyright__copyright": ["y. E.g.\u00a0:\n\n# pvs\n  PV         VG     Fmt  Attr PSize   PFree \n  /dev/sda2  fedora lvm2 a--  232,59g 20,87g\nshare|improve this answer\n\nThe \"maps\" option is what you are after. This works at the lv level as well as pv.\n\nSo if you want to see what room an LV is taking up on a volume, do\n\nlvdisplay -m <volumegroupname>\n\nIf you want to see the usage of PVs, do\n\npvdisplay -m\nshare|improve this answer\n\nYour Answer\n\n\u00a0\ndiscard\n\nBy posting your answer, you agree to the privacy policy and terms of service."]}