Bonno Bloksma wrote:
> The /var/log/syslog file was over 4GB large. I deleted it using a
> simple rm /var/log/syslog command and the file is indeed no longer
> there.

As others have noted simply removing the file only removes it from the
directory.  It will NOT free up the disk space until the last file
handle to it is closed.  The filesystem is effectively a garbage
collection system and does reference counting.  Only when the
reference count goes to zero will the block space be freed.

In the future instead of removing a file that you want to be freed
immediately consider truncating it instead.  By truncating the file it
does not matter if there are other handles to it.  The filesystem will
immediately free the storage associated with it.  The running syslogd
in this case will continue to write to the same file handle.

  root@example:~# : >/var/log/syslog

I use ":" (aka "true") because historically a file redirection without
a command associated with it was not guaranteed portable.  Probably
doesn't matter today.  Just one of my quirks now.

Bob

Attachment: signature.asc
Description: Digital signature

Reply via email to