I have a server with an LVM volume mounted under /mnt. When running df -h
to check free disk space, it appears to show the space consumed under /mnt as being used in /:
[root@monitor spool]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/centos-root 50G 44G 6.2G 88% /
devtmpfs 2.4G 0 2.4G 0% /dev
tmpfs 2.4G 128K 2.4G 1% /dev/shm
tmpfs 2.4G 197M 2.2G 9% /run
tmpfs 2.4G 0 2.4G 0% /sys/fs/cgroup
/dev/mapper/centos-home 85G 33M 85G 1% /home
/dev/sda1 497M 204M 294M 41% /boot
/dev/mapper/recordings-newrecordings 394G 42G 332G 12% /mnt/newrecordings
/dev/mapper/data-db1 50G 364M 49G 1% /mnt/db
Whilst this does have a certain logic - after all /mnt is under / - it does incorrectly indicate that the space is being used under / when in fact its on a separate mounted volume. This is causing some problems as our SNMP monitor keeps misreporting the / volume as nearly full, when it isn't.
Edit: Further to comments below, to illustrate my point better
ncdu
shows the available disk space as follows:
ncdu 1.11 ~ Use the arrow keys to navigate, press ? for help
--- / --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
42.3 GiB [##########] /mnt
1.4 GiB [ ] /usr
917.9 MiB [ ] /var
234.5 MiB [ ] /run
178.0 MiB [ ] /boot
21.9 MiB [ ] /etc
19.1 MiB [ ] /root
188.0 KiB [ ] /home
132.0 KiB [ ] /dev
4.0 KiB [ ] /tmp
. 0.0 B [ ] /proc
0.0 B [ ] /sys
@ 0.0 B [ ] lib64
@ 0.0 B [ ] sbin
@ 0.0 B [ ] lib
@ 0.0 B [ ] bin
e 0.0 B [ ] /srv
e 0.0 B [ ] /opt
e 0.0 B [ ] /media
0.0 B [ ] .autorelabel
ncdu
again.