How to use the same Dropbox folder with a dual-boot

I have been using Ubuntu and Windows in dual boot for some time now and I found that using Dropbox on both OSs could get a bit tricky as by default it will duplicate your files.

An easy walk around is to use the default location under windows, and then to create in linux a symbolic link that will point to it.

I will assume that you have a Documents folder on a disk/partition with letter D: under windows and mounted at /media/data. The path to your documents will then be “D:\Documents” in windows and “/media/data/Documents” in linux.

The installation has to be done in three steps

  1. Install Dropbox on windows, at the end of the installation the program will give you the option to change the Dropbox folder location, select your “D:\Documents” folder. The program will automatically create a “My Dropbox” subfolder where you files will be synchronised.
  2. Under linux create a symbolic link named “Dropbox” in the place of your choice, for instance in your home directory:
    ln -s /media/data/Documents/My\ Dropbox ~/Dropbox
  3. Install Dropbox in your linux distribution, at the end of the installation will again give you the option to change the Dropbox folder location, this time select your the folder where you created the Dropbox link, in our example your home directory. Dropbox will then see the folder “~/Dropbox” as it were “/media/data/Documents/My Dropbox”.

With this methods your files are always synchronised, should you be working under linux or windows, without being duplicated. Beware though that conflicted copies might appear if Dropbox does not finish the synchronization when exiting the operating system.