0

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.

Running df -h shows 43GB size of /sda1/

after mounting /SDA1/, only seeing 6.4gb in use

Latest Wordpress installed..

UPDATE: Seems I may have a mysql bin logging issue. enter image description here

6
  • Run the file system check command fsck on the root file system. Reboot first and again after the command. Commented Sep 10, 2023 at 1:23
  • Thanks for the suggestion John. Think I got it nailed down to these darn binlogs in mysql. For now I deleted nearly 35gb or so, but they will more than likely come back. Trying to figure out how to gain access to mysql via GCP to get these darn things turned off now :( Commented Sep 10, 2023 at 4:04
  • Why do you want to delete the binlogs? Freeing disk space is not a good reason by itself. Are you backing up MySQL on a regular basis? Do not delete files unless you have a good reason to do so. My guess is you are not performing normal system monitoring and maintenance on MySQL or the system. Commented Sep 10, 2023 at 14:39
  • You would be correct. This is not something I'm familiar with. Could you recommend best practices for performing automated MySQL backups / purging of unnecessary logs? Leaving the binlogs as is was causing for disk space to continually fill up over time dropping the website completely. Also now charging me monthly $$ due to increased disk space. Any guidance here would be greatly appreciated. Otherwise I will be left to unfortunately clear binlogs for the time being. Commented Sep 10, 2023 at 18:23
  • Web search. Many articles have been written on how to use and manage MySQL. Far better than anything I would could write in 500 characters. Note: Deleting files will not save you money. You pay for the total size of the virtual disk, not how much you use within it. Commented Sep 10, 2023 at 19:58

1 Answer 1

0

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.

2
  • 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. Commented 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 space Commented Sep 10, 2023 at 2:03

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.