# Problem with disk space



## erikf154 (Mar 5, 2010)

I just removed a 2GB file in /var to free up disk space. However, it looks as though no space have been freed up. Running df reports that the disk is still full. On the other hand, du reports only 285MB being used in /var. What's going on? Trying to copy files to /var only results in the "No space left on device". 


```
# df -h
Filesystem                                                   Size    Used   Avail Capacity  Mounted on
/dev/da0s1a                                                  496M    221M    235M    48%    /
devfs                                                        1.0K    1.0K      0B   100%    /dev
/dev/da0s1e                                                  496M     14K    456M     0%    /tmp
/dev/da0s1f                                                   13G    5.4G    6.7G    45%    /usr
/dev/da0s1d                                                  2.4G    2.2G    -39M   102%    /var

# du -hd 1 /var
2,0K    /var/.snap
2,0K    /var/account
6,0K    /var/at
2,0K    /var/audit
 14K    /var/backups
4,0K    /var/crash
4,0K    /var/cron
179M    /var/db
2,0K    /var/empty
2,0K    /var/heimdal
 84M    /var/log
902K    /var/mail
4,0K    /var/msgs
 48K    /var/named
2,0K    /var/preserve
 48K    /var/run
2,0K    /var/rwho
 22K    /var/spool
 21M    /var/tmp
 22K    /var/yp
2,0K    /var/games
2,0K    /var/agentx
6,0K    /var/net-snmp
285M    /var
```


----------



## erikf154 (Mar 5, 2010)

I figured it out, I had to restart the service that was using the logfile I deleted. The system does not release the space while an application is using the file, even after it's been deleted.


----------



## graudeejs (Mar 5, 2010)

You are correct, File is lost only when all File Descriptors pointing to it are closed


----------

