Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

shorn's avatar
Level 1

Incorrect disk space?

Hi,

Following on from an issue where my (linode/forge) server was reporting a full disk. I provisioned a new, fresh server and just added my single site to it. This site is ~6Gb in size. (Has locally stored assets).

All back up and running fine. However, I've been keeping an eye on disk usage and it's slowly creeping up again.

So running df -h gives the following...

Filesystem      Size  Used Avail Use% Mounted on
udev            1.9G     0  1.9G   0% /dev
tmpfs           395M  6.8M  388M   2% /run
/dev/sda         79G   15G   60G  20% /
tmpfs           2.0G     0  2.0G   0% /dev/shm
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs           2.0G     0  2.0G   0% /sys/fs/cgroup
tmpfs           395M     0  395M   0% /run/user/1000

I can't see how 15Gb is now showing as being used? When I checked it this morning (8 hours ago) it was showing as 13Gb used.

Where can I start to look to find out where this space is being used?

0 likes
7 replies
Cronix's avatar

I'd start looking at log files, and temp files. Those usually continue to grow, and if you are having errors in the background, they can grow quite rapidly. There are a lot of services on the server that are writing to log files, not just your app. If you don't find/fix the problem, you will continually run into it whether you build a new server or not (I think I saw a different post of yours where your solution was to destroy/rebuild it?) /dev/sda is your main disk, so you'll have to dig deeper on that drive to see where it is.

You can start with some of these commands to find which dirs consume the most disk space, and then see what's in those dirs. https://www.tecmint.com/find-top-large-directories-and-files-sizes-in-linux/

shorn's avatar
Level 1

@CRONIX - Hi, thanks for replying. Yes that's right, I did destroy the existing one and rebuild. Thought it would be easier to start a fresh and debug if needed from there.

I'm trying to check file sizes across the server. None of the logs of temp folders are particularly large. When I try to get file/folder sizes from the disk it gives me a lot of 'cannot read directory - permission denied errors.'

What it does come back with is

6.1G    home
1.7G    usr
1.1G    swapfile
1.1G    lib
927M    var

Which again, looks about right. Not sure how else i can see what's happening?

shorn's avatar
Level 1

df -h gives...

Filesystem      Size  Used Avail Use% Mounted on
udev            1.9G     0  1.9G   0% /dev
tmpfs           395M  6.9M  388M   2% /run
/dev/sda         79G   15G   60G  20% /
tmpfs           2.0G     0  2.0G   0% /dev/shm
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs           2.0G     0  2.0G   0% /sys/fs/cgroup
tmpfs           395M     0  395M   0% /run/user/1000

whereas df -i gives...

Filesystem      Inodes  IUsed   IFree IUse% Mounted on
udev            497315    384  496931    1% /dev
tmpfs           504935   2052  502883    1% /run
/dev/sda       5088000 221315 4866685    5% /
tmpfs           504935      1  504934    1% /dev/shm
tmpfs           504935      3  504932    1% /run/lock
tmpfs           504935     18  504917    1% /sys/fs/cgroup
tmpfs           504935     10  504925    1% /run/user/1000
Cronix's avatar

keep going, now check the home dir...keep going until you find the single dir that is taking up the most space. If it's /user/user21, then run it on that...keep going until there aren't more dirs to check, always following the largest dir (6.1G, for example).

shorn's avatar
Level 1

That's what i don't understand. It reports back that the biggest directory is my forge one, within that its my site folder and that's roughly 6Gb. Which is correct. I can't understand where the 15Gb usage is.

I can't seem to check folders/files elsewhere as keep getting permissions errors.

latz's avatar

take a look:

cd /
ls -la

Now you see the folders. Get the size:

du -hs /bin
du -hs /boot
du -hs /dev
du -hs /home
du -hs /lib
...
shorn's avatar
Level 1

@MLUTZ - That's helpful. Thanks. So I've run through all the folders

swapfile     1.1Gb
usr          1.7Gb
var      1.0Gb
lib          1.1Gb
home     6.1Gb

All the rest are approx < 100Mb.

Doesn't seem to add up!

Please or to participate in this conversation.