Use Btsync and Owncloud to create your own free personal storage cloud

High Scalability had an interesting link today about a project that combines Raspberry PI, btsync and owncloud to create essentially a personal Dropbox replacement with none of the costs or the storage limitation. Also very importantly, keeping up with the hot topic nowadays, the peace of mind from knowing that you are not making it easy for intelligence agencies to go through your most important and personal data.

The players in this solution here are:

  1. btsync: A still alpha lab product from the original bittorrent creators, which allows you to securely sync a folder between multiple devices owned by you. Ready to use binaries are provided for all the major platforms (desktop and mobile) as well as several ARM architectures (which is where Raspberry Pi comes in). The UI interface is not great, which is probably why the next piece of the puzzle comes in - Owncloud. But if you really want the basics, this is all the software that you need for a synchronized folder among multiple devices.

    The minimal btsync web ui

    Unfortunately, btsync is **not** [Opensource software][oss]. So it is entirely upto you who you trust more - Dropbox or Bittorrent Inc. Btsync is [reported][btphone] to [phone home][phonehome] for version check and uploading anonymized stats. I have looked around. btsync doesn't have any open source competition yet.

  2. Owncloud: This is actually a standalone application for sharing your files via a dropbox like web interface. It has an extensive list of features - sync between devices, multiple user support, file versioning, undelete, Lucence based search, shared calendar, tasks, data migration/backup and many more. Most importantly, this is Open source software, with all the code available on github.

    One question that came to my mind after reading the feature set is that Owncloud already had a [multiple device file sync][owncloudsync] feature. So why would you need btsync?

    From reading over the net, it seems to me that btsync is considered to be more reliable as a file sync client. So the idea is to use btsync everywhere, and on one of the devices, use owncloud to provide the interface to serve/edit files over the web.

  3. So how does Raspberry Pi - the overnight micro computing sensation fit into all this? This is because of the way Bittorrent works. For uploads to happen for a torrent, you need one seed up with the complete data. Since btsync is essentially multiple torrents bunched together, it needs a seed as well. And if all your devices are mobile and not always on, there is a good chance that when you need a file, none of the other devices are up and you are cut off from your data.

    ‘Raspberry PI’ by Paul Downey

    ‘Raspberry PI’ by Paul Downey

    The solution is simple, have one of the btsync devices to always be running, essentially acting like the seeds for your data. If this always-on computer is a mind-numbingly low 6 watts burning tiny box hanging off a wall socket, well .. you can see the appeal of R-pi.

But I already have an always-on device - my Synology NAS, which also happens to be an ARM device. So to try it out, I downloaded the PPC version of btsync and tried to run it - no luck. The btsync binary is a glibc2.4 binary while the NAS firmware is glibc2.3. btsync uses inotify on glibc2.4 and therefore will never support glibc2.3, so I am out of luck here.

# ./btsync 
./btsync: /lib/libc.so.6: version `GLIBC_2.4' not found (required by ./btsync)

The one thing I am yet not comfortable with Raspberry Pi, is its lack of a shutdown switch. Raspberry Pi is perfect for headless usage and with a USB wifi dongle, the only wire it needs is the charger. However to shut it down properly, you cannot just turn it off. Just like any other Linux machine, you need to execute the shutdown command which will unmount the filesystems cleanly before turning off the machine. Mess this up, and you will end up with a filesystem which needs an fsck on bootup and the machine will not boot without you using a keyboard and console to fsck the filesystem.

Till I get myself a hack to shut R-Pi headlessly in a clean and convenient way, I just am not to comfortable using it for serious applications, let alone touch my precious data. There is a nice discussion on raspberry pi forums that I need to readup to do this, and a few blogs (like this) already provide various ways to do that. I just need to find some time to go through all that.

tech
Being 'Ramen Profitable' Law enforcement was not supposed to be easy