14.04 - How to locate the directory that uses all disk space - Ask Ubuntu
this question has answer here:
i have used ubuntu 14.04 server host company website , mailsystem. system online 3 weeks before not able send or receive emails. few minutes of debugging showed reason: no more disk space.
filesystem size used avail use% mounted on udev 3.9g 0 3.9g 0% /dev tmpfs 799m 8.7m 790m 2% /run /dev/xvda1 7.8g 7.4g 0 100% / tmpfs 3.9g 0 3.9g 0% /dev/shm tmpfs 5.0m 0 5.0m 0% /run/lock tmpfs 3.9g 0 3.9g 0% /sys/fs/cgroup tmpfs 100k 0 100k 0% /run/lxcfs/controllers tmpfs 799m 0 799m 0% /run/user/1000
question: how can locate directory occupies disk space?
i have tried using df -hs /path/to/directory
on root directories without luck. there 4gb of space not accounted for.
top 10 largest directories:
du -a / | sort -n -r | head -n 10
in more human readable format:
du -hsx / | sort -rh | head -10
largest 10 files:
find / -printf '%s %p\n'| sort -nr | head -10
there 4gb of space not accounted for.
lots of small files add 4gb...
i suggest @ obvious culprit:
/var/log/
if system has errors log them there. , errors 3 weeks can add 4gb. besides that: using databases on system? if so... check directory database stores files;/var/lib/mysql
instance.
Comments
Post a Comment