Storage space decreasing

Hi there,

I am using MiaB for a year or so now and I am extremely satisfied with the project.
I am hosting it on a minimal DO droplet (512MB / 20 GB / 1 core) and it runs smoothly enough for <10 users.

Recently, I started to notice that my storage space is declining.
Even status page shows a warning.
Since I do not use NextCloud (or whatever cloud it is), I assume all space is occupied by mail (in particular, attachments).
OS installation should not (significantly) grow with time, only mail should.

I have looked through the users’ mailboxes’ sizes (on an admin page) and realized that they barely occupy 1 GB all together.

The question is, how it may have happened that I have 4/20 GB left (and this number is decreasing) given that all mailboxes take up 1 GB? And how do I fix it?

Check how you have config. your backups:
a) sent to external S3
b) keep locally in your server

How do I do that?

Actually, I have accidentially figured out the problem.
I am sure, other users will appreciate the fix (and MiaB maintainers may find it reasonable to implement it).

With time, server has accumulated linux images

The following packages were automatically installed and are no longer required:
  libvpx1 linux-headers-4.4.0-38 linux-headers-4.4.0-38-generic
  linux-headers-4.4.0-45 linux-headers-4.4.0-45-generic linux-headers-4.4.0-47
  linux-headers-4.4.0-47-generic linux-headers-4.4.0-51
  linux-headers-4.4.0-51-generic linux-headers-4.4.0-53
  linux-headers-4.4.0-53-generic linux-headers-4.4.0-57
  linux-headers-4.4.0-57-generic linux-headers-4.4.0-59
  linux-headers-4.4.0-59-generic linux-headers-4.4.0-62
  linux-headers-4.4.0-62-generic linux-headers-4.4.0-63
  linux-headers-4.4.0-63-generic linux-headers-4.4.0-64
  linux-headers-4.4.0-64-generic linux-headers-4.4.0-66
  linux-headers-4.4.0-66-generic linux-headers-4.4.0-67
  linux-headers-4.4.0-67-generic linux-headers-4.4.0-70
  linux-headers-4.4.0-70-generic linux-headers-4.4.0-71
  linux-headers-4.4.0-71-generic linux-headers-4.4.0-72
  linux-headers-4.4.0-72-generic linux-headers-4.4.0-75
  linux-headers-4.4.0-75-generic linux-headers-4.4.0-78
  linux-headers-4.4.0-78-generic linux-headers-4.4.0-79
  linux-headers-4.4.0-79-generic linux-headers-4.4.0-81
  linux-headers-4.4.0-81-generic linux-headers-4.4.0-83
  linux-headers-4.4.0-83-generic linux-headers-4.4.0-87
  linux-headers-4.4.0-87-generic linux-headers-4.4.0-89
  linux-headers-4.4.0-89-generic linux-headers-4.4.0-91
  linux-headers-4.4.0-91-generic linux-headers-4.4.0-92
  linux-headers-4.4.0-92-generic linux-image-4.4.0-38-generic
  linux-image-4.4.0-45-generic linux-image-4.4.0-47-generic
  linux-image-4.4.0-51-generic linux-image-4.4.0-53-generic
  linux-image-4.4.0-57-generic linux-image-4.4.0-59-generic
  linux-image-4.4.0-62-generic linux-image-4.4.0-63-generic
  linux-image-4.4.0-64-generic linux-image-4.4.0-66-generic
  linux-image-4.4.0-67-generic linux-image-4.4.0-70-generic
  linux-image-4.4.0-71-generic linux-image-4.4.0-72-generic
  linux-image-4.4.0-75-generic linux-image-4.4.0-78-generic
  linux-image-4.4.0-79-generic linux-image-4.4.0-81-generic
  linux-image-4.4.0-83-generic linux-image-4.4.0-87-generic
  linux-image-4.4.0-89-generic linux-image-4.4.0-91-generic
  linux-image-4.4.0-92-generic linux-image-extra-4.4.0-38-generic
  linux-image-extra-4.4.0-45-generic linux-image-extra-4.4.0-47-generic
  linux-image-extra-4.4.0-51-generic linux-image-extra-4.4.0-53-generic
  linux-image-extra-4.4.0-57-generic linux-image-extra-4.4.0-59-generic
  linux-image-extra-4.4.0-62-generic linux-image-extra-4.4.0-63-generic
  linux-image-extra-4.4.0-64-generic linux-image-extra-4.4.0-66-generic
  linux-image-extra-4.4.0-67-generic linux-image-extra-4.4.0-70-generic
  linux-image-extra-4.4.0-71-generic linux-image-extra-4.4.0-72-generic
  linux-image-extra-4.4.0-75-generic linux-image-extra-4.4.0-78-generic
  linux-image-extra-4.4.0-79-generic linux-image-extra-4.4.0-81-generic
  linux-image-extra-4.4.0-83-generic linux-image-extra-4.4.0-87-generic
  linux-image-extra-4.4.0-89-generic linux-image-extra-4.4.0-91-generic
  linux-image-extra-4.4.0-92-generic
Use 'apt-get autoremove' to remove them.

The fix is ti use:

sudo apt-get autoremove

It has freed 7.5 GB or a third of all my disk space!

I strongly suggest that MiaB maintainers schedule this command as cron or something.

BTW, this command takes quite a lot of time when run with this number of images.

By default that’s your responsibility to run ‘apt-get autoremove’ right after every ‘apt-get update && apt-get upgrade’ and/or ‘apt-get dist-upgrade’ as linux updating / upgrading/ cleanup is not a decision directly related to MiaB itself.

1 Like

The box should fix any problems that it creates itself, but not fix problems created by manual changes made by the end user. Do kernels tend to build up normally / on a vanilla Mail-in-a-Box install? I haven’t noticed it on mine.

Probably depends on the hosting arrangement. For example, Linode uses its own kernel so linux-image… is not installed. But I imagine for other setups using kernels from the Ubuntu repo, they can start piling up.

Maybe, periodic apt-get autoremove is indeed good idea?

At the very least we could run autoremove during Mail-in-a-Box setups so that when upgrading versions we take care of it. I’ll push a fix for that soon. Presumably people upgrade a few times a year.

I’m not sure if running it in additionally periodically would be necessary, but I’m open to adding it.

@JoshData Surely you’re aware but I would recommend you to read this article before proceeding.

1 Like

Thanks! I didn’t know about that. So adding

Unattended-Upgrade::Remove-Unused-Dependencies "true";

is probably the best thing to do. If anyone would open up a pull request to add it (and preferably also include some comments in the script about why and add a CHANGELOG entry), I’d be glad to merge.

@JoshData I wouldn’t add it in, but instead maybe make a script / button for the web interface to run it if needed (As an example some times autoremove removes something a compiled application(not installed via apt) needs and will break things. Albeit not very frequently, but has happened to me before)

1 Like

As long as MiaB is the only entity responsible for packages, we can make sure that we don’t have such compiled binaries. I believe, it is strongly discouraged to do anything on the server except upgrading MiaB itself.

@dbogatov I mean… Yea that’s true. Nevermind then lol