Server hard drive filled up

Problem to solve

Hard drive full. Error when trying to install latest update.

Versions

Self managed : 17.4.1
Debian : 12/Bookworm

Setup

I have gitlab running on a 16gb VM. It only hosts a couple small projects, none content has large file sizes.

Question

Can someone help me find what is using up all space and how to clean it up? Perhaps it has something to do with the updates that need to be installed in large quantity?

1 Like

So, it seems like gitlab needs 4g to do an this update? Can someone please help, that can’t be right. (Note : data below is prior to the update running and failing = I restored from a snapshot)

root@gitlab:/# du -h -d 1 /
36K     /tmp
3.0G    /opt
6.3M    /etc
492K    /run
4.0K    /mnt
191M    /boot
16K     /lost+found
8.0K    /media
56K     /root
0       /proc
2.2G    /usr
4.0K    /srv
0       /sys
4.7G    /var
84K     /dev
32K     /home
10G     /
root@gitlab:/# df -h
Filesystem      Size  Used Avail Use% Mounted on
udev            3.9G     0  3.9G   0% /dev
tmpfs           794M  492K  794M   1% /run
/dev/sda1        15G   10G  4.0G  72% /
tmpfs           3.9G   84K  3.9G   1% /dev/shm
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs           794M     0  794M   0% /run/user/1000
root@gitlab:/var/cache# du -h -d 1 /var/cache
4.0K    /var/cache/private
3.0G    /var/cache/apt
5.0M    /var/cache/debconf
4.0K    /var/cache/adduser
1.3M    /var/cache/man
48K     /var/cache/dictionaries-common
16K     /var/cache/ldconfig
224K    /var/cache/apparmor
3.0G    /var/cache
root@gitlab:/var/cache# du -h -d 1 /var/log
8.0K    /var/log/runit
15M     /var/log/installer
4.0K    /var/log/private
420K    /var/log/apt
170M    /var/log/journal
493M    /var/log/gitlab
678M    /var/log

Try a:

apt-get clean all

since you have 3GB under /var/cache/apt. That will help a bit at least. But you will probably have to resize your disk from 15GB to something bigger. The installation under /opt/gitlab will require 4GB of space.

Nothing to help clean up gitlab itself? I see it has almost 500mb of logs.

You can delete the logs as well if you like, but your disk is still way too small. I’ve no idea why you think 15gb is enough to run a server. Expect disk space to increase as you use a server, and therefore extend/expand your disk appropriately.

apt-get clean doesn’t take an argument, so whatever you intended all to mean there: it doesn’t.

Yep, correct, probably stems from me using multiple distros and the dnf clean all command, and applied the same methodology with the apt-get command :slight_smile: