Out of Disk Space
Analyzing Disk Space Usage
When running out of disk space, it is important to identify where the disk space is being consumed.
To see used/free space on the various partitions:
On Windows: press Windows key + E to open File Explorer and see the disk space used by each disk.
On a Linux terminal: use the "df -H" command to see the used and available space for each mount point configured in your system.
MailArchiva stores data in a variety of locations:
- Program files - /opt/mailarchiva (Linux) and C:\Program Files\MailArchiva (Windows)
- Temporary files - /var/opt/mailarchiva/ROOT/temp (Linux) and C:\ProgramData\MailArchiva\ROOT\temp (Windows)
- Configuration files - /etc/opt/mailarchiva/ROOT (Linux) and C:\ProgramData\MailArchiva\ROOT\conf (Windows)
- Internal graph database - /var/opt/mailarchiva/ROOT/database (Linux) and C:\ProgramData\MailArchiva\ROOT\database (Windows)
- Queues - /var/opt/mailarchiva/ROOT/queue (Linux) and C:\ProgramData\MailArchiva\ROOT\queue (Windows)
- Debug Logs - /var/log/mailarchiva/ROOT/debug (Linux) and C:\ProgramData\MailArchiva\ROOT\logs\debug (Windows)
- Audit Logs - /var/log/mailarchiva/ROOT/audit (Linux) and C:\ProgramData\MailArchiva\ROOT\logs\audit (Windows)
- Volume indexes - On the MailArchiva console, go to Configuration->Volumes and take note of the index paths referenced by each volume.
- Volume Stores - On the MailArchiva console, go to Configuration->Volumes and take note of the store paths referenced by each volume.
Depending on the specific version of MailArchiva you are using and the OS environment, the exact paths on your system may be different from those listed above. Refer to http://help.mailarchiva.com/enterprise-file-system-layout for detailed information on where the paths may be located.
Examine the free space in each of the above locations.
On Linux, type "du -sh /var/opt/mailarchiva/ROOT/database" to see the total amount of disk space used internally by the graph database.
On Windows, using File Explorer go to the directory in question, right click to see Properties. The size should be outputted.
Opportunities for Freeing Up Disk Space
Tomcat Logs
It is necessary (and safe!) to occasionally delete the Tomcat app server logs residing at /var/opt/mailarchiva/tomcat/logs/* (Linux) or C:\ProgramData\MailArchiva\Tomcat\logs\* (Windows)
Orphaned Queue Items
If there is a large amount of disk space being consumed in the Queues location (see above), the server may have at some stage experienced difficulties archiving. Consequently, the receive and index queues may have built up in size and may well be consuming a large amount of space. To resolve, ensure that there is an ACTIVE or UNUSED volume available in Configuration->Volumes from the MailArchiva web console and follow the Queues instruction force MailArchiva to process the remaining orphaned items in the index and receive queues.
Log Files
All files in the Debug Logs location (see above) may be safely deleted or nulled without impact to the system. However, when deleting these files, MailArchiva should be restarted to ensure that it continues to output to the log files. If debug.log files are large in size, visit Configuration->Logs in the MailArchiva web console and ensure that the logging level is set to Info.
Audit Log Files
It is not adviseable to delete audit log (CSV) files since they may be needed for forensic purposes. That being said, it is perfectly safe to delete the audit CSV and ZIP archive files and the system will not become unstable as a result.
Temporary Files
All files residing in MailArchiva's temp directory (i.e. /var/opt/mailarchiva/ROOT/temp/* (Linux) and C:\ProgramData\MailArchiva\ROOT\temp (Windows)) may be erased with minimal impact on the system.
Volume Stores
By default, volumes created using MailArchiva V7 default to the volume store V3 format. Files stored in this format cannot be compressed further. However, if you have older volumes stored in the V2 format (see .zz files in root of volume store path), it is possible to compact such volumes by going into Configuration->Volumes on the MailArchiva web console, and clicking on Compact.
Volume Indexes
The volume indexes are needed for search purposes only. They can be safely deleted (provided the volume is unmounted). However, if done so, the system will simply return zero results for the volume in question. At any stage, it is possible to rebuild the volume indexes by clicking on the Reindex button next to the associated volume in Configuration->Volumes on the MailArchvia web console.
It is important to leave some free space available on the partition where volume indexes are located. The reason being is that during the archiving process, MailArchiva periodically merges index data, resulting in a temporary doubling of used space.
Analyzing Disk Space Usage
When running out of disk space, the options are as follows:
- New disk - Buy a bigger hard drive, reinstall OS and MailArchiva on the new disk. When partitioning the new disk, be sure to refer to the hard disk partitioning recommendations. Follow steps at http://help.mailarchiva.com/move-server to copy the MailArchiva config, data and log paths to the new hard drive.
- Expand disk - If using VMWare, follow the VMWare instructions to increase the size of a disk partition.
- Relocate - Relocate graph database, queues, debug log, volume stores and indexes.
Relocate Directories
Symlinks (Linux Only)
One way to relocate referenced folders on Linux is to use symlinks. For example, let's say you've identified that moving the database path would free up sufficient disk space on the main partition. The steps to free up disk space would be as follows:
- systemctl stop mailarchiva
- cp /var/opt/mailarchiva/ROOT/database /mnt/newvol/database
- rm -rf /var/opt/mailarchiva/ROOT/database
- ln -s /mnt/newvol/database /var/opt/mailarchiva/ROOT/database (Creates a symlink referencing new location)
- systemctl sta rtmailarchiva
Bootstrap.conf (Linux & Windows)
Using the bootstrap.conf file, it is possible to redirect MailArchiva to reference alternate locations on startup.
To illustrate relocating all application data using bootstrap.conf on Windows:
- Stop the MailArchiva service from Windows Services
- Move C:\ProgramData\MailArchiva\ROOT\database to D:\appdata\database
- Move C:\ProgramData\MailArchiva\ROOT\queue to D:\appdata\queue
- Move C:\ProgramData\MailArchiva\ROOT\temp to D:\appdata\temp
- Edit the bootstrap.conf using a text editor
- Set appdata.path = D:\appdata
- Start MailArchiva service from Windows Services
Found this information useful? Visit mailarchiva.com to learn more about MailArchiva.