0

I was writing a huge file output.txt (around 10GB) on a server thorugh a python script using the f.write(row) command but because the process was too long I decided to interrupt the program using

kill -9 pid

The problem is that this space is still used on the server when I check with the command

df -h

How can I empty the disk occupied by this buffer that was trying to write the file?

the file output.txt was empty (0 Byte) when I killed the script, but I still deleted it anyway using

rm output.txt

but the space in the disk doesn't become free, I still have 10 GB wasted..

Alexis K.
  • 101
  • 2

2 Answers2

0

If you delete a file which is opened in some processes, it's marked as deleted, but the content remains on disk, so that all processes still can read it. Once all processes close corresponding descriptors (or simply finish), the space will be reclaimed.

user3159253
  • 16,836
  • 3
  • 30
  • 56
0

check the proccesses to see if it is still running, if yeah, just get the id and wright on the terminal:

kill proccess_id
Sir. Hedgehog
  • 1,260
  • 3
  • 17
  • 40