Gitlab Omnibus: How to store data dir on a different partition?

On my Linux Server, I usually seperate apllications and their data to allow for seamless exchjange of Linux distro

  • /dev/sda2 (10GB) mounted on / containing OS and application files (will be whiped on every reinstall)
  • /dev/sda3 (70GB) mounted on /local containing user homes and application data (will NOT be whiped on reinstall)

Now with Gitlab Omnibus, I thought I’d just symlink the data dir /var/opt/ to /local/var/opt, but that caused major trouble due to

# (/var/opt/gitlab/gitlab-shell/config.yml)
# [...]
# Repositories path
# Give the canonicalized absolute pathname,
# REPOS_PATH MUST NOT CONTAIN ANY SYMLINK!!!
# Check twice that none of the components is a symlink, including "/home".
repos_path: "/var/opt/gitlab/git-data/repositories"

So how could I get GitLab to store the repositories in /local? Are hard-links okay?

I haven’t tested this, but you should be able to do a bind mount

mount --bind /local/var/opt /var/opt/