Storage page disk metrics to recover disk space

HA running out of disk space is not handled in a user-friendly way, and there seems no easy way to determine what is using disk space. A user-friendly front-end to display and tidy up the main disk hogs would be appreciated.

Two weeks ago I noticed that Wyoming was not starting up, there was nothing in any log to indicate why, and I could find nothing which would indicate a problem. Finally I decided to re-build HAOS from scratch, and in doing a full backup I got 5 cryptic error messages in the log plus one which suggested I ran out of disk space. System became ever more unstable while trying to identify what is taking the 32GB space.
After deleting old backup files (a full backup is 1.2GB) and a couple of reboots magically my Piper and Whisper integrations added, and Wyoming (and everything else) is now working - but still missing a large chunk of disk space.

  1. I appreciate that HA consists of so many modules plus add-ons and HACS modules that it would be impossible to enforce a consistent handling of no disk space condition … but an official recommended function / procedure would be helpful. Preferably something that doesn’t frighten non-database administrators by stating that an unknown transaction needs to be rolled back before …

  2. In investigating this issue it seems there are several common disk hogs, of which only one is within easy user control:

  • Backups are automatically created by default at every update, but it is left to the user to delete them manually.
  • Sometimes the backup fails and the created file will not be added to the HA list of backups, but it will not be removed either.
  • home-assistant_v2.db can grow quite large (but in my case only 460MB) - but this seems to default to trimming automagically.
  • apparently docker saves old images, with suggestion to do a ‘docker image prune’
  • there are system log files and other files which grow over time
  • excessive numbers of error messages (eg Wyoming generating an error every 10 seconds (approx 11,000 per day)
  1. In the System > Storage page it shows percentage storage space used.
  • could we add the size that it is a percentage of (ie size of the disk/partition) ?
  • could we display space taken by HA core and each add-on (ideally code and data sizes) ?
  • could we lookup and display the size of the most common disk hogs (ie. backups, Docker images, media) ?
  • could we compare the list of backups in the Backups page and compare with the files in backups folder, to delete failed backups ?
  • could this screen launch a couple of commands to trim old files, and link to instructions for Recorder ?

I’m envisaging the Storage page looking like
image

This should be already exposed, but it’s not shown in the front end for some reason.

I found this out last week - if you click inspect element on the storage percentage bar, you’ll find the actual values in the console