Reclaim disk space

If you’ve had your phone for a while now and haven’t done a clean install or re-flashed the OS recently, there’s a good chance you can reclaim a significant amount of disk space by hoovering up the journal logs.

From the terminal you can see how much disk space the journal logs are currently occupying with…

sudo journalctl --disk-usage

Having just checked with a friends phone who re-flashed Amber approx 5 months ago, they had around 4GB worth of journal log files.

Before you can hoover them, you need to rotate the logs to archive them…

sudo journalctl --flush --rotate

If you need/want to have a clear out, you can clear them by time, file count or size.

To clear out by time, for example to keep the last 3 days of logs and clear everything else…

 sudo journalctl --vacuum-time=3d

To clear out by files count, for example to keep the last 5 log files and clear everything else…

sudo journalctl --vacuum-files=5

To clear out by size, for example to keep the last 200 MB of logs and clear out everything else…

sudo journalctl --vacuum-size=200M

You should be able to combine the rotate with the vacuum, for example to flush and hoover everything except the logs of the last week…

sudo journalctl --flush --rotate --vacuum-time=1w

For me, I only check the logs for reproducible problems, so I have disabled journal logging for day to day and only enable it when I need/want to check for info/detail of a problem.

11 Likes

Before it came with all O/S, reminds me of the days of DOS and Windows 3.1. I think it was Norton that offered a disc data optimizer (to speed up loading your programs!). Depending on how messy it was, it could run for a long time.

The graphics were fun to watch, as they used whole colored characters to represent disc sectors. You could hypotize yourself watching the letters rearrange themselves on the screen.

Hahaha I used to be mildly mesmerized by that as a kid.

Thanks for the tip. I actually hadn’t done that in the 8+ years that I’ve owned my System76 Ubuntu laptop so I just reclaimed 2G and will be keeping that in my notes. Thanks!

1 Like

I suggest making that permanent and automatic. Or at least that’s what I have done. /etc/systemd/journald.conf

2 Likes