Why did mutt still finish successfully? And while processing were we at risk of damaging anything?

So we are running low on space 5GB available. Mutt for root is taking up 20GB on root partition, so we decide to purge/archive old mail messages. We take a copy and back it up.

Now we go into mutt: >mutt

We press: shift-D to delete messages

Enter the command: ~d>480d to remove the everything older than the last 480days

then: q to quit which saves the file.

This causes our available disk space to be completely full and the process fails, we struggle to exit mutt.

We realise that while doing this process the greater the quantity of mail messages we are keeping the easier it fails. Basically the mail we want to keep seems to blow out the available space before it saves/finishes.

So we purge more: ~d>90d leaving only the last 90 days (Smaller amount kept, and as expected it does finish, but I noticed something weird before it finished)

So I watched this processing as I watched the root drive start to fill up. as seen below.

The root folder eventually got to 0 available space but the mutt process kept going and going.

Why did mutt keep going and ultimately finish happily even though space was used up well before mutt was even close to finished saving?

Early in the process
[root@domain ~]# df
Filesystem          1K-blocks     Used Available Use% Mounted on
/dev/sda1            38314216 31093980   5250884  86% /
/dev/sda3           144053404 38173988  98538824  28% /opt

at about 90% before mutt finished all space used
[root@domain ~]# df
Filesystem          1K-blocks     Used Available Use% Mounted on
/dev/sda1            38314216 36779888         0 100% /
/dev/sda3           144053404 38173988  98538824  28% /opt

After mutt finished a lot of space was freed up which was expected
[root@domain ~]# df
Filesystem          1K-blocks     Used Available Use% Mounted on
/dev/sda1            38314216 16936356  19408508  47% /
/dev/sda3           144053404 38173988  98538824  28% /opt

Some things I may need to confirm: Swap size, RAM size(8GB?)

UPDATE: I have since done this process to remove data from mutt and it was easily successful due the having some disk space to do it and mutt saved ok. But when I left mutt this time My Disk space was not returned to available.

I have logged another question here: After reducing Mutt storage size, how do I get that storage reflected back into df

  • Surely I did not choose the exact amount of mail to leave behind that exactly filled the available space during processing? Sep 12, 2019 at 9:15
  • Are you using an mbox mailbox file to store the emails, or a maildir? If mbox, then mutt have to have enough space to create a copy of it. You may try setting the TMPDIR environment variable to a writable directory where you have more space available. mutt would then use this directory for any temporary files. I'm not turning this into an answer, because I don't know what type of mailbox you use, and I have some issues following the process that you describe.
    – Kusalananda
    Sep 12, 2019 at 9:23

1 Answer 1


df’s “Available” column takes into account the reserved blocks in the file system. When you ran df, you really had 38314216 – 36779888 blocks available, i.e. 1,534,328. These blocks were only usable by root, but you were running Mutt as root, so it could use them.

When you save an mbox-type mailbox in Mutt, it writes out the mailbox to a new file, and replaces the original only if it succeeds. In this instance, by deleting most emails you reduced the mailbox enough so that it fit in the space available to root; so Mutt was able to finish writing the new mailbox and replace the original, freeing up all the space occupied by the deleted emails.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.