Fresh install on debian 11 from package ... where are my repos being stored?

This is on a new install of gitlab 16.1 from debian package on debian 11 as per instructions .

Docs here: Repository storage types | GitLab all point to gitaly being used as storage, however in /etc/gitlab/gitlab.rb we have this:

# git_data_dirs({
#   "default" => {
#     "path" => "/mnt/nfs-01/git-data"
#    }
# })

there is no such path on this machine. Looks like gitaly service is running though.

This page of the docs: Configure Gitaly | GitLab
implies there are settings in gitlab.rb, ( via files/gitlab-config-template/gitlab.rb.template · 1dd07197c7e5ae23626aad5a4a070a800b670380 · / omnibus-gitlab · GitLab) but I see no gitaly['storage'] key in there on my install.

I would like to know where my repos are going to end up so I can keep an eye on disc usage etc… where are they and how can I change this?

many thanks,

The git_data_dirs is hashed out, which means it is not in use, it is just example configuration.

Anyway, NFS has been deprecated for quite a while now and isn’t possible to use anymore. All of the stuff is in Gitaly now. You can keep an eye on disk space by doing:

cd /var/opt/gitlab
du -sh *

and then see which directories have a large amount of disk space, go inside that directory and then repeat the du command.

You can see repository sizes within Gitlab anyway. From the command like and directory structures, there isn’t much else you can do anyway. The rest of the stuff you will have to check in Gitlab in relation to repositories and repository cleanup.

I assumed that the commented out configs represented the defaults, as many many other packages do, hence my confusion. So where are the actual defaults kept so I can learn more? The reference template at gitlab.rb.template still seems to have /mnt/nfs-01/git-data commented out as a storage location too.

My actual issue is that I set up the machine for gitlab hosting with a big partition for /home and not so much for /var … eventually I’ll need to add another directory on the bigger partition to gitaly storage and there seems to be little or no instruction on how this might be arranged in gitlab. The gitaly config instructions lead round in circles or talk about things like clustering etc which are interesting, but out of the league of this deployment for one small company IT dept.

How do I just add another folder as gitaly storage?

Many thanks,

By default, data is stored in /var/opt/gitlab/git-data.

I have no idea how you can configure gitaly.

Gitaly storage configuration is documented here: Configure Gitaly | GitLab

You are right that the commented-out values are the defaults.

The defaults you found are for the legacy, non-gitaly storage, and this is disabled by default in preference to using gitaly. See this line in the config template for v16.1.0-ee.

What you want is to configure Gitaly, starting with the gitaly[‘dir’]

# gitaly['dir'] = "/var/opt/gitlab/gitaly"

By default, repositories are in /var/opt/gitlab/git-data/repositories. You will see this when you use the df command that I posted about before on checking directory sizes.

The problem is you created /home - most likely using the default recommended partioning in the installer. Unless you need /home on this server, it didn’t need to be configured and you could have created a far larger partition for /var, or even /var/opt where Gitlab gets installed.

Since this is a new fresh installation, if you haven’t started using it yet, just make a new server and partition it properly. If it is being used, you can use the Gitlab backup and restore documentation to back it up, and then restore it to a new server that has plenty of disk space for /var or /var/opt.

Gitaly in a default configuration:

cat /var/opt/gitlab/gitaly/config.toml 
# Gitaly configuration file
# This file is managed by gitlab-ctl. Manual changes will be
# erased! To change the contents below, edit /etc/gitlab/gitlab.rb
# and run:
# sudo gitlab-ctl reconfigure

runtime_dir = "/var/opt/gitlab/gitaly/run"
socket_path = "/var/opt/gitlab/gitaly/gitaly.socket"
prometheus_listen_addr = "localhost:9236"
bin_dir = "/opt/gitlab/embedded/bin"

dir = "/var/log/gitlab/gitaly"
format = "json"

use_bundled_binaries = true
bin_path = "/opt/gitlab/embedded/bin/git"
ignore_gitconfig = true

name = "default"
path = "/var/opt/gitlab/git-data/repositories"

url = "http+unix://%2Fvar%2Fopt%2Fgitlab%2Fgitlab-workhorse%2Fsockets%2Fsocket"
relative_url_root = ""

dir = "/opt/gitlab/embedded/service/gitlab-shell"

you will see in the storage section, it shows exactly where Gitaly is going to store the data, eg: /var/opt/gitlab/git-data/repositories as mentioned unless a cluster has been configured which in your case it hasn’t yet.

Obviously you could remain with the existing server, and then just create new servers that would run just Gitaly, and have them store your data. But it would complicate things a little more.