Centos – How to put gitlab data directory on another drive

centosgitlab

My gitlab installation is running out of space. I want to move the user's repositories to another drive. I can not find any walkthroughs or good forum posts about doing this.

I have tries moving /opt/gitlab/apps/gitlab/repositories to another drive, and then creating a symlink from the original folder name to the new one. This worked as far as it allowed me to read the data in the repositories, but it failed at the point of trying to create a new repo, when trying to push to the master branch (git push -u origin master), stating that I had no permission to commit to master. When I put the folder back in place instead of the symlink, all went back to working as expected.

Is there a better/correct way to move the repositories into a different location, and different drive on the system?

Best Answer

It seems that the new parent directory on the new device has wrong permissions. Check owner, group, and permissions of the parent directory of all repositories on the old and the new location.

Also, in case it really is caused by the symlink (which I doubt), you could use mount --bind instead of a symlink to rebind the directory to the new disk.