Moving GreenArrow to a New Partition
- Table of Contents
- Overview
- The Procedure
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:
- Fixing an error where GreenArrow was installed on the wrong partition.
- 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:
-
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. -
If parts of GreenArrow that are normally in
/var/hvmailwere 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:
-
We strongly recommend taking a backup of GreenArrow before getting started, in case something goes wrong.
-
We strongly recommend starting up a screen or tmux session and using it throughout this process, in case you get disconnected partway through.
-
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 -
Check how much free disk space and inodes are available in the destination partition:
df --human df --inodes -
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. -
Stop GreenArrow:
systemctl stop greenarrow.service -
Verify that nothing is accessing files within
/var/hvmail:lsof | grep /var/hvmailIf 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 wherelsofshows no users of/var/hvmailor cancel the move by runningsystemctl start greenarrow.servicethen contacting GreenArrow’s technical support for assistance on the move. -
Move
/var/hvmailto the new partition. For example, if you want it to reside at/media/disk1/hvmail, run:mv /var/hvmail /media/disk1/hvmail -
Create a symbolic link pointing
/var/hvmailto the location that you just moved its files to. For example:ln -s /media/disk1/hvmail /var/hvmail -
Verify that the symbolic link is valid:
ls -l /var/hvmail ls -l /var/hvmail/ -
Verify that the disk usage situation is as you expect:
df --human df --inodes -
Start GreenArrow back up:
systemctl start greenarrow.service -
Verify that some common misconfigurations are not present. Each test gets a simple pass/fail result:
hvmail_check_config -
Verify that all services are running normally. Any services with an abnormal state will be shown in red:
hvmail_init statusThe 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.
