How to find available space on mounted block storage volume?

January 21, 2018 432 views
Block Storage Ubuntu 16.04

I have a droplet with 30GB hard drive, and 100GB additional block storage volume. That volume is mounted at /mnt/p4-shareddepot, and accessable there for read and write. How do I get the available space on this drive? As below, I run the df command of that location but it still just returns the result for the original 30GB drive. Any way to check this?

┌──[Mon Jan 22 11:50:38 **********@************ : /mnt/p4-shareddepot]
└─> $ df -h /mnt/p4-shareddepot
Filesystem      Size  Used Avail Use% Mounted on
/dev/vda1        30G  8.2G   21G  28% /

Thanks
Richard

2 Answers

Run df -h without any other arguments. That should output space usage details for all available filesystems.

/mnt/p4-shareddepot is showing your Droplet's local storage filesystem because the directory itself is technically part of it, not the block storage volume. Every file or directory that is inside of it, however, is located on the block storage volume. So, if you run df -h /mnt/p4-shareddepot/file, you should see the block storage volume's space usage.

Hi Kamaln

Unfortunately this has not worked for me, I still can only see the droplet's filesystem:


┌──[Thu Jan 25 12:24:57 **********@************ : /home]
└─> $ df -h
Filesystem      Size  Used Avail Use% Mounted on
udev            488M     0  488M   0% /dev
tmpfs           100M  3.1M   97M   4% /run
/dev/vda1        30G  8.8G   21G  31% /
tmpfs           497M     0  497M   0% /dev/shm
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs           497M     0  497M   0% /sys/fs/cgroup
tmpfs           100M     0  100M   0% /run/user/1000

┌──[Thu Jan 25 12:25:36 **********@************ : /mnt/p4-shareddepot/test]
└─> $ df -h /mnt/p4-shareddepot/test
Filesystem      Size  Used Avail Use% Mounted on
/dev/vda1        30G  8.8G   21G  31% /
Have another answer? Share your knowledge.