First of all, I'd advise everyone to take a look at syncthing, and see if it solves your needs, because it's a quite good alternative. I'm also a bit curious about the legal side of this, could existing paying users now cancel their annual payment, because Dropbox changed their agreement?
With that said, the workaround is to create an ext4 filesystem in a file, mount that as a loopback, move the dropbox folder there, and have systemd automount it on first access. This let's you basically run Dropbox irregardless of what your host filesystem is, and due to the systemd automount, it's absolutely automated and pain free.
- Close dropbox
- Determine the size of your Dropbox folder with
du -hs ~/Dropbox
- truncate --size 5G dropbox.img # put whatever the size is here
- If you are using a CoW filesystem, disable CoW for the image with
sudo chattr +C dropbox.img
- mkfs.ext4 -F dropbox.img
- mv Dropbox Dropbox.old
- sudo mount -o loop,rw dropbox.img ~/Dropbox
- sudo chown youruser:youruser ~/Dropbox
- cp -r Dropbox.old/* Dropbox/
- sudo umount ~/Dropbox
Create two files, and place them under /etc/systemd/system/
. The filenames have to reflect the mount path, this is in the systemd spec (pay attention to the capital Dropbox):
[Mount] What=/home/youruser/dropbox.img Where=/home/youruser/Dropbox Type=ext4 Options=loop,rw
[Install] WantedBy=multi-user.target [Unit] Description=Automount Dropbox [Automount] Where=/home/youruser/Dropbox [Install] WantedBy=multi-user.target
Reload systemd with systemctl daemon-reload
, then start the automount with sudo systemctl start home-youruser-Dropbox.automount
. Then if you do a ls ~/Dropbox
, you should see the contents of your Dropbox folder, because systemd automounts it. Do not continue until you get this working.
Enable the automount, so it gets started at system boot with sudo systemctl enable home-youruser-Dropbox.automount
, and start dropbox again. Everything should be working fine.
There is probably a way to do this with a systemd user file (instead of a system one), this is left as an exercise to the reader.
One thing to note with this, is that if your filesystem has snapshots, you lose the "incrementality" of snapshotting the Dropbox folder, since now it's a separate mount, it will not be included in the snapshot. Since Dropbox has its own backup mechanism anyway, and the image file itself will be present in your snapshots, it might not be a big problem.