ONTAP Discussions

NFS Space Not Available After Deleting (7-Mode)

CKJ
5,118 Views

When files are deleted from an NFS share, the space is not reclaimed until after two weeks. How can I correct this to reclaim the space immediately?

3 REPLIES 3

NAYABSK
5,102 Views

Hello, 

 

 

Thank you for reaching out to NetApp communities with your issue, May i know what flavor and version of UNIX is this ?

 

 

Thanks,

Nayab

CKJ
5,083 Views

Its Redhat 5.4.

NAYABSK
5,088 Views

Hi,

 

In most cases, space utilisation values returned from ‘df’ and ‘du’ will be consistent. However, the potential exists for a running process to delete a large file and according to ‘du’, the large file no longer exists, so the blocks associated with the deleted file are not reported. With the process still running, and with an open file descriptor still held against the deleted file, ‘df’ continues to track and report all disk blocks used, including those associated with the deleted (phantom) file. In this situation, the disk space associated with the deleted file will only be relinquished back to the system
when the process completely releases the deleted file’s descriptor or the process terminates (either gracefully or killed).


The solution is to identify and stop (or kill) the process that continues to hold a file descriptor open for the deleted file.

 

To do so, run the lsof command (/usr/sbin/lsof | grep deleted) as root to identify the holding process

 

For example:

 

# lsof | grep deleted

 

Kill the corresponding process which is holding your free blocks...

 

 

Thanks,

Nayab

 

Public