1

I believe I have found a problem with Linux Mint. (Version 17? - How do I check this?)

I have a program which has been running for several days and has produced an output file several hundred gigabytes in size.

I was about to run out of space (had about 10 GB left) so I stopped the program with CTRL-Z at a point where the output file was still open but I could ensure no read/write operations were being made at the point when the program was stopped.

Then I deleted the file. (Couldn't open it to clear contents, it was too large!)

Then I recreated the file. (Perhaps it's not a surprise that this caused me problems, I could hardly expect this to work correctly.)

BUT I have 2 problems. Firstly the program doesn't seem to be writing to ANY of the output files anymore? (There are 3 separate ones, only one was deleted.)

Secondly, there is NO EXTRA FREE SPACE? I can't understand why this is? There should be an extra 100 GB ... but there isn't?

Why is this and can I "fix it"? (I don't want my system to be suck forever with a 100 GB hole in it.)

2 Answers 2

0

This is expected behaviour. The file isn't actually deleted until all users of the file have closed their 'connection' to the file (that is, have released the file handle).

What you need to do is shut down the program, not just pause it. This will cause the program to release its connection, allowing the file system to delete the file.

3
  • Is there any way to resolve the issue without breaking the program? Commented Aug 25, 2015 at 14:43
  • Do you mean, "without shutting down the program"? If so, possibly. A well-designed program may respond to the HUP signal in a way that it closes log files and reloads configuration. It would depend on the program. Unless the program supports HUP in this way or offers another way of doing the same thing, the answer is no. Commented Aug 25, 2015 at 14:48
  • Unfortunately no it doesn't aha - oh damn that's all my data lost then :( Commented Aug 25, 2015 at 15:02
0

With the command "lsof" (LiSt Open Files) you can check if the file you deleted is still be used by a particular process (through a file descriptor/handler you can see under /proc/$PID_of_process/fd/). If so, garbage collector won't deallocate the space pointed by that inode even if you removed its last hard link with "rm" (or any other similar command).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .