Building an Ultra-Low-Power File Server with the Trim-Slice

UPnP

For serving up video files to my PS3, I use the MediaTomb UPnP media server. Or at least, I would, if I didn't have the Popcorn Hour. MediaTomb, like mt-daapd, is a nice piece of software and works just fine for what it does, but devices like the PS3 can be very picky about what file types they will support. On-the-fly transcoding (supported by both mt-daapd and MediaTomb) can eliminate some of these issues, especially with audio files (for example, by transcoding a FLAC file to WAV while it is being transferred, so that iTunes can play it). Transcoding isn't practical for video files though. It can be done, but the CPU requirements are hefty to say the least, especially when you start talking about 720p and larger video files.

Figure 4. The Media Tomb File Browser

Limitations aside, installing and configuring MediaTomb is similar to mt-daapd. First, enter the following:


sudo apt-get install mediatomb-daemon

After the install completes, edit the /etc/mediatomb/config.xml file to enable the graphical user interface (GUI) and set the default user and password. To do this, change enabled="no" in the following lines to enabled="yes" (both of them), and set the password to something more secure:



<ui enabled="no" show-tooltips="yes">
  <accounts enabled="no" session-timeout="30">
    <account user="mediatomb" password="mediatomb"/>

The above lines should be near the top of the file. Save the file, and restart the server with:


sudo /etc/init.d/mediatomb stop
sudo /etc/init.d/mediatomb start

Once restarted, connect to http://trimslice:49152/. Enter the user name and password, and you will be in the GUI. To add a folder, click the Filesystem link, and browse to the folder you want MediaTomb to index. With the correct folder selected in the left pane, click on the plus, or plus-with-a-circle icon, to have MediaTomb scan the contents of the folder. The plus-with-a-circle icon adds the folder as an autoscan folder, meaning it will rescan the folder periodically looking for new files.

For PS3 support, a couple lines need to be changed in the config.xml file; they are commented and easy to find if you search for "PS3".

Backups

With this new file server, I lose the protection of RAID, so backups are more important. RAID, of course, does not eliminate the need for backups; it just makes the primary filesystem more reliable. Because I already needed backups with my old setup, I had a backup system in place.

The "system" itself is a custom rsync backup shell script. The backup drive contains several directories: one named current and then 14 others named 01, 02, 03 and so on, up to 14. The basic flow of the script is:


rm -rf '14'
mv '13' '14'
mv '12' '13'
...
mv '01' '02'
cp -al 'current' '01'
rsync drive-to-back-up to 'current'

The -al part of the copy command above is important. It tells the command to operate in archive mode, which preserves attributes and copies directories recursively, and to create hard links instead of actually copying the files. When rsync comes upon a changed file, it will de-link the file before updating it, so the combination of rsync and the cp command gives me 14 days of backups (assuming the script is run once a day).

The extra space required for these backups is low, so I can use the same size drive for the backups that I do for the primary. Once a backup drive starts nearing its limit, the primary drive likely will be close to its limit too, and it will be time to shop for an additional pair of drives.

I've used variations of this script for years, and if I had to start from scratch today, I might use it or something else. Lots of excellent backup programs are available for Linux. The point is to make backups, as many as necessary.

Conclusion

The Trim-Slice has worked out very well as a file server. The built-in serial port lets me operate it completely without a monitor, and the hardware has so far been more than adequate for my household's modest file-serving needs.

With dual 2TB external USB disk drives (and more to come), the Trim-Slice is even more energy-efficient than I thought it would be. My consumer-grade "Kill-a-Watt" power meter (which I admit is probably not very accurate) shows an average power draw of 0.28 amps, which, completely accurate or not, is much better than the 1.8 to 2.0 amps the old server was pulling. The power draw of the Trim-Slice by itself is an astounding 0.08 amps.

Power is just one benefit. I also like the smaller footprint. Noise is much better too. The old case needed several fans, but the Trim-Slice is passively cooled. There are fans in the external drive enclosures, but they don't come on very often, and when they do, I don't notice them at all. The Trim-Slice does get a bit hot to the touch, but I suppose that's what you get when you make the outer casing a heat sink.

The jury is still out on how long this new setup will last. I consider USB drives to be less reliable, and although the build quality of the Trim-Slice appears high, it's a new product with no history. To mitigate this, I am going to be very careful to make sure important stuff is copied across all future drives. Despite my worries, I must admit, I did replace a few of the drives in my RAID5 over the years, and I don't imagine the difference in reliability will be so great as to cause any huge problems.

Resources

The Trim-Slice: http://trimslice.com

The Trim-Slice User Manual: http://trimslice.com/download/documentation/trim-slice-user-guide.pdf

Linux NFS-HOWTO: http://nfs.sourceforge.net/nfs-howto

Samba: http://www.samba.org

MediaTomb: http://mediatomb.cc

Firefly Media Server: http://en.wikipedia.org/wiki/Firefly_Media_Server

The Popcorn Hour: http://www.popcornhour.com

______________________

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

I have my TrimSlice running now.

loughkb's picture

I had some fun setting it up, really enjoyed the project. I am a bit dismayed by some of the comment thread here, the political skew is annoying.

Really, this is a technical forum regarding a shared interest in warm and sometimes glowing machines that do amazing things with electrons. People should be able to discuss and share their 'shared' interest in such without regard for governments. That belongs elsewhere. We're the people, we are separate from the egomaniacal stuffed suits that play their power games, sometimes to our detriment. We are not them, leave that bickering to those who want to get themselves dirty and smelly.

Now, back to the subject at hand. I am really happy with this little device. It's providing exactly the service I desired, and at a power consumption level I can't see matched in any other hardware without making big compromises in performance.

As to power consumption. I run it off a 12 volt DC supply system that is augmented and backed up by a solar battery system. For about 6-8 hours of the day, it and the external 1 TB hard disk are completely powered by the sun. The rest of the time, it's drawing 250 - 700 milliamps, depending on rather the HD has been spun down. That's WAY below what I could achieve with other hardware.

Mine is running off an SD card in the front slot, no internal SSD. Although I don't plan on rebooting or shutting it down any more than once a year for an fsck, I should point out something I discovered.

When you shut down the unit, it doesn't sync the filesystem, just goes into a kind of suspend mode. This will cause some serious file system corruption. I know this from experience with it.

So my tip is this. Before shutting down or sending a reboot, manually do a 'sync' to flush out buffers. The file system will still indicate it was not cleanly unmounted when you fsck it, but errors will be very minor and no data will be lost.

Kevin

That pretty expensive

Mace Moneta's picture

You can get one of these instead:

Google for yourself:
ASUS E45M1-I Deluxe AMD E-450 APU AMD Hudson M1 Mini ITX Motherboard/CPU Combo

You can find it as low as $160. A lot more function and performance for a lot less money. The CPU, video, sound, gig-e are included; add 4GB RAM for $20, and you're still under $180. Power consumption with a couple of hard drives is about 25W.

You can get away with a lot

Anonymous's picture

You can get away with a lot cheaper hardware then a tegra2 powered system.
Why would you want that much graphics processing power on a fileserver anyway?

I would buy one today...

Sidney's picture

...if it wasn't made in Israel. I never buy anything from Israel, not even their avocado.

Cheers,
Sid

Curious

deandownsouth's picture

I don't usually care where something is made. Is there an issue with Israel made electronics over those from Asia or elsewhere?

No, there is an issue with

Sidney's picture

No, there is an issue with Israel and how they treat the Palestinians and get away with it.

This is really not a place

Webmistress's picture

This is really not a place for political discussions about Israel. If you have a problem with Israeli products because they come from Israel, please share those opinions somewhere else. If you think the technology behind them sucks/is awesome, then have at it.

Katherine Druckman is webmistress at LinuxJournal.com. You might find her on Twitter or at the Southwest Drupal Summit

i stopped watching mel gibson

Anonymous's picture

i stopped watching mel gibson movies due to mel gibson being an anti-semite.

Oh, I see

deandownsouth's picture

I do hate it when folks like you mix politics and FOSS. Like that idiot that does the Mint distro. He broke the rules, IMO, with his anti-Israel statement, of which he is free to do so, but not on a Linux forum. Linux and FOSS is open to anyone regardless of race, nationality, gender, religion, politics, or sexual persuasion. It's a great example of how people from all over the world can come together regardless of who or what they are and communicate and contribute. There was no reason to post what you post as it had no bearing on the product at hand.

Politics and FOSS?

Sidney's picture

What's FOSS about the Trim-Slice?

No bearing on the product at hand? Isn't the Trim-Slice made in Israel?

Come on, get real!

Really?

markdean's picture

It runs Linux you dolt. On top of that, the hardware specifications are clearly disclosed, including reference diagrams and mechanical drawings, etc.

Israel

Anonymous's picture

Hmm, did you ever do some history leasons about Israel and Palestinians?
Did you know that the Jews actually bought the land in Israel before becoming a state? Do you care to know that there were no such thing as Palenstiaians before the Israel was declared a country.

It is fools like you that make the US looks stupid, ones that don't bother to do your own research, just go off on a tangent based on rumors and lies.

Incorrect. The British used

Anonymous's picture

Incorrect. The British used the term Palestinian to refer to people from Palestine since at least start of 20th century. http://en.m.wikipedia.org/wiki/Balfour_Declaration 1917 and other documents of the era use Palestine/Palestinian terms.

Israel

Anonymous's picture

Oh it's made in Israel? Thanks for pointing that out, def getting a few now.

A1000 + Sata

PePa's picture

Not a fan of RAID for this kind of a setup. I would get a Mele A1000 ($70) with an external Sata HD (no USB, spins down, hot-pluggable). It's ARM, but Ubuntu is already running on it, I'm sure Debian won't be a problem. Or it can come with Android, but I wouldn't prefer that.

Do the same thing with my laptop

Tacra's picture

I do basically the same thing with an old lenovo T61p laptop. I put a 500GB hd in it, installed centos 6.0 (upgraded to 6.2 now), and setup it up like a functional desktop. Then setup nfs and samba, email, apache, mysql. I have a nice place to centralize all my data, ability to access anywhere in the world, enjoy all my content, and if the crap hits the fan, I can walk out the door with my system under my arm.

The T61p can take external usb hds and should be able to raid them if needed. If I were truly worried about a drive failure, I'd get say 6 usb drives, put them into 2 drive mirrors then stripe across the mirrors aka Raid 10. That setup can get me 4.5 TB today with plenty of speed and redundancy using common, off the shelf 1.5 TB hds I can buy anywhere. With lvm and xfs, I can grow the raid 10 as needed with the mirrors. Not bad for cheap commodity hd and a clone of RHEL.

I even run mediawiki off of it and can check email or cruise the web from anywhere else and have all my stuff on tap.

Asigurari Locuinte

pufos's picture

Great article!!

First, there is classic "file

Asigurari Locuinte's picture

First, there is classic "file server" software: NFS and Samba. These systems don't care what your data is. All they see are files, and no file is any different from the next (apart from size and permissions).

Price is around $350, but I

Asigurari Locuinte's picture

Price is around $350, but I bought mine on sale for $250. I've seen it go to that price at least 2x in the past 2 years.

Power consumption?

Kevin Loughin's picture

Hello,

My low power server for a few years has been an old maxterm thin client. One nice thing was the 12V power req. I run it off an old 12V PS, with a bleed over suplement from my solar power system. Most days it spends about 6 hrs totally powered by solar. (after my batts are topped off).

What is the amperage draw on the thin slice? I've been wanting to redo the server and this might just fit the bill.

I run on Debian currently, but the cpu is so weak that I can't take full advantage of Gb ethernet on my hardware.

Kevin

External RAID

Adam Casto's picture

Couldn't you use one of the external drives with built-in RAID? It's been a while, but I know I've come across some reasonably priced external USB to SATA hard drive cases with RAID options. I've been interested in them primarily for external backups with mirroring.

There are better alternatives

Vinh Nguyen's picture

I bought the Acer Aspire EasyStore (1.6ghz single-core atom) almost 2 years ago. It is energy-efficient, has a small footprint, and can hold up to 4 hard drives. I wiped out Windows and installed Ubuntu server. I serve files throughout my network via ssh, samba, and mediatomb (similar to yours). Price is around $350, but I bought mine on sale for $250. I've seen it go to that price at least 2x in the past 2 years. Seems like a better setup than yours. Just my 2 cents.

Dead tree

smitty1e's picture

A printer-friendly link would be a nice addition to a great article.

I agree :)

sis's picture

I agree
:)

White Paper
Linux Management with Red Hat Satellite: Measuring Business Impact and ROI

Linux has become a key foundation for supporting today's rapidly growing IT environments. Linux is being used to deploy business applications and databases, trading on its reputation as a low-cost operating environment. For many IT organizations, Linux is a mainstay for deploying Web servers and has evolved from handling basic file, print, and utility workloads to running mission-critical applications and databases, physically, virtually, and in the cloud. As Linux grows in importance in terms of value to the business, managing Linux environments to high standards of service quality — availability, security, and performance — becomes an essential requirement for business success.

Learn More

Sponsored by Red Hat

White Paper
Private PaaS for the Agile Enterprise

If you already use virtualized infrastructure, you are well on your way to leveraging the power of the cloud. Virtualization offers the promise of limitless resources, but how do you manage that scalability when your DevOps team doesn’t scale? In today’s hypercompetitive markets, fast results can make a difference between leading the pack vs. obsolescence. Organizations need more benefits from cloud computing than just raw resources. They need agility, flexibility, convenience, ROI, and control.

Stackato private Platform-as-a-Service technology from ActiveState extends your private cloud infrastructure by creating a private PaaS to provide on-demand availability, flexibility, control, and ultimately, faster time-to-market for your enterprise.

Learn More

Sponsored by ActiveState