0

My /var is taking up the whole disk

sudo du -hx --max-depth=1 /
2.0G    /opt
46G /var
12K /media
4.0K    /srv
196K    /tmp
4.0K    /mnt
36M /root
8.3G    /usr
4.0K    /cdrom
200K    /snap
32K /timeshift
16M /etc
16K /lost+found
57G /

I stared nautilus in admin mode (sudo nautilus), moved old /var/log old version to trash. Then it wouldn't let me open Trash folder

  1. Where did they go?
  2. How do I decrease the size of /var?
muru
  • 197,895
  • 55
  • 485
  • 740
  • It will be very difficult to answer this question without knowing what's installed on your computer, what software you need, and what software you don't need. As @Markus mentioned in his answer, check your /var/log directory for large logs. You can safely remove the archived files in there, though you will want to check any large logs to see why they are large. If the system is trying to tell you something's wrong, then deleting the logs will only be a temporary measure. – matigo Oct 29 '21 at 03:31

1 Answers1

0

I have also encountered an issue of /var taking up huge amounts of space. For me it seems to be cause by a misbehaving application (gvfsd-trash) which takes up an entire CPU core and uses said core to flood the system log with error messages. This can get big very fast. Try restarting your system and removing /var/log/syslog* with sudo! (could have unkown impact on system!, I didnt have any trouble)

Edit: just looked: Trash folder for root is in /root/.local/share/Trash! you should be able to delete it and remove everything from root's recycle bin!

  • also there are many tools that can show you, where your disk space is going! I prefer "gnome disk usage analyzer" or "graphical disk map"! – Chaos_02 Oct 29 '21 at 03:17
  • I like ncdu, which is like du but allows you to drill down without typing a new du command. You do have to install it & it is a terminal command. sudo apt-install ncdu Some tools may remove things you want, so be sure to have good backups. https://askubuntu.com/questions/657091/whats-the-good-way-to-clean-up-the-system-and-is-bleachbit-safe-on-ubuntu-14 * https://askubuntu.com/questions/1263276/list-files-and-folders-of-the-root-partion/1263327#1263327 – oldfred Oct 29 '21 at 03:35
  • trash for root user is in /root/.local/share/Trash. just delete it :P – Chaos_02 Oct 29 '21 at 03:52