There are many Raspberry Pi guides out there that helps you to transform your Pi into a server supporting downloading torrents and sharing files via Samba and DLNA. However, they all have a major flaw: supporting only ONE hard drive. In this instructables, I will help you to setup Transmission, Samba and miniDLNA on your Raspberry Pi to support as many hard drives as you like (as long as there is enough power)
List of required components:
1. Raspberry Pi Model B for internet access
2. Powered USB hub
—– http://www.ebay.com.au/itm/Brand-new-USB-2-0-HUB-Powered-7-Port-High-speed-AC-Adapter-Cable-/251280391263?pt=AU_Laptop_Accessories&hash=item3a817a7c5f&_uhb=1
3. Power supply with 3-4A
—– http://www.ebay.com.au/itm/5V-AC-Power-Supply-Charger-Adapter-for-D-Link-DUBH7-DUB-H7-Hub-5V-3A-5-5-2-5-/181291153550?pt=AU_Laptop_Accessories&hash=item2a35cb788e&_uhb=1
4. (Optional) USB Wi-Fi dongle. Guides on setting up the Wi-Fi dongle are plentiful. You can do it with command line via SSH or from the GUI.
Step 1: Hooking up the Raspberry Pi
Hardware wise,
Step 1.
Discard the power adapter that comes with the powered USB Hub if it supplies less than 3A. You need 700mA for the Pi and 500mA for each hard drive you connected.
Step 2.
Connect the USB Wi-Fi dongle to the Raspberry Pi.
Step 3.
Connect the USB output cable from the hub to the Pi. This should also power the Pi, so no need for a mini USB cable.
Step 4.
Connect the hard drives to the hub,
Step 5.
Power on the Pi. Powering Pi before plugging in USB components may restart Raspberry Pi.
Step 2: Setting up hard drives
Plug in your USB Hard Drives. If you are using NTFS, install ntfs-3g.
sudo apt-get install ntfs-3g
Step 1.
Execute
ls -l /dev/disk/by-uuid
Write down drives UUID and drive paths (sda*, sdb*, sdc*…).
Step 2.
Execute
ls -l /dev/disk/by-name
Write down name and drive paths.
Step 3.
Match drive paths, names and UUID
Step 4.
Create locations for mount points for each hard drive. Replace DRIVE_NAME_* with names you like, I chose to use the same name as my disks’ name as obtained from Step 2.
sudo mkdir /media/DRIVE_NAME_*
Step 5.
Mount the USB drives
sudo mount -t ntfs-3g -o uid=pi,gid=pi /dev/sdxx /media/DRIVE_NAME*
Note:
ntfs-3g for NTFS drives
vfat for FAT32 drives
ext4 for ext4 drives
Replace sdxx and DRIVE_NAME_* from the list you have compiled in step 3 and 4.
Step 6.
Now we will configure the Raspberry Pi to mount these drives after every reboot.
Make a backup for your current fstab
sudo cp /etc/fstab /etc/backup_fstab
Add mount information to the fstab file
UUID=xxxxxxxxxxxxxx /media/DRIVE_NAME_* ntfs-3g rw,defaults 0 0
Replace with the correct UUID, mount point and drive type
Step 7.
Turn off GUI mode by using sudo raspi-config
Restart Raspberry Pi with sudo reboot
At this point, your USB drives should be mounted properly.
Step 3: Installing Transmission / rTorrent (updated 18.03.2014)
Because this is a headless server, we are accessing the command lines through SSH. Fortunately, SSH is enabled out of the box for Raspbian.
Step 0.
Let’s update and upgrade the repositories and distribution by using:
sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade
Step 1. You can either install Transmission or rTorrent or both. Skip to Step 2.2 for rTorrent installation.
Install Transmission
sudo apt-get install transmission-daemon
In order to download torrents, we need to access Transmission’s WebUI. This can be done by running Transmission daemon (started after installation) and accessing the Pi’s internal IP address and Transmission’s designated port.
For more detail: Raspberry Pi Torrent, Samba and DLNA with 3+ hard drives