Easier solution for dual boot, syncing shared folder from Linux/Windows

My search for “dual boot” showed 44 topics. I checked them all and didn’t find a satisfactory solution, so I wanted to post how I solved it.

The situation is that a partition is shared between Linux and Windows on the same computer (dual boot), and that a folder on this partition should be synced with other computers. The problem is that there are syncing conflicts if more than one Syncthing database is used for the same folder. The common solution is to share the database. Also both Syncthing binaries should be the same version.

Many posts discuss to share the config files as well, but that causes a problem because the directory path differs between Linux and Windows. There are proposals to use paths relative to the working directory, or hacks to change the home directory variables. These proposals wouldn’t work with multiple shared disks, and might cause other issues.

My solution is to share the whole config directory as well and use directory links in the user home directory.

In this example the shared partition is D: / /data. Syncthing starts as usual via systemd / Task Scheduler:

  • Linux: syncthing --home="/data/SyncthingConfig" --no-browser --no-upgrade -no-restart
  • Windows: syncthing.exe --home="D:\SyncthingConfig" --no-browser --no-upgrade --no-console

Create directory links:

  • Linux: ln -s "/data/Shared" "\~/Shared"
  • Windows: mklink /J "%USERPROFILE%\Shared" "D:\Shared"

Then add the folder in Syncthing in any OS with the folder path ~/Shared. Forward slashes have to be used!

This solution works well for me so far. No sync conflicts, no need to maintain two configs, works with multiple shared partitions, etc.

I appreciate any comment, especially if someone sees potential issues with this solution.

2 Likes

I suspect this is approximately as good as it gets.