I have a standard Ubuntu installation. With encrypted home. And Dropbox installed everywhere. Except fridge. macOS, CentOS, Windows, Android, iOS… But Dropbox has stopped loving Linux.
/dev/sdb2 on / type ext4 (rw,relatime,errors=remount-ro) /home/.ecryptfs/loop/.Private on /home/loop type ecryptfs
Requirements. Wait a minute:
A Dropbox folder on an ext4-formatted hard drive or partition
But ecryptfs is not supported.
So how we can manage with it? Make unencrypted file system on encrypted home and put Dropbox folder inside. How to do that?
- Unlink this host:
- Quit Dropbox
- Make storage file (count depend of your Dropbox size)
$ dd if=/dev/zero of=~/dropboxStorage bs=1024 count=3000000
- Make file system inside
$ mkfs.ext4 ~/dropboxStorage
- Localize Dropbox folder and rename it:
$ mv ~/Dropbox ~/Dropbox.mvd
- Edit fstab, change ownership of Dropbox mountpoint and mount it (now you don’t need sudo)
$ mkdir ~/Dropbox $ sudo vim /etc/fstab # at the end of fstab /home/loop/dropboxStorage /home/loop/Dropbox ext4 noauto,user 0 0 $ sudo chown loop ~/Dropbox $ mount ~/Dropbox $ mount | grep Dropbox /home/loop/dropboxStorage on /home/loop/Dropbox type ext4 (rw,nosuid,nodev,noexec,relatime,user=loop
- I think this should be something other than:
cp -abut beware. I have a lot of hosts linked and quicker and safer for me is download Dropbox again. But you cat try.
$ cd ~/Dropbox $ (cd ../Dropbox.mvd/ ; tar cf - *) | tar xf -
I connected the machine that had not been synchronized for several months and made problems for myself. All of my folder cleanings on my notebook (and others) was ruined. Fortunately Dropbox’s site has a trashcan where you can recover files.
So, If you have important thing synchronized on many hosts put this machine as a new one. For your safety.
$ rm -rf ~/Dropbox/*
- Start Dropbox and relink again — it works!
Mount after login
Now we have put
mount operation to the user’s start script, so:
$ echo -e "\n# Mount storage for Dropbox from fstab\nmount ~/Dropbox\n" >> ~/.bashrc
No, no, no… This will start with each terminal session with message Storage is already mounted. We don’t want that way. So run
and then edit Dropbox command and add
mount ~/Dropbox && before dropbox launcher. Here:
or from terminal here:
$ cat .config/autostart/dropbox.desktop [Desktop Entry] Name=Dropbox GenericName=File Synchronizer Comment=Sync your files across computers and to the web Exec=mount ~/Dropbox && dropbox start -i Terminal=false Type=Application Icon=dropbox Categories=Network;FileTransfer; StartupNotify=false X-GNOME-Autostart-enabled=true
What if something goes wrong?
Version of packages are changing from time to time. In case when something goes wrong and you will see the featured image from the top of this article just quit Dropbox app. Then open Dropbox drive in the gnome Files app. Then you can run Dropbox again and everything should be okay.
If I find a better way I’ll update this manual. I promise.