I'm running Wordpress instance on top of a Linux GCP VM instance. In SSH, running cmd 'df -h' I see /dev/sda1 is 91% used up. I mounted sda1 to see what could be taking up all the space, but mounting it only shows 6GB. How can I find this other usage? Please help. I've keep expanding my Disk space on GCP. I started with the free tier 30GB, then pumped to 40GB. It keeps filling up and now I'm up to 50GB and I imagine it is only a matter of time till this fills up again.
1 Answer
You may have some deleted-while-still-open files.
Run sudo lsof +L1 to see if that is the case.
Explanation: if you delete a file that is still in use by some process, the file will immediately vanish from the filesystem directory, but the process(es) accessing the file can still keep using the file as normal. The filesystem will actually delete the file only after those processes have all either closed the file or exited. Until then, the file will still be using disk space.
Typically this happens when a new Linux administrator notices log files taking up too much space, and attempts to fix it just by deleting the files without checking if they are in use first. If the system is rebooted, the problem will "mysteriously" go away: as all processes are stopped, any deletions will run to completion automatically.
If your WordPress is not up to date, another possible reason is unfortunately that your VM may have been hacked. Out-of-date versions of WordPress have had several well-known security vulnerabilities in the past.
-
Thanks @telcoM. I tried the cmd you mentioned but came back with "command not found". I looked up an alternative to lsof and found "sudo fuser -vm / 2>&1 | awk '$3 ~ /f|F/' | less" which seemed to work. I didn't seem to find any files in use of any significant size. As for my wordpress version, I should have the latest 6.3.1.PlezHelp– PlezHelp2023-09-10 01:18:58 +00:00Commented Sep 10, 2023 at 1:18
-
Looking at this some more, seems ./var/lib/mysql is the culprit. Looking at this more now, but not familiar with searching mysql data on google cloud environment. New to this spacePlezHelp– PlezHelp2023-09-10 02:03:13 +00:00Commented Sep 10, 2023 at 2:03




fsckon the root file system. Reboot first and again after the command.