3

Possible Duplicate:
Linux server out of space

I deleted an open file and the disk usage was not reduced.

Will it free up the space if I deleted the link in /proc/PID/fd/N ? what will happen to the process (in general)?

To be specific: The server is running Zimbra and the sync.log just gone crazily big occasionally (it's Zimbra's bug)

2 Answers2

4

You have a running process writing to the file. You should have truncated or zeroed the logfile instead of deleting it. See the detail and explanation of the process here, but something like : > /path/to/sync.log would work.

At this point, you'll have to restart the Zimbra daemon to realize the newly-freed space.

Obviously, this is treating the symptom, and you'll hopefully have an opportunity to fix this at the Zimbra level.

ewwhite
  • 194,921
  • 91
  • 434
  • 799
1

The better way to delete a file that is being written to is simply cp /dev/null into it

cp /dev/null /path/to/file 
Mike
  • 21,910
  • 7
  • 55
  • 79
  • With usual shells (POSIX sh, bash, ksh, zsh, ...) `: > /path/to/file` or just `> /path/to/file` are simpler and strictly equivalent. – jlliagre Apr 30 '12 at 05:34