-1

This is output after i run df -h

Filesystem      Size  Used Avail Use% Mounted on
/dev/vda1        30G   19G  9.1G  68% /
none            4.0K     0  4.0K   0% /sys/fs/cgroup
udev            487M  4.0K  487M   1% /dev
tmpfs           100M  348K  100M   1% /run
none            5.0M     0  5.0M   0% /run/lock
none            498M     0  498M   0% /run/shm
none            100M     0  100M   0% /run/user
/dev/sda         25G  6.4G   17G  28% /mnt/volume-sgp1-01

I want to identify what are 19G being used.

So i run below command

du -h --max-depth=10 --one-file-system / | sort -rh | head -25

to get following output

14G /
12G /var
8.8G    /var/lib
8.6G    /var/lib/mysql
8.1G    /var/lib/mysql/getapple_phpbb
1.6G    /var/www
916M    /usr
546M    /var/www/tskthai.com/public_html
546M    /var/www/tskthai.com
517M    /var/www/tskthai.com/public_html/wp-content
464M    /lib
431M    /var/www/ereaderok.com/public_html
431M    /var/www/ereaderok.com
396M    /home
381M    /var/www/himaparn.com/public_html
381M    /var/www/himaparn.com
378M    /var/lib/mysql/getapple_paysmile
368M    /lib/modules
306M    /var/www/tskthai.com/public_html/wp-content/uploads
295M    /usr/lib
255M    /var/www/getapple.net/public_html
255M    /var/www/getapple.net
250M    /opt
244M    /usr/share
242M    /opt/datadog-agent

you can see that the main directory being used is / which is only 14gb

So where are the remaining 5GB are being used?

Please advise.

chaintng
  • 519
  • 4
  • 8
  • 1
    Have you restarted recently? Are you sure you don't have any open, but deleted files? BTW, adding `--one-file-system` to your du would restrict the output to a particular filesystem. – Zoredache May 12 '17 at 19:22
  • 2
    Remember that du may not include the filesystem overhead blocks which can be considerable if the files are of any size and also the disk size. – mdpc May 12 '17 at 20:17
  • I update the result of new command. Still have no idea where 5gb is being used. It's depleting my disk space right now. – chaintng May 16 '17 at 02:31

1 Answers1

1

Try to execute lsof | grep delete, you could find there deleted files that haven't seen by du, but use disk. Also you could find process PID who lock this files. Restart it and take your disk space back!

Alexander Tolkachev
  • 4,608
  • 3
  • 14
  • 23
  • Oh wow, you're absolutely right! That's like a magic. My space now clean up after restart apache2 (lock log file). Thanks again. – chaintng May 16 '17 at 15:22