1

Is there a simple command to show just how much disk space total has been allocated in total within an LVM thin pool, and maybe also compute the ratio of disk space allocated by thin volumes to the disk space actually physically available to the thin pool?

For example, assuming I have a thin pool on a 1TB device, and I've got 42 freshly created thin volumes, each logically of size 100GB, I'd like to know that the thin pool may potentially want to grow to 4200GB, or that the pool was overcommited 3.2× times.

liori
  • 737
  • 3
  • 14

1 Answers1

0

The simplest I found so far is the following:

lvs --separator=, --units=m -o lv_size,pool_lv --noheadings |\
    awk -F, '{ s[$2] += $1 } END { for(key in s) { print key, s[key] } }'

…which will compute in megabytes the sum of logical size of all thin volumes, for each thin pool. Close enough for my purposes, but maybe there's an easier answer?

liori
  • 737
  • 3
  • 14