Building an Ultra-Low-Power File Server with the Trim-Slice
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
<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".
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'
-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.
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.
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
Firefly Media Server: http://en.wikipedia.org/wiki/Firefly_Media_Server
The Popcorn Hour: http://www.popcornhour.com
Practical Task Scheduling Deployment
July 20, 2016 12:00 pm CDT
One of the best things about the UNIX environment (aside from being stable and efficient) is the vast array of software tools available to help you do your job. Traditionally, a UNIX tool does only one thing, but does that one thing very well. For example, grep is very easy to use and can search vast amounts of data quickly. The find tool can find a particular file or files based on all kinds of criteria. It's pretty easy to string these tools together to build even more powerful tools, such as a tool that finds all of the .log files in the /home directory and searches each one for a particular entry. This erector-set mentality allows UNIX system administrators to seem to always have the right tool for the job.
Cron traditionally has been considered another such a tool for job scheduling, but is it enough? This webinar considers that very question. The first part builds on a previous Geek Guide, Beyond Cron, and briefly describes how to know when it might be time to consider upgrading your job scheduling infrastructure. The second part presents an actual planning and implementation framework.
Join Linux Journal's Mike Diehl and Pat Cameron of Help Systems.
Free to Linux Journal readers.Register Now!
- Stunnel Security for Oracle
- SourceClear Open
- Murat Yener and Onur Dundar's Expert Android Studio (Wrox)
- SUSE LLC's SUSE Manager
- My +1 Sword of Productivity
- Managing Linux Using Puppet
- Google's SwiftShader Released
- Non-Linux FOSS: Caffeine!
- Parsing an RSS News Feed with a Bash Script
- Doing for User Space What We Did for Kernel Space
With all the industry talk about the benefits of Linux on Power and all the performance advantages offered by its open architecture, you may be considering a move in that direction. If you are thinking about analytics, big data and cloud computing, you would be right to evaluate Power. The idea of using commodity x86 hardware and replacing it every three years is an outdated cost model. It doesn’t consider the total cost of ownership, and it doesn’t consider the advantage of real processing power, high-availability and multithreading like a demon.
This ebook takes a look at some of the practical applications of the Linux on Power platform and ways you might bring all the performance power of this open architecture to bear for your organization. There are no smoke and mirrors here—just hard, cold, empirical evidence provided by independent sources. I also consider some innovative ways Linux on Power will be used in the future.Get the Guide