Get disk usage from command line?

PixelGordo

Member
May 13, 2017
5
0
21
55
This is my first post here, so hi to everyone and thanks for ProxMox. I've been using it in my small home server since the beginning of the year and I'm really delighted with it.

I'm creating a monitoring script for the ProxMox host and I can't figure out how to get data about disk usage. When I use lvs command, I get:

Code:
root@hub1:~/scripts/system_monitor# lvs
  LV            VG   Attr       LSize  Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  data          pve  twi-aotz-- 65.91g             10.92  5.53                           
  root          pve  -wi-ao---- 27.75g                                                   
  swap          pve  -wi-ao----  4.00g                                                   
  vm-100-disk-2 pve  Vwi-aotz--  6.00g data        63.95                                 
  vm-101-disk-1 pve  Vwi-a-tz--  8.00g data        41.99

I see the size of each partition, but for some reason, I cannot see the usage percentage for root.

Regards and thanks in advance.
 
Here is a snippet that grabs mount point and percentage. Adjust as you need to.

Code:
df -h  | grep -v Used | awk '{ print $1" " $5 "\t" }'
 
The problem is that "df" doesn't give any information about the logical volumes for each CT.

So I assume I have to use both, "lvs" to get information about the volumes for CTs and "df" for the root system. I'd like to have just one command that gives me all the information I need, but if it can't be done, it can't be done.

Regards and thanks for your answer.
 
Hi,

you can use pvesm status

fore more information see man pvesm
 
  • Like
Reactions: ebiss

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!