GreenArrow Email Software Documentation

Moving GreenArrow to a New Partition

Overview

This document describes how to move GreenArrow’s /var/hvmail directory, which contains most of GreenArrow’s data, to a new partition. It’s written for experienced Linux systems administrators. Please read through it from end-to-end before deciding to use it, and contact GreenArrow technical support if you encounter any issues with these instructions or if you would like assistance.

The procedure involves shutting down GreenArrow while files are moved and converted, so only perform it when downtime is acceptable.

Examples of why you would want to move /var/hvmail include:

  1. Fixing an error where GreenArrow was installed on the wrong partition.
  2. Moving GreenArrow to a faster or larger partition.

This procedure does not move any data that exists outside of the /var/hvmail directory. That caveat has the following implications:

  1. Some critical GreenArrow files, like those required for systemd service management, are not in /var/hvmail, so if you’re responding to a failing disk, we recommend using our Server Migration or Backup Restoration procedures instead.

  2. If parts of GreenArrow that are normally in /var/hvmail were already moved to another partition, this procedure wouldn’t move them.

If you prefer to troubleshoot a disk space usage issue or move just a part of GreenArrow’s data to a new partition, see the Troubleshooting Disk Space Issues document.

The Procedure

Here’s how to move GreenArrow’s /var/hvmail directory to a new partition:

  1. We strongly recommend taking a backup of GreenArrow before getting started, in case something goes wrong.

  2. We strongly recommend starting up a screen or tmux session and using it throughout this process, in case you get disconnected partway through.

  3. Check how much GreenArrow data there is to move, in terms of both bytes and inodes:

    du --human --summarize /var/hvmail
    du --inodes --summarize /var/hvmail
    

  4. Check how much free disk space and inodes are available in the destination partition:

    df --human
    df --inodes
    

  5. Verify that the previous two steps show that the destination partition has enough disk space and inodes to hold all of the data in /var/hvmail.

  6. Stop GreenArrow:

    systemctl stop greenarrow.service
    

  7. Verify that nothing is accessing files within /var/hvmail:

    lsof | grep /var/hvmail
    

    If something is accessing files within /var/hvmail, then GreenArrow might not have shut all the way down yet, or there may be some non-GreenArrow process (like your current shell) using them. Either get the system into a state where lsof shows no users of /var/hvmail or cancel the move by running systemctl start greenarrow.service then contacting GreenArrow’s technical support for assistance on the move.

  8. Move /var/hvmail to the new partition. For example, if you want it to reside at /media/disk1/hvmail, run:

    mv /var/hvmail /media/disk1/hvmail
    

  9. Create a symbolic link pointing /var/hvmail to the location that you just moved its files to. For example:

    ln -s /media/disk1/hvmail /var/hvmail
    

  10. Verify that the symbolic link is valid:

    ls -l /var/hvmail
    ls -l /var/hvmail/
    

  11. Verify that the disk usage situation is as you expect:

    df --human
    df --inodes
    

  12. Start GreenArrow back up:

    systemctl start greenarrow.service
    

  13. Verify that some common misconfigurations are not present. Each test gets a simple pass/fail result:

    hvmail_check_config
    

  14. Verify that all services are running normally. Any services with an abnormal state will be shown in red:

    hvmail_init status
    

    The hvmail-qmail-smtpd3 and hvmail-dnscache services are down by default. All other services should be reported as up unless you shut them down intentionally.

    If there were a large number of files in the disk-queue, then it may take GreenArrow a few minutes to fully start.


Copyright © 2012–2024 GreenArrow Email