how to find big file and delete on linux system

190 views Asked by At

When I install something in my linux system( CentOS release 6.5 (Final) ).It happens.

Error Downloading Packages: ncdu-1.7-1.el6.x86_64: Insufficient space in download directory /var/cache/yum/epel/packages .

And I use df command,it shows:

df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda2        77G   73G     0 100% /
tmpfs           7.8G     0  7.8G   0% /dev/shm
/dev/sda1       239M   43M  183M  19% /boot

sda2 was mounted on /,but when I go to the root and use command du.

du -sh *
6.2M    bin
41M boot
176K    dev
26M etc
488K    export
6.7G    home
268M    lib
19M lib64
16K lost+found
4.0K    media
4.0K    mnt
56M opt
du: cannot access `proc/1531/task/1531/fd/4': No such file or directory
du: cannot access `proc/1531/task/1531/fdinfo/4': No such file or directory
du: cannot access `proc/1531/fd/4': No such file or directory
du: cannot access `proc/1531/fdinfo/4': No such file or directory
du: cannot access `proc/6873/task/7037/fd/125': No such file or directory
0   proc
640K    root
9.0M    sbin
4.0K    selinux
4.0K    srv
0   sys
569M    tmp
1.4G    usr
261M    var
4.0K    zookeeper_server.pid

where is my 77G gone? how do I find my big file and delete?

1

There are 1 answers

0
Gabriel Hautclocq On

If you cannot afford to reboot your server, this command shall help you :

lsof | grep "/var" | grep deleted

It will show you if there is any deleted file still in memory, and help you find which service has to be restarted.

If that is an option, a server reboot can also solve the problem.