Our Mac Mini finally died. It turned out that the random crashes I was seeing were due to hardware issues, namely the hard disk.
Its sole purpose was to share music, and act as a storage server. I looked at a number of options to replace it, including buying a new Mac Mini, or a low-end PC. I ruled the latter out because of form factor: I wanted a small box to hide in a corner. Mini PCs exist, but they are pretty expensive, and a new Mac Mini is about $600. It seemed wasteful to invest into so much horsepower to have it sit doing nothing most of the time, and streaming audio files once in a while.
I therefore decided to go with a more exotic solution: a Linksys NSLU2, which is a network box running Linux in which you can plug USB hard drives. There’s a lot of hacking going on on this device, and it is cheap: $60 on Amazon.
I was faced with the dilemma of choosing which firmware to install, out of the 9 flavors available. As a matter of fact, I experienced more than the dilemma, since I experimented with quite a few of them.
I wanted the following features:
- Ability to run the firmware without a flash drive: flash drives are pretty slow, and not really designed to have repeated reads and writes that a root partition will get.
- Media server available: this is the primary purpose of this box.
- Multi-user support: I want to use it as a storage server for different servers.
- Ability to spin down the hard drives attached to it: most of the time, the box is idle, so I don’t need to have the disks spin.
- HFS+ support: I have some disks that were formatted on a Mac.
I ended up settling with OpenWRT, which has all those features:
- Self-contained: It is very small and fits on the 5MB root partition of the Slug.
- Media server: mt-daapd is installable via Optware.
- Multi-user: adduser is available via Optware to help setup user accounts (though you could obviously do it by hand).
- Spinning down drives: using the shell script from NSLU2-Linux with
sg_start from Optware’s sg3-utils works beautifully.
- HFS+ support: OpenWRT has a modern (184.108.40.206), well packaged kernel, that allows to install exotic modules as needed.
Amazingly, the 32MB of RAM are enough for the Web server used for configuration, the SSH server for login, the FTP server for file transfer, the media server for iTunes streaming, without the need of a swap device.
I did try alternative firmwares. DebianSlug is a fully-fledged Debian distribution, but it’s much bigger, and requires installation on an attached drive; it actually took me 3 tries to manage to install it, and for some reason, it broke after a few hours (I couldn’t log into the box any more!). SlugOS/BE would probably have worked, but it didn’t feel as polished as OpenWRT.
All in all, I’m happy about the solution that I ended up with: the NSLU2 with OpenWRT is a low-cost, low-energy solution, which works really well.