0

I have a homely postfix+dovecot server running in ubuntu.

I need to move the email storage to a different disk. There is not much information available on how to proceed, most of the use cases refer to migrating between different servers, which is not my case. Some other references say it would be fine if I just change mail_location variable in 10-mail.conf. I'm using mbox storage format.

What I want to do is to move all the files and folders to a different disk and mount that directory in the exact same location.

This is my plan:

  1. Stop dovecot and postfix services
  2. Move all the files in the current mailbox location to the new disk
  3. Create a symbollyc link so that the mail location points to the new disk
  4. Restart services

Can someone advise if my plan makes sense and if I am doing all what is needed?

1
  • 2
    Make sure to copy all the attributes, such as ownership (cp -a). Other than that, I'd say your plan is sound - just make sure to backup first ;) Commented Aug 7, 2023 at 12:38

1 Answer 1

1

In general the approach is sound.

The following options may be of interest:

  1. Mount Location

If the new drive is exclusively for mail only, you may directly set the future mount to (e.g.) /var/mail and skip the symbolic link.

  1. Systemd-dependency of mail services to mount.

You may link the mail service to depend on the mount - so mail doesn't end in the limbo.

E.g. RequiresMountsFor=/path/to/mail/dir or a combination of After=path-to-mail-dir.mount and BindsTo=path-to-mail-dir.mount. Note that with binding the services, mail services will stop if the drive is not mounted.

See service dependency options at freedesktop.org.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.