I have a problem that my disk is filling up but I cant find the files that fill it.
When I run df -h
I get:
Filesystem Size Used Avail Use% Mounted on
/dev/root 53G 51G 2.0G 97% /
devtmpfs 2.0G 4.0K 2.0G 1% /dev
none 395M 204K 395M 1% /run
none 5.0M 0 5.0M 0% /run/lock
none 2.0G 0 2.0G 0% /run/shm
none 100M 0 100M 0% /run/user
I cleared all caches, logs and auto remove files. When I read this command du -h /var | sort -nr | head -n 10
I get:
1016K /var/www/soFit/cache/class_folder-242/soinfitcom/cl
1016K /var/www/landing/PHPMailer/vendor
1008K /var/www/dating/libs/vendor
988K /var/www/libs/mPDF/ttfontdata
968K /var/www/landing/PHPMailer/vendor/phpmailer
964K /var/www/landing/PHPMailer/vendor/phpmailer/phpmailer
960K /var/www/soFitTest/groupChats/vendor/symfony/http-foundation
960K /var/www/soFitTest/chat/vendor/symfony/http-foundation
960K /var/www/soFit/groupChats/vendor/symfony/http-foundation
960K /var/www/soFit/chat/vendor/symfony/http-foundation
Using du -x / | sort -rn | head -n 10
2471828 /
1592004 /var
1091532 /var/lib
929776 /var/lib/mysql
776620 /usr
715092 /var/lib/mysql/soFit
306064 /var/www
291376 /usr/lib
269176 /usr/share
180868 /var/www/libs
My mysql db size is ~500MB, not that big.
Where is all the 51G of space are gone to?
My linux is: Debian GNU/Linux 7.11 (wheezy)
du -h --max-depth=1 /
4.0K /dev
6.4M /etc
4.0K /mnt
759M /usr
4.0K /selinux
5.5M /root
20K /home
24K /srv
4.0K /opt
0 /sys
8.0K /tigo
8.0K /media
16K /lost+found
1.6G /var
6.5M /sbin
4.0K /lib64
7.0M /bin
4.0K /.ssh
204K /run
15M /lib
4.0K /boot
12K /tmp
du: cannot access `/proc/4557/task/19375/fdinfo/312': No such file or directory
du: cannot access `/proc/13067/task/13067/fd/4': No such file or directory
du: cannot access `/proc/13067/task/13067/fdinfo/4': No such file or directory
du: cannot access `/proc/13067/fd/5': No such file or directory
du: cannot access `/proc/13067/fdinfo/5': No such file or directory
0 /proc
61M /backups
2.4G /
The answer was to find the files using: lsof | grep -i deleted
and to delete this files.
Shutdown the machine completely not only reboot
var/libs/mysql delete (none).log
du
in/var
? – Henrik supports the community May 15 '17 at 12:19/
as an argument todu
. I.e. use something likedu -xh / | sort...
- The| sort...
looks alright, but personally I prefer using--max-depth=1
and then repeating in the biggest directory, like @Yaron suggests in his answer. – Henrik supports the community May 15 '17 at 12:22du
as root? I simply dont believe that to be the biggest directories on your disc - and du typically also reports the parent directories, so even if your output is correct it should start with/var
or/usr
(or some other top level directory). – Henrik supports the community May 15 '17 at 12:27du
's-h
(that uses suffixes) andsort
's-n
(that ignores them). – Henrik supports the community May 15 '17 at 13:11