Score:0

/var/lib/ using majority of my space

jp flag

I have a Digital Ocean VPS with 2GB RAM, 50GB space, and 1 vCPU. Running Ubuntu Server 20.04 LTS

Yet, I have only 16GB left. After looking into this further, I've found that my /var/lib directory is utilizing 22GB. Yet, when I look into those folders, I'm not seeing any files that appear to be taking up that amount of space.

This is running LAMP for a Wordpress install. I have two virtuals live the. /var/www directory is only taking up 6GB and I'm able to account for everything.

uname -a
Linux website 5.4.0-80-generic #90-Ubuntu SMP Fri Jul 9 22:49:44 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

aaron@website:/var/lib$ ls
AccountsService    dpkg             man-db         phpmyadmin   tpm
PackageKit         fail2ban         mecab          plymouth     ubuntu-advantage
apache2            fwupd            misc           polkit-1     ubuntu-release-upgrader
apt                ghostscript      mysql          private      ucf
boltd              git              mysql-files    python       unattended-upgrades
clamav             grub             mysql-keyring  shim-signed  update-manager
cloud              initramfs-tools  mysql-upgrade  snapd        update-notifier
command-not-found  landscape        os-prober      snmp         usbutils
dbus               letsencrypt      pam            sudo         vim
dhcp               logrotate        php            systemd
aaron@eastonparkwiki:/var/lib$ dirsize
22G     .
aaron@website:/var/lib$ dirdu
du: cannot read directory './apt/lists/partial': Permission denied
du: cannot read directory './mysql-keyring': Permission denied
du: cannot read directory './snapd/cookie': Permission denied
du: cannot read directory './snapd/cache': Permission denied
du: cannot read directory './snapd/void': Permission denied
du: cannot read directory './mysql': Permission denied
du: cannot read directory './mysql-files': Permission denied
du: cannot read directory './update-notifier/package-data-downloads/partial': Permission denied
du: cannot read directory './polkit-1': Permission denied
du: cannot read directory './AccountsService/users': Permission denied
du: cannot read directory './php/sessions': Permission denied
du: cannot read directory './private': Permission denied
du: cannot read directory './fwupd/gnupg': Permission denied
598M    ./snapd/snaps
334M    ./clamav
197M    ./apt/lists
156M    ./snapd/seed/snaps
51M     ./mecab/dic/ipadic-utf8
40M     ./mecab/dic/ipadic
32M     ./dpkg/info
3.2M    ./command-not-found
1.8M    ./dpkg
636K    ./fwupd/remotes.d/lvfs
608K    ./usbutils
484K    ./snapd/apparmor/profiles
324K    ./ucf/cache
292K    ./systemd/deb-systemd-helper-enabled
292K    ./snapd/seccomp/bpf
200K    ./dpkg/alternatives
164K    ./cloud/instances/252343267/sem
144K    ./systemd/catalog
112K    ./ucf
108K    ./cloud/instances/252343267
aaron@website:/var/lib$ ls -lha
total 212K
drwxr-xr-x 51 root      root      4.0K Jun 28 12:12 .
drwxr-xr-x 14 root      root      4.0K Jun 27 09:13 ..
drwxr-xr-x  4 root      root      4.0K May 18 16:41 AccountsService
drwxr-xr-x  2 root      root      4.0K Jun 27 09:11 PackageKit
drwxr-xr-x  5 root      root      4.0K Jun 27 09:14 apache2
drwxr-xr-x  5 root      root      4.0K Jul 23 15:52 apt
drwxr-xr-x  2 root      root      4.0K Sep 10  2020 boltd
drwxr-xr-x  2 clamav    clamav    4.0K Jul 23 16:00 clamav
drwxr-xr-x  8 root      root      4.0K Jul 23 03:00 cloud
drwxr-xr-x  2 root      root      4.0K Jul 23 11:58 command-not-found
drwxr-xr-x  2 root      root      4.0K Jun 26 22:41 dbus
drwxr-xr-x  2 root      root      4.0K Apr 10  2020 dhcp
drwxr-xr-x  7 root      root      4.0K Jul 23 15:53 dpkg
drwxr-xr-x  2 root      root      4.0K Jun 27 12:08 fail2ban
drwxr-xr-x  6 root      root      4.0K Jun 27 09:14 fwupd
drwxr-xr-x  4 root      root      4.0K Jun 27 09:15 ghostscript
drwxr-xr-x  2 root      root      4.0K Mar  4 07:01 git
drwxr-xr-x  4 root      root      4.0K May 18 16:41 grub
drwxr-xr-x  2 root      root      4.0K Jul 23 06:20 initramfs-tools
drwxr-xr-x  2 landscape landscape 4.0K May 18 16:43 landscape
drwxr-xr-x  4 root      root      4.0K Jul 23 06:09 letsencrypt
drwxr-xr-x  2 root      root      4.0K Jul 23 00:00 logrotate
drwxr-xr-x  2 root      root      4.0K May 18 16:43 man-db
drwxr-xr-x  3 root      root      4.0K Jun 27 09:13 mecab
drwxr-xr-x  2 root      root      4.0K Apr 15  2020 misc
drwx------  9 mysql     mysql      12K Jul 23 03:00 mysql
drwx------  2 mysql     mysql     4.0K Jun 27 09:14 mysql-files
drwx------  2 mysql     mysql     4.0K Jun 27 09:13 mysql-keyring
drwxr-xr-x  2 root      root      4.0K May 11 07:49 mysql-upgrade
drwxr-xr-x  2 root      root      4.0K Jun  4  2019 os-prober
drwxr-xr-x  2 root      root      4.0K Jul 23 06:21 pam
drwxr-xr-x  4 root      root      4.0K Jun 27 09:13 php
drwxr-xr-x  3 root      root      4.0K Jun 27 09:16 phpmyadmin
drwxr-xr-x  2 root      root      4.0K Nov  2  2020 plymouth
drwx------  3 root      root      4.0K May 18 16:39 polkit-1
drwx------  2 root      root      4.0K May 18 16:39 private
drwxr-xr-x  2 root      root      4.0K May 18 16:39 python
drwxr-xr-x  3 root      root      4.0K May 18 16:48 shim-signed
drwxr-xr-x 23 root      root      4.0K Jul 23 14:50 snapd
drwxr-xr-x  2 root      root      4.0K Aug 17  2020 snmp
drwxr-xr-x  3 root      root      4.0K May 18 16:39 sudo
drwxr-xr-x 10 root      root      4.0K Jun 28 11:55 systemd
drwxr-xr-x  2 tss       tss       4.0K Dec  3  2019 tpm
drwxr-xr-x  3 root      root      4.0K Jun 26 22:44 ubuntu-advantage
drwxr-xr-x  2 root      root      4.0K Jul 17 18:49 ubuntu-release-upgrader
drwxr-xr-x  3 root      root      4.0K Jun 28 12:12 ucf
drwxr-xr-x  2 root      root      4.0K Jul 21  2020 unattended-upgrades
drwxr-xr-x  2 root      root      4.0K Jun 26 22:42 update-manager
drwxr-xr-x  4 root      root      4.0K Jul 23 15:53 update-notifier
drwxr-xr-x  2 root      root      4.0K May 18 16:41 usbutils
drwxr-xr-x  3 root      root      4.0K May 18 16:39 vim

Any thoughts on why this is occurring and how to remediate?

Artur Meinild avatar
vn flag
You need sudo to access all directories - try `sudo dirdu` again and list the output.
cinemafunk avatar
jp flag
I forgot that my dirdu alias didn't have sudo. I found it was a bunch of mysql binlogs. I've purged outdated binlogs and set a global expire setting.
Score:0
jp flag

I forgot that my dirdu alias didn't have sudo. I found it was a bunch of mysql binlogs. I've purged outdated binlogs and set a global expire setting

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.