1

Had a runaway log file that filled up my disk space. I was able to identify and delete it, but it would seem that it is still in use somewhere as df -h shows my disk as 160G/160G used even though the file I deleted was 146G. This issue and other solutions advise using lsof, but that isn't present on my system. Running yum install lsof (running CentOS 7) fails due to not having enough disk space.

Any suggestions on how to free up this phantom disk space?

5
  • 2
    rebooting will kill the process (and finish deleting the file). you can probably install lsof before it fills up again :-) Oct 24 '18 at 20:01
  • @ThomasDickey thanks for the suggestion but I've actually already restarted the server a handful of times. Figured that would do the trick but it doesn't seem to have. Been using /sbin/shutdown -r now -- should I be using something else?
    – Mrweiner
    Oct 24 '18 at 20:10
  • 6
    You can see the open files using sudo ls -l /proc/*/fd | less
    – gollum
    Oct 24 '18 at 20:16
  • 3
    If you've rebooted and the disk space is still not freed, check /lost+found and, if it's not there, you might need to fsck.
    – DopeGhoti
    Oct 24 '18 at 20:26
  • 1
    If the fuser command is available, it can be used to see open files.
    – fpmurphy
    Oct 25 '18 at 1:33
6

Ugh, turns out a different file had generated after I'd deleted the initial one and I just missed it. Deleted that one and things seem to be back running. Great suggestions in the comments above, though!

@gullum's suggestion of sudo ls -l /proc/*/fd | less did essentially what I was looking to do with lsof.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.