File delete issue

After a really busy morning, one of my apache error log files was 9.5GB. It was a silly mistake in php coding on my part.

I went ahead and deleted the file (disk was full), but when I do :
[CMD=""]df -h[/CMD] it still shows this :

Code:
Filesystem            Size    Used   Avail Capacity  Mounted on
/dev/mirror/gm0s1a    1.9G    240M    1.5G    13%    /
devfs                 1.0K    1.0K      0B   100%    /dev
/dev/mirror/gm0s1e    1.9G     58K    1.8G     0%    /tmp
/dev/mirror/gm0s1f    210G    3.1G    190G     2%    /usr
/dev/mirror/gm0s1d    9.7G    9.7G   -770M   108%    /var

/var is still 100% full. How do I free this space up?
 
I'm not sure to be honest, someone else setup gmirror for me.

If I did, where would they generally be located in?
 
You'll also need to restart Apache. If it's still running, then it has the file handle still open, so the filesystem will not release the space used by the "deleted" file.

And, if it's a syslog-managed log file, then you need to restart syslogd as well.
 
for ufs slanpshot look in root of partition, I think there was .ufs folder, not sure.
All I remember is that it was hidden directory (that is starts with dot, you need ls -a to see it) and that it was in root of partition. In your case /var/

But first do what phoenix said.
 
killasmurf86 said:
for ufs slanpshot look in root of partition, I think there was .ufs folder, not sure.
All I remember is that it was hidden directory (that is starts with dot, you need ls -a to see it) and that it was in root of partition.
/root/of/partition/.snap

Fonz
 
Anyhoo: this always happens when removing log files that are actively being written to. Instead of removing them and having to restart the daemon that has the file handle open, you can just copy /dev/null to it, or echo an empty string to it. Then it will be of size zero, and no daemon will have to be restarted. The space will be returned to the system, and all file ownerships and permissions will remain intact.
 
Back
Top