AIX6.1 Remove file descriptor from specified process


 
Thread Tools Search this Thread
Operating Systems AIX AIX6.1 Remove file descriptor from specified process
# 1  
Old 05-04-2012
AIX6.1 Remove file descriptor from specified process

Hi,

How to release file description area from specified process.

Problem is that process started - open one file ( ~2GB ) - file has been removed - process still shown that file is used by process and can't release space on filesystem.

It is not allowable to kill process !!!

Regs,
Krzysztof
# 2  
Old 05-04-2012
There is no solution except to stop the process in the tidiest manner possible. Only ever use kill if all other methods have failed.

Next time, null the file rather than deleting it.
# 3  
Old 05-04-2012
So I thought it would end. But thanks for to get rid of my illusions. Regards
# 4  
Old 05-05-2012
It is an ABSOLUTE NO-NO, ok, let me emphasize this: ABSOLUTE NO-NO to remove files which are still opened by a process. The reasons for this you have just experienced.

If you want to remove a large log file then "zap" it instead of removing it: copy /dev/null, which contains a single EOF char, to the file, overwriting its content. This way the file itself is preserved while its content is reduced to 0.

A "file" is a collection of data identified by some information in the file system and its driver: the i-node(-number), the directory location, the name, etc.. All this information is preserved by "zapping" it, while deleting it removes this data, along with the content.

Code:
 cat /dev/null > /some/large/file

I hope this helps.

bakunin
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Solaris

Bad exchange descriptor : not able to remove files under zpool

Hi , One of my zone went down and when i booted it up i could see the pool in degraded state with some check sum errors . we have brought the pool online after scrubbing. But few files are showing this error Bad exchange descriptor Please let me know how to remove these files (2 Replies)
Discussion started by: chidori
2 Replies

2. UNIX for Advanced & Expert Users

Dup2 - for file descriptor opened by a different process

is it possible to duplicate file descriptors(opened by a different process) with the help of dup or dup2. the two process do not share parent child relationship as well. (2 Replies)
Discussion started by: replytoshishir
2 Replies

3. UNIX for Advanced & Expert Users

Close file descriptor without terminating process

Can any help me in finding the way to close opened file descriptor in Solaris ,without killing process. As accidently a file was removed which was opened by a process. Much thanks in advance :) (11 Replies)
Discussion started by: nitj
11 Replies

4. AIX

Unable to gunzip .tgz file in AIX6.1

Hi guys, This is my 1st post here. I tried to Google around but failed to get my solution. So I hope you guys could help me. (I have just a basic unix background for 2years so I'm sorry if im asking stupid questions) OS - Aix 6.1, 64 bits. Server - currently I only have telnet access to a... (12 Replies)
Discussion started by: pilotHans
12 Replies

5. UNIX for Dummies Questions & Answers

File Descriptor

Hi What the below path contains? /proc/<pid>/fd (1 Reply)
Discussion started by: siba.s.nayak
1 Replies

6. Shell Programming and Scripting

File Descriptor

Hello All, Im opening a file desciptor in perl and sending data using print CMD "$xyz". is there a limit to the length of the string that I can give to this CMD at a time. (3 Replies)
Discussion started by: rimser9
3 Replies

7. Programming

File descriptor constant

I have a requirement to close all the file descriptors from 3 to 1024 for a particular application. Right now, this is how I do it .. for ( int i = 3 ; i <= 1024; ++i ) close(i); The change I am looking at is, I want to do away with the number 1024 and replace it with a constant which... (4 Replies)
Discussion started by: vino
4 Replies

8. Programming

Problems with file descriptor

Hi, look at the following code: The client after estabilishing a connection with the server does the following: if ((peter = fopen(argv, "r")) == NULL){ printf("errore\n"); exit(0); } ... (11 Replies)
Discussion started by: teo
11 Replies

9. UNIX for Dummies Questions & Answers

File Descriptor Help

What is a file descriptor in Unix?? How to find a file descriptor of a file in Unix?? Does it have anything to do with the Inode numbers?? (3 Replies)
Discussion started by: rahulrathod
3 Replies

10. UNIX for Dummies Questions & Answers

file activity (open/closed) file descriptor info using KORN shell scripting

I am trying to find a way to check the current status of a file. Such as some cron job processes are dependent on the completion of others. if a file is currently being accessed / modified or simply open state I will wait until it is done being processed before attempting the next process on that... (3 Replies)
Discussion started by: Gary Dunn
3 Replies
Login or Register to Ask a Question