Building an Ultra-Low-Power File Server with the Trim-Slice
NFS
NFS is the classic Network File System, and it is has been in use for decades on Linux and UNIX. The Popcorn Hour media player connected to my TV supports NFS, and I don't have any Windows computers, so NFS is really the only classic file-serving protocol I need (or want) on my network. NFS has very limited security, so it's not ideal for everyone, but it's lightweight and easy to configure. In my opinion, if you have a device that supports NFS and SMB, go with NFS.
On Ubuntu, the NFS server I use is called nfs-kernel-server, and you can install it with the following:
sudo apt-get install nfs-kernel-server
To create an nfs share, edit the /etc/exports file, and add the directory you want to export. Here is an example:
/mnt/disk01 popcorn(ro,sync,root_squash,no_subtree_check)
The above line exports the /mnt/disk01 directory to my Popcorn Hour, with the following flags:
-
ro— read only: in other words, don't allow anything that could change the filesystem. The Popcorn Hour has the ability to delete items, but I don't want to let my kids delete things arbitrarily or accidentally with the remote. -
sync— reply to requests only after the changes have been committed to stable storage. -
root_squash— map requests from uid/gid 0 to the anonymous uid/gid. This makes things a little more secure. -
no_subtree_check— from the man page: "This option disables subtree checking, which has mild security implications, but can improve reliability in some circumstances." See the man page for more information (man exports).
With the line in place, I run the sudo exportfs
-ra command to
refresh the exports. Then on the Popcorn Hour, I can mount the exported
directory, and away I go. There are several other options you can use in
the /etc/exports file. See the exports man page for details.
The example entry above can't be mounted on any other host, but to
permit other hosts to do so, I either can change
popcorn to the
IP address and netmask of the network I want to share it with (for
example, 192.168.10.0/24 for every host with an IP address starting with
192.168.10.), or I can add additional host definitions to the end of
the line.
With the exports file updated and refreshed, I can mount the export with something like this:
sudo mount -t nfs trimslice:/mnt/trimslice/disk01
↪/mnt/trimslice/disk01
Or, I could add an entry like the following to my /etc/fstab file:
trimslice:/mnt/trimslice/disk01 /mnt/trimslice/disk01
↪nfs defaults 0 0
and the NFS share always would be mounted at boot time.
Samba SMB/CIFS
Samba, aka SMB/CIFS, is how you go about sharing files with computers running Windows. If I had a Windows machine or two, using Samba would be a given. I don't, but I'll go ahead and describe the process here. For starters, Samba is installed on the Trim-Slice with the following:
sudo apt-get install samba
After installation, edit the /etc/samba/smb.conf file to set up your shares (add them to the end of the file). A read-only share equivalent to the NFS one described above is:
[disk01]
comment = trimslice disk01
path = /mnt/disk01
browsable = yes
guest ok = yes
read only = yes
Add the above to the end of the smb.conf file, and the share will pop into existence on the network. With Samba, there is no need to restart the service or run a command after editing the smb.conf file; any changes are applied automatically as soon as the file is saved.
It's a good idea to uncomment the security = user line in the smb.conf
file to add some security (and if you do want security, you should set
guest ok in the above example to
no). And, if you have a proper Windows
network, you should change the workgroup name in the smb.conf file to
the actual name of your Windows workgroup.
As with NFS, you can enter a lot more settings in the smb.conf file to tweak things just the way you want them. The default file is filled with examples, and the Samba documentation goes into even greater detail.
DAAP
DAAP, in case you are interested, stands for Digital Audio Access Protocol. An older, but serviceable, standalone DAAP server for Linux is mt-daapd, also known as the Firefly Media Server. Unfortunately, it is not under active development. Some forks are in the works (which aren't in the Ubuntu repositories yet), so maybe the situation will improve in the future. To install it, do the following:
sudo apt-get install mt-daapd
After installing mt-daapd, set the password for the admin account in the /etc/mt-daapd.conf file. Technically, the password already is set, but it's good practice to change it. You can tweak other settings in the file, but the GUI is easier.
Figure 3. mt-daapd, aka the Firefly Media Server
After changing the password, restart mt-daapd with:
sudo /etc/init.d/mt-daapd restart
Then, go to the Web interface to configure it: http://trimslice:3689 (replace "trimslice" in the URL with the correct IP address or name).
The configuration page is simple and self-explanatory. You can set the name, change the admin password and set a password for listening to the music (in case you don't want to share your collection of classic Dr. Who music with everyone on your network). You also set which folder or folders contain your music (multiple folders can be specified). Finally, you can configure how often to have mt-daapd rescan your music folder(s).
Once the changes are to your liking, pressing the Save button saves the settings to the /etc/mt-daapd.conf file. But, the GUI is there so you might as well use it.
All should be well and good at this point. Unfortunately, mt-daapd, as packaged in the repository the Trim-Slice uses, does not support FLAC files. If your collection is mostly MP3 files, that won't be an issue. If it is an issue, your options are to compile your own, live with the limitation or find an alternative.
Realizing the promise of Apache® Hadoop® requires the effective deployment of compute, memory, storage and networking to achieve optimal results. With its flexibility and multitude of options, it is easy to over or under provision the server infrastructure, resulting in poor performance and high TCO. Join us for an in depth, technical discussion with industry experts from leading Hadoop and server companies who will provide insights into the key considerations for designing and deploying an optimal Hadoop cluster.
Sponsored by AMD
Built-in forensics, incident response, and security with Red Hat Enterprise Linux 6
Every security policy provides guidance and requirements for ensuring adequate protection of information and data, as well as high-level technical and administrative security requirements for a system in a given environment. Traditionally, providing security for a system focuses on the confidentiality of the information on it. However, protecting the data integrity and system and data availability is just as important. For example, when processing United States intelligence information, there are three attributes that require protection: confidentiality, integrity, and availability.
Learn more about catching the bad guy in this free white paper.
Sponsored by DLT Solutions
| Designing Electronics with Linux | May 22, 2013 |
| Dynamic DNS—an Object Lesson in Problem Solving | May 21, 2013 |
| Using Salt Stack and Vagrant for Drupal Development | May 20, 2013 |
| Making Linux and Android Get Along (It's Not as Hard as It Sounds) | May 16, 2013 |
| Drupal Is a Framework: Why Everyone Needs to Understand This | May 15, 2013 |
| Home, My Backup Data Center | May 13, 2013 |
- Linux Systems Administrator
- New Products
- Senior Perl Developer
- Technical Support Rep
- UX Designer
- Web & UI Developer (JavaScript & j Query)
- Designing Electronics with Linux
- Dynamic DNS—an Object Lesson in Problem Solving
- Using Salt Stack and Vagrant for Drupal Development
- Making Linux and Android Get Along (It's Not as Hard as It Sounds)
- Favorite (and easily brute-forced) pw's
15 min 57 sec ago - Have you tried Boxen? It's a
6 hours 7 min ago - seo services in india
10 hours 39 min ago - For KDE install kio-mtp
10 hours 40 min ago - Evernote is much more...
12 hours 40 min ago - Reply to comment | Linux Journal
21 hours 25 min ago - Dynamic DNS
21 hours 59 min ago - Reply to comment | Linux Journal
22 hours 58 min ago - Reply to comment | Linux Journal
23 hours 48 min ago - Not free anymore
1 day 3 hours ago
Enter to Win an Adafruit Pi Cobbler Breakout Kit for Raspberry Pi

It's Raspberry Pi month at Linux Journal. Each week in May, Adafruit will be giving away a Pi-related prize to a lucky, randomly drawn LJ reader. Winners will be announced weekly.
Fill out the fields below to enter to win this week's prize-- a Pi Cobbler Breakout Kit for Raspberry Pi.
Congratulations to our winners so far:
- 5-8-13, Pi Starter Pack: Jack Davis
- 5-15-13, Pi Model B 512MB RAM: Patrick Dunn
- 5-21-13, Prototyping Pi Plate Kit: Philip Kirby
- Next winner announced on 5-27-13!
Featured Jobs
| Linux Systems Administrator | Houston and Austin, Texas | Host Gator |
| Senior Perl Developer | Austin, Texas | Host Gator |
| Technical Support Rep | Houston and Austin, Texas | Host Gator |
| UX Designer | Austin, Texas | Host Gator |
| Web & UI Developer (JavaScript & j Query) | Austin, Texas | Host Gator |
Free Webinar: Hadoop
How to Build an Optimal Hadoop Cluster to Store and Maintain Unlimited Amounts of Data Using Microservers
Realizing the promise of Apache® Hadoop® requires the effective deployment of compute, memory, storage and networking to achieve optimal results. With its flexibility and multitude of options, it is easy to over or under provision the server infrastructure, resulting in poor performance and high TCO. Join us for an in depth, technical discussion with industry experts from leading Hadoop and server companies who will provide insights into the key considerations for designing and deploying an optimal Hadoop cluster.
Some of key questions to be discussed are:
- What is the “typical” Hadoop cluster and what should be installed on the different machine types?
- Why should you consider the typical workload patterns when making your hardware decisions?
- Are all microservers created equal for Hadoop deployments?
- How do I plan for expansion if I require more compute, memory, storage or networking?



Comments
I have my TrimSlice running now.
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
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
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...
...if it wasn't made in Israel. I never buy anything from Israel, not even their avocado.
Cheers,
Sid
Curious
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
No, there is an issue with Israel and how they treat the Palestinians and get away with it.
This is really not a place
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
i stopped watching mel gibson movies due to mel gibson being an anti-semite.
Oh, I see
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?
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?
It runs Linux you dolt. On top of that, the hardware specifications are clearly disclosed, including reference diagrams and mechanical drawings, etc.
Israel
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
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
Oh it's made in Israel? Thanks for pointing that out, def getting a few now.
A1000 + Sata
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
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
Great article!!
First, there is classic "file
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
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?
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
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
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
A printer-friendly link would be a nice addition to a great article.
I agree :)
I agree
:)