RE: df reporting and removing files (Re: (no subject))

2007-07-18 Thread Elmian Shabahang
Hello ,

Thanks for your complete and helpful explanation. 

I would be thankful if you could help me with following question.

as I get , some processes are still blocking the file. How can I find and
kill them? 

 

Best regards,

Elmian,

 

 

-Original Message-
From: Bob Proulx [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, July 17, 2007 8:01 PM
To: Elmian Shabahang
Cc: bug-coreutils@gnu.org
Subject: df reporting and removing files (Re: (no subject))

 

Elmian Shabahang wrote:

> Hello,

 

In the future please include a meaningful subject line otherwise it is

likely that your message will be deleted without reading because it

looks too much like spam.

 

> Please find following information:

> /dev/vg00/lvol8   8.7G  7.7G  619M  93% /u01

> 

> [EMAIL PROTECTED] u01]$ du -lkhs /u01

> 5.5G/u01

 

You appear to be concerned that df reports 7.7G used but du does not

find it by traversing the filesystem?  Is that correct?

 

> Note that I have deleted a 2.2 GB file , and du don't update the output

> table.

 

That is perfectly okay.  The 'df' command reports information about

filesystem.  The 'du' command traverses directories and reports

information in directory hierarchies.  Those are two different things

and they may report different information.  In this case it means that

disk space is in use by processes but is not reachable by the

directory hierarchy.  Since you said that you removed the file from

the directory this information is verified.

 

The filesystem recovers disk space through garbage collection.  When

files are busy the disk space is in use.  When the reference count for

a file is reduced to zero then the filesystem recovers the disk blocks

associated with the file.

 

Removing files removes the directory pointer to that file but it does

not remove the file from use by running processes.  If a running

process has the file open then the reference count will be non-zero

due to use by that process and the filesystem will not be able to

reclaim that disk space until the process exits.

 

A typical example is a program writing a log file.  The log file may

grow to be quite large.  As long as the process is running the

reference count for that file will be non-zero.  Removing the file

from the directory will not free up the disk space.  In fact doing so

means that there is no no way to access that file again.  The only way

to reduce the reference count would be to kill the process that holds

the file in use.  To avoid this case it is better to truncate large

files to free up the disk space immediately instead of removing them.

 

Hope that helps.

 

Bob

___
Bug-coreutils mailing list
Bug-coreutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-coreutils


(no subject)

2007-07-17 Thread Elmian Shabahang
Hello,

Please find following information:

 

[EMAIL PROTECTED] u01]$ df -lkh

FilesystemSize  Used Avail Use% Mounted on

/dev/vg00/lvol0   6.8G  347M  6.1G   6% /

/dev/cciss/c0d0p1  97M   17M   76M  18% /boot

none  1.8G 0  1.8G   0% /dev/shm

/dev/vg00/lvol2   2.9G  785M  2.0G  28% /tmp

/dev/vg00/lvol8   8.7G  7.7G  619M  93% /u01

/dev/vg00/lvol929G   23G  4.9G  83% /u02

/dev/vg00/lvol1   3.9G  2.6G  1.1G  71% /usr

/dev/vg00/lvol3   2.0G  240M  1.6G  13% /var

/dev/cciss/c0d167G   60G  4.4G  94% /backup

[EMAIL PROTECTED] u01]$ du -lkhs /u01

5.5G/u01

[EMAIL PROTECTED] u01]$ man df

[EMAIL PROTECTED] u01]$ uname -a

Linux dbapp032 2.4.21-15.ELsmp #1 SMP Thu Apr 22 00:18:24 EDT 2004 i686 i686
i386 GNU/Linux

[EMAIL PROTECTED] u01]$

 

Note that I have deleted a 2.2 GB file , and du don't update the output
table.

 

Best regards,

shabahang

 

___
Bug-coreutils mailing list
Bug-coreutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-coreutils