git-annex/ tips/ Synology NAS and git annex

# How to use git-annex on a Synology NAS

This is known to work with DSM 4.3-3810 Update 1 and git-annex standalone version 5.20131224-g6ca5271.

## Installation Steps

(1) In the DSM Package Center, install Git, which is available from Synology (no third-party repository needed).

(2) Download the latest standalone git-annex build for Linux on armel.

(3) Extract it somewhere sensible (eg: a bin/ directory your users home directory)

(4) Go into the git-annex.linux directory and ./runshell. You can now run git-annex as you normally would.

## How to sync with the Synology NAS

### On the Synology

(1) Setup port forwarding and associated dynamic dns, if applicable. Many good guides online for this.

(2) Setup ssh key based authentication with the Synology for each computer you want to sync with it. You want a specific key that is used only by git-annex, for each computer. Again, many good guides online.

(3) In the Synology .ssh/authorized_keys file for your account, add (substituting your username) [[!format sh """ command="/home/$yourusername/.ssh/git-annex-shell" """]] to the beginning of the line. Eg, it would look like this: [[!format sh """ command="/home/greg/.ssh/git-annex-shell" ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDT1yE96E/JQNPt0ziiNYJRvndCvLK4uG5h/SNYoAIBF1uH6L7VYAt3HWVqSyi3BcV70WDZ/yWgtNzbrcir46JpvEHMcvYaXLbANwoDGNjG/gsz7kP/8VUxZ6hG3P3ICuwnqVum5+rYXm6oj3xzWPfTRhhRoDZLOQdevSNpdGNaa/lSg8Vuq2suHwjQlQb8AIUuCZmS5cm6XwoUq/jJtN4LTuTPqMjzA6NkdhWM2Kigi9jPQBFborkYBPMphmZwBZiVnhsH1XpaOff+mP03D2gF/huC+b1vbWQstjuehUbY59rvJ4ijb3810Uq2ep7dwLagmILtX5GbL+GS64pAn9sIP annex-othercomputer """]]

(4) the git-annex-shell script in your .ssh should be created for you aftering your initial ./runshell

(5) Double check that the script points to the correct directory of where your extracted git-annex.linux lives.

### On the other computers - the manual way

(1) See step 2 above about creating the specific git-annex ssh keys.

(2) In your .ssh/config, create an alias for your Synology that includes specifying the right sshkey. For example, mine looks like: [[!format sh """ Host synologyhost HostName mydynamicdomain.no-ip.org IdentityFile /home/greg/.ssh/annex_rsa """]]

(3) Now when you clone the git repo from the Synology, or add it as a remote, do the following: [[!format sh """ git clone greg@synologyhost:/absolute/path/to/annexname annexname """]] or

[[!format sh """ git remote add synology greg@synologyhost:/absolute/path/to/annexname """]]

(4) Run git-annex sync

### On the other computers - Using the assistant

(1) Use the webapp to add the remote. I'm not sure if there are any gotchas here as I have not done it this way yet.

comment 9
I doubt that the Debian package would be usable as-is on a Synology NAS? Perhaps it would require a standalone package, similar to armel but for PowerPC?
Comment by Jan — Tue Jul 22 18:11:47 2025
comment 8

@Jan, there is a powerpc build of git-annex in Debian. Not sure if it targets the e500 CPU.

Comment by joey — Tue Jul 22 18:11:47 2025
git-annex on a PowerPC based synology?
I use a DS210 which is based on the PowerPC e500 CPU. Has anyone successfully compiled git-annex for that architecture?
Comment by Jan — Tue Jul 22 18:11:47 2025
comment 6

There's a bug report for the memory use hang now: git-annex on NAS eats all memory

Comment by joey — Tue Jul 22 18:11:47 2025
comment 5

@Antoni git-annex-shell configlist does not do anything that would normally make it use much memory at all.

You might find strace or similar tools useful to figure out what's going on.

Comment by joey — Tue Jul 22 18:11:47 2025
Process seems to hang on Synology

I think I've completed the setup correctly, as I

- am able to execute git-annex-shell on the server
- locally running `git-annex sync` triggers the git-annex process on the server

However, once I provide the password to the key on my local machine, nothing seemingly happens - there is no output after the password prompt.

The repository I'm trying to sync with the remote on the server is ~200 mb and is in my lan.

When monitoring the remote server, I see the following in process being triggered:

    31433 31431 amk      D     656m270.7  7.1 /volume1/homes/amk/bin/git-annex.linux//lib/ld-linux.so.3 --library-path /volume1/homes/amk/bin/git-annex.linux//etc/ld.so.conf.d:/volume1/homes/amk/bin/git-annex.linux//usr/lib/arm-linux-gnueabi/audit:/volume1/homes/amk/bin/git-annex.linux//usr/lib/arm-linux-gnueabi/gconv:/volume1/homes/amk/bin/git-annex.linux//usr/lib:/volume1/homes/amk/bin/git-annex.linux//usr/lib/arm-linux-gnueabi:/volume1/homes/amk/bin/git-annex.linux//lib:/volume1/homes/amk/bin/git-annex.linux//lib/arm-linux-gnueabi: /volume1/homes/amk/bin/git-annex.linux/shimmed/git-annex-shell/git-annex-shell -c git-annex-shell 'configlist' '/volume1/homes/amk/archive/annex'

The memory usage goes up graudally, reaching well over 200mb, hogging the cpu significantly. I have never used git-annex before, so I'm not sure what else I should be looking for. This is what the server runs on: `armv7l GNU/Linux synology_armada370_214se`

Is this an issue caused by the host architecture mismatch?

Comment by https://www.google.com/accounts/o8/id?id=AItOawnjDzZkA6SzZHgT5_Jy3Rw3s7m_W3-oNLY — Tue Jul 22 18:11:47 2025
comment 3

Pieter, I suspect you didn't follow the part of the instructions where it says to run "./runshell" on the NAS. If you didn't do that, there will be no ~/.ssh/git-annex-shell script set up.

You have put git-annex-shell in your PATH somehow, but you probably did it by editing a bash dotfile. Those files are used for interactive login shells, but not when git-annex is sshing noninteractively into the NAS to run git-annex-shell.

Comment by http://joeyh.name/ — Tue Jul 22 18:11:47 2025
Syncing metadata only with Synology NAS and git annex

I am not able to get full syncing working. It says "syncing enabled (metadata only)". When I click on Actions -> Edit it says:

Just a git repository.

This repository is not currently set up as a git annex; only git metadata is synced with this repository.

If this repository's ssh server has git-annex installed, you can upgrade this repository to a full git annex, which will store the contents of your files, not only their metadata.

When I try to upgrade the repository it does not work. The log says:

sh: git-annex-shell: not found

rsync: connection unexpectedly closed (0 bytes received so far) [sender]

rsync error: remote command not found (code 127) at io.c(226) [sender=3.1.1]

I'm using Version: 5.20140717 on the Linux Ubuntu 14.10.

Ssh'ing from Ubuntu to gituser@synology works fine and shows the git-annex-shell options

Any ideas?

Comment by https://www.google.com/accounts/o8/id?id=AItOawllyDAwjTPuM6G2d3eKE481V0qGXRKtF8s — Tue Jul 22 18:11:47 2025
Exception thrown for runshell

Hi,

I followed these instructions but was unable to get git-annex to install on my Synology running `Linux Anvil 4.4.59+ #24922 SMP PREEMPT Fri May 10 02:49:58 CST 2019 x86_64 GNU/Linux synology_denverton_1618+`

Seems to be an issue regarding locale settings. The default locales are `LANG=/usr/lib/locale/en_US LC_CTYPE="en_US.utf8" LC_NUMERIC="en_US.utf8" LC_TIME="en_US.utf8" LC_COLLATE="en_US.utf8" LC_MONETARY="en_US.utf8" LC_MESSAGES="en_US.utf8" LC_PAPER="en_US.utf8" LC_NAME="en_US.utf8" LC_ADDRESS="en_US.utf8" LC_TELEPHONE="en_US.utf8" LC_MEASUREMENT="en_US.utf8" LC_IDENTIFICATION="en_US.utf8" LC_ALL=en_US.utf8`

The exception thats thrown is `rm: loadlocale.c:129: _nl_intern_locale_data: Assertion `cnt < (sizeof (_nl_value_type_LC_TIME) / sizeof (_nl_value_type_LC_TIME[0]))' failed. ./runshell: line 135: 27709 Aborted (core dumped) rm -rf "$localecache" 2>&1 rm: loadlocale.c:129: _nl_intern_locale_data: Assertion `cnt < (sizeof (_nl_value_type_LC_TIME) / sizeof (_nl_value_type_LC_TIME[0]))' failed. ./runshell: line 135: 27716 Aborted (core dumped) rm -rf "$localecache" 2>&1 ./runshell: line 181: 27719 Aborted (core dumped) cmp "$LOCPATH/buildid" "$base/buildid" > /dev/null 2>&1 rm: loadlocale.c:129: _nl_intern_locale_data: Assertion `cnt < (sizeof (_nl_value_type_LC_TIME) / sizeof (_nl_value_type_LC_TIME[0]))' failed. ./runshell: line 181: 27722 Aborted (core dumped) rm -rf "$LOCPATH"`

any ideas how to fix?

Comment by se394 — Tue Jul 22 18:11:47 2025
git-annex on Synology DS216+ (x86-64)

I used a similar approach, with a bit of refinement to not require a custom ssh key/user, to get `git-annex` running on a Synology DS216+ NAS, which is based around a Celeron chip (and thus needs the `x86-64` build). Once all the `PATH` related issues are taken care of (which some symlinks into `/usr/bin`) it appears to work like any other Linux/Unix-based `git-annex` install. (Definitely much more successful than trying to use `git-annex` via a SMB share at this point.)

Ewen

Comment by ewen — Tue Jul 22 18:11:47 2025
comment 10

Right, it would need a standalone package. It's quite easy to build such a package on any Debian system, just run "make linuxstandalone" in git-annex's source tree. I don't have a PowerPC system handy to do such builds on myself.

Comment by joey — Tue Jul 22 18:11:47 2025
new dev site for syno dsm 5.0

There is a new website with documentation to create App for new synology dsm 5.0 here : http://www.synology.com/en-us/support/developer A good way to distribute git annex to lot of people ? :)

Comment by https://www.google.com/accounts/o8/id?id=AItOawnrP-0DGtHDJbWSXeiyk0swNkK1aejoN3c — Tue Jul 22 18:11:47 2025
Comments on this page are closed.