Linux
df -h /path/
Python3
import shutil
import human_readable
df = shutil.disk_usage('/')
df._asdict()
df.total
df.used
df.free
{k:human_readable.file_size(v, gnu=True) for k, v in d._asdict().items()}
获取挂载点
https://stackoverflow.com/questions/4453602/how-to-find-the-mountpoint-a-file-resides-on