0

Having trouble finding the files causing space issues on my server. Running the "df -h" command results in:

/dev/xvda1           ext3   4.0G  693M  3.3G  18% /
/dev/mapper/vg00-usr ext4   8.9G  8.9G     0 100% /usr
/dev/mapper/vg00-var ext4    73G   45G   25G  65% /var

However, when I cd to /user and run "du -sh", it only shows 1.3G used. Is there somewhere else these files could be stored or something that might not be showing up? This is on a Centos server with Plesk

kilrizzy
  • 121
  • 4

1 Answers1

2

You could run lsof|grep delete (as root, or sudo), which will show you all deleted files. You could have files that were opened by a process, then deleted, but the process is still running and holding handles to the file.

This could happen if, for example, you are cleaning space up and delete a log file that is being used by something, but the program is still running and writing to it.

If that is the case, you'll have to stop the program running that has the open handle (lsof will tell you that also), and then it will release the space.

Space is only released after all handles to a file are gone. This is a trick some programs use for temp files; they open a file then delete it, so in general people can't read the temp files, and if the program quits or dies for some reason, the file is automatically deleted.

lsd
  • 1,673
  • 10
  • 10
  • Ah thanks! Looks like this was a problem from when the server had to be cleaned up from some junk sending out spam and filled up the maillog. So would this mean I need to stop / restart rsyslogd? rsyslogd 890 root 2w REG 253,0 8073121792 2 6882 /usr/local/psa/var/log/maillog (deleted) – kilrizzy Mar 18 '16 at 18:24
  • And is that something I can safely do while the server is running? – kilrizzy Mar 18 '16 at 18:24
  • nvm that did it! sudo service rsyslog restart – kilrizzy Mar 18 '16 at 18:32