Friday, April 21, 2017

Linux: Why deleting files does not free space

You are in the middle of compiling your code and you see errors:
/disk/user1/platform_dev/odfl/driver/openwrt/staging_dir_arm_platform/bin/arm-unknown-linux-uclibcgnueabi-objcopy:/disk/user1/platform_dev/odfl/driver/base/build_platform/kmod/linuxmodule/stI4AuYi: No space left on device
make[5]: *** [/disk/user1/platform_dev/odfl/driver/base/build_platform/kmod/linuxmodule/handlerproxy.o] Error 1
make[5]: *** Waiting for unfinished jobs....

So this is just like old times. You run df -h and check if you are running at disk capacity.
I find that I am at 70% disk usage but still the make process is complaining.

I decide to be conservative and free up more space on the system.
Then I see something interesting. Despite doing the rm -Rf on a couple of big chunks of data,
I do not see the free space on my system going up. 

That gets me thinking why this might be happening. The reason is that the deletes I did were through screen. And, Linux will not free up any descriptors (Inodes) as long as they are being referred through some process.