check data usage (with cmd df -h)

fab909

Member
Sep 5, 2018
26
0
21
46
Hello
Since Proxmox 5.x, We cannot see size and mount directory in commande df -h
Code:
# df -h
Filesystem            Size  Used Avail Use% Mounted on
udev                   63G     0   63G   0% /dev
tmpfs                  13G  570M   13G   5% /run
/dev/mapper/pve-root   98G  2.7G   91G   3% /
tmpfs                  63G   39M   63G   1% /dev/shm
tmpfs                 5.0M     0  5.0M   0% /run/lock
tmpfs                  63G     0   63G   0% /sys/fs/cgroup
/dev/sda2             511M  304K  511M   1% /boot/efi
/dev/fuse              30M   36K   30M   1% /etc/pve

but I woud like to check space usage for data storage (LVM)

Code:
lvs
  LV            VG  Attr       LSize   Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  data          pve twi-aotz--   7.49t             0.37   0.28
  root          pve -wi-ao---- 100.00g
  swap          pve -wi-ao----   8.00g
  vm-105-disk-0 pve Vwi-aotz--  25.00g data        10.47
  vm-113-disk-0 pve Vwi-aotz--  25.00g data        60.47
  vm-115-disk-0 pve Vwi-aotz--  60.00g data        17.83

Code:
# cat /etc/pve/storage.cfg
dir: local
        path /var/lib/vz
        content vztmpl,iso,backup

lvmthin: local-lvm
        thinpool data
        vgname pve
        content rootdir,images
 
but I woud like to check space usage for data storage (LVM)

It's in the output of `lvs` under 'data'? I don't understand your question.
 
Hello Oguz,

Thanks for your answer.

In fact, I use nagios for monitoring Proxmox, and my plugin check the partition, but un cannot check partition data (/dev/mapper/pve-data) with Proxmox 5.x

In a old Proxmox (3.4) I can check :
Code:
# df -h
Filesystem                   Size  Used Avail Use% Mounted on
udev                          10M     0   10M   0% /dev
tmpfs                        9.5G  556K  9.5G   1% /run
/dev/mapper/pve-root          50G  1.4G   46G   3% /
tmpfs                        5.0M     0  5.0M   0% /run/lock
tmpfs                         19G   16M   19G   1% /run/shm
/dev/mapper/pve-data         2.1T  1.8T  273G  88% /var/lib/vz

You can see : /dev/mapper/pve-data 2.1T 1.8T 273G 88% /var/lib/vz
 
I see the problem now.

In the 5.x versions we use LVM-Thin for the local-lvm storage. This won't be seen like '/dev/mapper/pve-data' by `df` because of thin provisioning (the VM disks are not file on a mounted system, but instead real logical volumes).

I don't know much about Nagios, but you might be able to adapt your plugin to parse the output from the lv-related commands (lvs, vgs, pvs, lvdisplay and so on).