Saturday, July 1

Clearing disk space when a file is deleted but still consuming space

[root@test01 /]# lsof  | grep deleted

Once you are sure of the culprit file, specifically grep that in lsof.

[root@test01 /]# lsof  | grep deleted | grep rabbit@test01.log-20151108
beam.smp   43563      root   10w      REG              253,0 29471244165          1371295 /var/log/rabbitmq/rabbit@test01.log-20151108 (deleted)

Find the entry in /proc/<pid>/fd/ that corresponds to the filehandle (for above case:)

[root@test01 /]# ll /proc/43563/fd/10

Now, just cat /dev/null into the fd:

[root@test01 /]# cat /dev/null > /proc/43563/fd/10

And we are good to go :-) 

No comments:

Post a Comment