Success: Moved Zimbra 8.8.15 to new disk on Ubuntu 20.04

Discuss your pilot or production implementation with other Zimbra admins or our engineers.
Post Reply
sigtrap
Posts: 22
Joined: Sat Sep 13, 2014 1:35 am

Success: Moved Zimbra 8.8.15 to new disk on Ubuntu 20.04

Post by sigtrap »

This is just documentation of the success story of moving /opt/zimbra to new disk and then mount it as /opt
The back story is that I installed Zimbra on my new small home server on the M.2 disk. M2 disk are fast but I want Zimbra to be on a mechanical disk (that I know how to repair if it gets broken) and M2 disk has something called "terabytes written" (TBW).

Command run as root (with default umask) if not specified otherwise.
1: Backup Zimbra and create new disk and an ext4 partition. For me it became /dev/hda1
2: Mount the new disk at a temporary mount point. I had nothing mounted on /mnt and my temporary mount point was created as /mnt/temp

Code: Select all

cd /
mount /dev/hda1 /mnt/temp
3: Stop Zimbra as the zimbra user.

Code: Select all

zmcontrol stop
4: Log out from the zimbra user and verify that all processes of zimbra was stopped. On my firewall I blocked all traffic to the server so users and mail servers can't reach it if something went half wrong.

Code: Select all

ps aux | grep -i zimbra
5: I only have Zimbra in /opt/ so I copied everything, including the sparse files, in /opt to /mnt/temp

Code: Select all

rsync -aHAWXS /opt/ /mnt/temp/
6: Moved my original /opt to /opt.org

Code: Select all

cd /
mv opt opt.org
7: Created a new mount point as /opt

Code: Select all

mkdir opt
8: Verify the copy by umounting the temporary mount point, mounting the new disk with the Zimbra copy on /opt

Code: Select all

umount /mnt/temp
mount -o noatime,dirsync /dev/sda1 /opt
9: Starting Zimbra as the zimbra user

Code: Select all

zmcontrol start
Here I had success so I added the new mount point in /etc/fstab
My UUID of /dev/hda1 is a5e05262-6d45-4a95-9dfd-0bc623e26947. You have to find your unique UUID with the command blkid. My new row in /etc/fstab

Code: Select all

UUID=a5e05262-6d45-4a95-9dfd-0bc623e26947 /opt ext4 rw,noatime,dirsync 0 0
You can now stop zimbra and umount /opt to verify the mount point in fstab with mount -a
10: As the zimbra user stop Zimbra

Code: Select all

zmcontrol stop
11: umount /opt and mount everything with mount -a

Code: Select all

umount /opt
mount -a
/dev/hda1 got automatically mounted on /opt so I rebooted, made a new fresh backup and opened up the network traffic to the server.

To my help was the post by milauria viewtopic.php?t=62472#p286278 and the guide https://techguides.yt/guides/how-to-par ... ntu-20-04/ (step 4. "Mount disks on Ubuntu").

//Sigtrap
Post Reply