[ILUG] file size strangeness

P at draigBrady.com P at draigBrady.com
Wed Sep 22 21:45:11 IST 2004


Cian Cullinan wrote:
> "ls -l" and "du -s" are
> reporting different values for many files, eg:
> 
> [root at Netmon10 root]# ls -lh /var/log/httpd/access_log
> -rw-r--r--    1 root     root         2.1M Sep 22 21:25
> /var/log/httpd/access_log
> 
> [root at Netmon10 root]# du -hs /var/log/httpd/access_log
> 37M     /var/log/httpd/access_log

Hmm there is a difference between the blocks used and the file size.
I would guess that some program had access_log open, thus
keeping a hold on the blocks even if the file is truncated etc.
by another process. lsof /var/log/httpd/access_log should tell
you if some process has it open, and restarting that processes
should free the blocks up?

-- 
Pádraig Brady - http://www.pixelbeat.org
--- Following generated by rotagator ---

Exporting filesystems over NFS

To export filesystem in NFS with read-only access and no root
write access, edit the /etc/exports file and add the following line:
/dir/to/export (ro,insecure,all_squash).

'man 5 exports' for other details

The `exportfs -r` command makes the /etc/exports command take affect
--



More information about the ILUG mailing list