Determining physical disk space

KenHorse

Member
Mar 18, 2022
63
0
11
70
From the host, how can I determine the actual disk usage/amount of free space left on the drive?

I know about df but that only seems to show the host disk. How can I see what all the guests are using as well? (I'm trying to determine how much free space is left on the disk before creating any new guests)
 
That depends on your used storage. For ZFS a "zfs list YourPool" will show you that. For LVM-Thin you might want to use lvdisplay and vgdisplay. You can also see both visually from within the webUI when seleting your storages "summary" tab.

Or do you mean the space left on the guests virtual disk? For VMs PVE is using LVs or zvols and these are block devices so PVE doesn't know how full those virtual disks are, unless you are using thin provisioning.
 
Last edited:
Let's say I have a 256 GB disk to start with when I started a new Proxmox install. After the install is completed, df -h reports:

Code:
root@pve:~# df -h
Filesystem                           Size  Used Avail Use% Mounted on
udev                                     3.8G     0  3.8G   0% /dev
tmpfs                                   784M  1.1M  783M   1% /run
/dev/mapper/pve-root     28G   23G  3.5G  87% /
tmpfs                                   3.9G   46M  3.8G   2% /dev/shm
tmpfs                                   5.0M     0  5.0M   0% /run/lock
/dev/sda2                           511M  328K  511M   1% /boot/efi
/dev/fuse                            128M   16K  128M   1% /etc/pve
tmpfs                                   784M     0  784M   0% /run/user/0
root@pve:~#

So I then add 1 guest defined with 32 GB allocated. Is it really no more complicated than running df -h from the guest, add the usage of the 2 and that will allow me to determine the amount of free space left on my 100 GB disk?

Or is there a more precise way?
 
Last edited:
Whats your output of lsblk? You still not told us what storage you are using.
I guess you are using LVM-Thin. In that case you got two storages. "local" which is a filesystem where PVE is installed to. And "local-lvm" which is a LVM-thin pool which is a block device where your guests virtual disks are stored. If you want to see how much space your guests consume of that LVM-thin pool you should run lvdisplay or check in webUI the summary page of your "local-lvm" storage.
 
Last edited:
Sorry yes, I use the default setting of LVM-Thin.

the GUI reports:
Code:
Usage
 
78.03% (50.83 GB of 65.14 GB)

So that is the total used by all the VMs and not the host?
 
So that is the total used by all the VMs and not the host?
If thats whats written at your local-lvm's summary page then yes. Then you got a 65.14GB thin pool where all guests together use 50.83 GB of it. Make sure to keep an eye on it as you might currupt your guests data when it reaches somethin close to 100%.
 

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!