Fix disk space full issue on Ubuntu

I ran into a problem recently with my home PC which uses Ubuntu desktop as the operating system. For some bizarre reason, my 2 terabyte hard drive was almost full and my disk space usage was at 1.9 TB whereby Ubuntu kept giving me notifications on freeing up disk space as I was nearly full.

I freed up some disk space and realized that something other than the files on my PC was using up a lot of the disk space. I was at 1.5 TB usage after freeing space when I was originally at 1.9 TB usage and kept receiving warnings by Ubuntu to free up space.

current-usage-2.png

After looking through all the files on my system I was able to find the culprit, it was a log file named “syslog.1” with a file size of 1.4 terabytes.

syslog-file-3.png

So the fix to free up disk space was to simply delete the file named “syslog.1”.

sudo rm /var/log/syslog.1

After rechecking the disk usage this did indeed fix the problem and my disk space is back to normal.

after-fix-2.png

This could be a reoccurring issue whereby the log file fills up again and builds back up to use up a large portion of the disk space. If that happens I will investigate further and look for a more permanent solution and prevent this issue from happening further.

If you delete the file and the filesystem does not update and still shows your hard disk drive as full then it's best to try restarting your machine.