Tuesday, September 14, 2010

Disk space not updating in linux df -h after deleted files

If the partition used space increase in to 100%, we had to delete unnecessary file to have more space.

But after deleting the files df –h command not updating the actual space details and we are unable to create any file.

So solve this issue we need to follow following trick.

 

ls -ld /proc/*/fd/* 2>&1 | fgrep '(deleted)'

 

It shows the files that are deleted but  still in use by a running process.
 
lrwx------ 1 root root 64 Sep 15 10:45 /proc/2958/fd/12 -> /tmp/ibSAlc0V (deleted)
lrwx------ 1 root root 64 Sep 15 10:45 /proc/2958/fd/5 -> /tmp/ibUpZrp7 (deleted)
lrwx------ 1 root root 64 Sep 15 10:45 /proc/2958/fd/6 -> /tmp/ibUmDSgz (deleted)
lrwx------ 1 root root 64 Sep 15 10:45 /proc/2958/fd/7 -> /tmp/ibcLKj80 (deleted)
lrwx------ 1 root root 64 Sep 15 10:45 /proc/2958/fd/8 -> /tmp/ibubhw0s (deleted)
lrwx------ 1 root root 64 Sep 15 10:45 /proc/32645/fd/0 -> /dev/pts/1 (deleted)
lrwx------ 1 root root 64 Sep 15 10:45 /proc/32645/fd/1 -> /dev/pts/1 (deleted)
lrwx------ 1 root root 64 Sep 15 10:45 /proc/32645/fd/2 -> /dev/pts/1 (deleted)
lrwx------ 1 root root 64 Sep 15 10:45 /proc/32645/fd/255 -> /dev/pts/1 (deleted)
lrwx------ 1 root root 64 Sep 15 10:44 /proc/6788/fd/0 -> /dev/pts/38 (deleted)
lrwx------ 1 root root 64 Sep 15 10:44 /proc/6788/fd/1 -> /dev/pts/38 (deleted)
lrwx------ 1 root root 64 Sep 15 10:44 /proc/6788/fd/2 -> /dev/pts/38 (deleted)
 
so we need to stop or restart that process to update the disk space.
 
 

ps ax | grep 2958

 

kill -9 2958

 

 

1 comment: