Move Zimbra Storage to Different Drive/File-System
If your Zimbra server’s storage is running out or you try to keep your virtual machines lean and easily transferrable it might be necessary to put Zimbra’s mail storage on a different file system or storage medium.
The process is straightforward; they key is knowing that Zimbra stores mail in /opt/zimbra/store.
In my case, I’m creating and attaching a 20 GB sparse file to a virtual machine:
# dd if=/dev/zero of=storage.img seek=20000 bs=1M count=0 # mke2fs -j storage.img
After attaching your storage and creating the file system boot your Zimbra server (if necessary) and mount the file system to /mnt/tmp
# mkdir /mnt/tmp # mount /dev/sda2 /mnt/tmp
Shut down Zimbra if it is running.
# /etc/inid.d/zimbra stop
Change the ownership of the new file system’s root directory to your zimbra user:
# chown zimbra: /mnt/tmp
Move the contents of /opt/zimbra/store (or wherever your store directory is located) to /mnt/tmp:
# mv /opt/zimbra/store/* /mnt/tmp/
# umount /mnt/tmp
Now create an appropriate fstab entry for /opt/zimbra/store using the new file system’s device node/label/etc.:
/dev/sdb1 /opt/zimbra/store ext3 defaults,noatime 0 0
Mount /opt/zimbra/store and start Zimbra:
# mount /opt/zimbra/store # /etc/init.d/zimbra start