From Wiki-UX.info

Wiki-UX / Logical Volume Manager / How to get the size of the logical volumes
Jump to: navigation, search

How to get the size of the logical volumes

Abstract

This article describes a Postfix Shell script that reports the size of every LVM Logical Volume. Data is presented in Megabytes.

Contents


Script

# vgdisplay -v | awk '$0 ~ /LV Name/ {TITLE=$3} \
/LV Size/ {printf "%-20s -> %10d MB\n", TITLE, $4}'

Example:

/dev/vg00/lvol1      ->       1536 MB
/dev/vg00/lvol2      ->       4096 MB
/dev/vg00/lvol3      ->       1536 MB
/dev/vg00/lvol4      ->       6144 MB
/dev/vg00/lvol5      ->        512 MB
/dev/vg00/lvol6      ->       3072 MB
/dev/vg00/lvol7      ->       6144 MB
/dev/vg00/lvol8      ->        104 MB
/dev/vg00/lvol9      ->       4096 MB
/dev/vg01/lvol1      ->      34728 MB
/dev/vg02/lvol1      ->      34728 MB

Authors

This page was last modified on 3 August 2011, at 19:11. This page has been accessed 1,492 times.