In the picture besides you see my new home server built around a raspberry pi. The parts in detail:
- raspberry pi model b Rev.2 inside a transparent casing
- D-Link DUB-H7 7-Port USB 2.0 Hub (confirmed working with the raspberry pi)
- 2.5 inch 500 GB usb harddisk from toshiba (an older one I had)
- Hauppauge Nova-T Stick for DVB-T (confirmed working with the raspberry pi IF you have a powered usb hub!)
The pi is connected to a fritzbox 7270 via ethernet and is running raspian (Debian Wheezy). The CPU is overclocked a little at 800 MHz.
Currently this small computer is running the following services for me:
- full webserver consisting of nginx, php and mysql (follow standard tutorials for debian)
- web rss reader using tiny rss 1.7.4
- streaming tv from the tv stick to all computers in the network using vdr and streamdev-plugin
- streaming requested music via the upnp protocol having installed minidlna as described here
- common file storage via ssh/sftp
- backup space via rsync
Memory usage is around 100 MiB all the time (no graphical is running). TinyRSS could be running a little snappier – I intend to help optimizing it a little. Streaming tv is putting 15% cpu usage on the pi.
The best about it is the low power usage. I measured it and even together with the power supply it never reached 8 watts. I see around 5 watts at idle. It may peak a little higher when there is full cpu and disk load – but that’s rare. So you can think of having it running all day without some bad feelings about power usage.
I intend to add another usb disk acting as a backup by mirroring the data on the other disk.
Things to know about power usage
Power supply was the only big question I had when putting together the parts I needed. I wanted to keep costs and power losses low by not adding more power supplys than absolutely needed.
The raspberry pi can be powered via an usb port. But it needs at least 700 mA what not every port provides. The usb port of the Fritzbox was no option because of that. If you want to connect more power hungry devices (like harddisks or tv sticks) via usb to the raspberry, you really need a powered usb hub because no usb port can power the pi AND that devices together. I wanted to run the pi, two harddisks and a tv stick altogether, so some power was needed.
Instead of buying a power supply for the pi and a powered usb hub (which would make two), I only bought the usb hub. The D-Link hub is specified to deliver 3.5 A, what should be enough. So I simply pluged the pi into the hub and connected the hub with the pi via one of its two usb ports again. This connection circle is working well and every device I plug in the hub can be used by the pi. This trick saved me one power supply and some power being burned by an additonal transformator.
A hint: if you intend to run usb disks with that hub: Have Y-cables available (with two usb plugs). One port of the hub may not be enough to power the disk, but using two of them will suffice.
In the meantime I added a second USB harddrive to the setup which serves as a backup. Via cronjob the content of the first harddisk is transfered to the backup disk every night by rsync. That works perfectly.
Moreover I have a cronjob making a low level copy of the sd card containing the system image to the hard disk weekly. So I have a full backup of the system in case the sd card is failing.
Two problems I encountered. Mirroring my desktops home directory to the usb drives of the pi via rsync often crashes long before having finished. I do not know the reason but found rsync to be no backup solution for me. Maybe unison will work here.
Apart from that I sometimes find that my tv stream from the pi suddenly aborts and cannot be restored. It took me a while to find out that the problem is actually the fritzbox 7270 running FritzOS 5.50. After restarting it, everything works again. Must be a strange bug in the fritzbox with data intensive socket connections. So if you are watching tv via your pi and the stream aborts, the problem might actually be your router.
Reblogged this on Project ZooLoo and commented:
We were actually considering having a whole page on the Blog dedicated to the developments of the Raspberry Pi Team and its ever expansive community.
What do you guys think?
Hello! Nice setup! One concern though: I had Raspbian running on a SD card for a few months, until one not so fine day, the files on the SD card got corrupted and half of the applications didn’t work anymore. So now I run Raspbian on hard drives or USB sticks only. You might even have a faster system if the files are on a usb hard drive… I use the SD card only for early booting, and i changed the /boot/config.txt file to telle the Pi to go on booting on sda1 or sda rather than on the sd card.
I have a cron job running making a low level copy of my sd-card every night on the usb harddrive. So if the sd card goes bad, I write the image on a new one and can go on.
Actually I find the boot process quite fast although it is known that the sd slot of the pi is slower than a sd reader connected via usb. However, loading times is not the bottleneck of the pi.
Could you pls. be so kind as to post your cron job & setup for this? Thx.
I’m glad when I can help but you have to be more precise what you want to know.
nice report. I would like to try the same configuration at home. What I would like to know: is it possible to record TV from the stick on HDD? And in parallel stream (playback) a recorded HD program from HDD to the local net (i.e. via ethernet)? Any experiences?
Thanks a lot in advance,
Sure its possible, although I never did it directly. I however already recorded the stream with vlc running on a machine in the network.
There is of course cvlc which I could run from the commandline to do the same directly on the pi. As long as you do not decode the MPEG2 stream (which is probably to much for the pi) you should be fine.
Streaming a file from hdd to the net is something for standard media software like XBMC I think.
Very interesting set up and configuration you made with rsp. Especially your back up process. Which commands are you using for backing up sd card? Did you have made already a restore test from your back up?
Sorry, I did not see your comment.
I used a dd command earlier, like
dd if=/dev/mmcblk0 bs=1M of=/srv/card.img
I did restore the sd card from that, but it turned out that this was not the best approach. Every SD-card I had, even if they are labeled with the same size, has a different size when it comes to bytes. So I ran in the situation that the image created by dd was always bigger than the sd card I wanted to write it on. So I had to run a filesystem repair afterwards and luckily that always worked.
I changed the backup strategy for a file-based one know. It simply rsync again. Like this:
rsync -vura --delete --exclude=/dev --exclude=/offlinebackup --exclude=/sys --exclude=/proc --exclude=/srv --exclude=/srvbackup --exclude=/tmp / /srv/cardbackup/
In case of a sd card failure I would do this:
This should result in a clean restore no matter what the sizes of the used sd card are (as long as there is enough room for the files).