Don’t believe the hype: The cloud is far from safe. But fear not — now you can forget Dropbox once and for all and show the authorities a solid middle finger by deploying your own private , unlimited and safe cloud storage platform with Raspberry Pi and BitTorrent Sync.
Part of this process overlaps with the creation of Pi-based network storage, which which you can also check out. If you’re really adventurous, you can even create a Raspberry Pi Twitter Bot that adds in all the new files added to it. Do this.
BitTorrent? Isn’t that illegal?!
Well, actually, no. — although the most common use of the BitTorrent protocol is to distribute material that falls under copyright protection. BitTorrent Sync this is a separate (closed) project from the creators of BitTorrent; it uses the same basic file distribution principles, but with encryption and for a private group of users.
Simply put, BitTorrent Sync is similar to Dropbox in that it syncs files and folders between authorized computers, but doesn’t require a third-party cloud provider as it uses BitTorrent’s underlying peer-to-peer distribution technologies.
You will need
- Raspberry Pi
- USB stick
- Computer for testing
Beginning
As always, I start with a fresh install of Raspbian, but this should work fine with an existing install. Grab an image from here and write it using this utility for OS X or ImageWriter for Windows. After logging in remotely via SSH perform a basic system update.
sudo apt-get update sudo apt-get upgrade
Mount disk
List your drives using
sudo fdisk -l
Once you have identified the correct device /dev for your drive:
sudo mkdir /media/sync sudo mount -t auto /dev/sda1 /media/sync
(provided that /dev/sda1 — your USB drive)
To make sure they are automatically mounted on restart, edit the config file fstab in the following way:
sudo nano /etc/fstab
Add the following line, remembering:
/dev/sda1 /media/sync vfat defaults 0 0
- /dev/sda1/ should be where your USB stick is connected
- /media/sync is the folder you created to act as a mount point
- vfat is the file system type. Use ntfs-3g, if it’s an NTFS drive, but you also need to run sudo apt-get install ntfs-3g . For Linux partitions, ext4 is common.
Install BitTorrent Sync
Luckily, there is now an easy way to install without messy compilation, but we need to add our own source to find the package files. Use the following commands, pasting one after the other.
sudo gpg –keyserver pgp.mit.edu –recv-keys 6BF18B15 sudo gpg –armor –export 6BF18B15 | sudo apt-key add - sudo echo deb http://debian.yeasoft.net/btsync wheezy main contrib non-free >> /etc/apt/sources.list.d/btsync.list sudo echo deb-src http://debian.yeasoft.net/btsync wheezy main contrib non-free >> /etc/apt/sources.list.d/btsync.list sudo apt-get update sudo apt-get install btsync
Please note that if you get file permission errors sources.list.d try editing the file manually with Nano:
sudo nano /etc/apt/sources.list.d/btsync.list
and paste in these lines.
deb http://debian.yeasoft.net/btsync wheezy main contrib non-free deb-src http://debian.yeasoft.net/btsync wheezy main contrib non-free
Start working with the update and installation commands as before.