Network Attached Storage Cube
[originally submitted to the MacMod contest in 2007]
Those who are familiar with my modding career know that I have 3 fetishes when it comes to modding. My first fetish is saving "dead" Macs by transplanting the working parts into a useful form factor that allows it to continue serving some special purpose. My second fetish is building entertainment center computers. My third fetish is the one we'll be satisfying today... building Network Attached Storage servers.
Last year's entry (the Network Attached Storage Bin) combined fetishes 1 and 3 into a hideous monster of dubious practicality. This year, I am on another mission to save a particular Mac from the dust bins, but this time the project is both practical and attractive.
If you could care less what my mission is here in regard to the legendary Cube, skip this paragraph now. Otherwise, read on.... So, I've been seeing a lot of Cubes make their rounds on the Low End Mac Swap List (Google Group) lately and have been feeling sad for the poor little unappreciated orphans. I figured I could use this year's entry as a way to let people know that there is still at least one very good use for their old Cubes. Additionally, if you have ever looked at the retail options for NAS devices, you are aware that we Mac users tend to get the shaft, having to settle for SMB and FTP support when what we really want is AFP. The NAS devices that are of decent quality and support AFP run in the ballpark of $200 for just the case last time I checked. A used Cube can be purchased for not much more, and it has way more horsepower and functionality. Not to mention that most NAS devices just look like crap, especially in comparison to the simplicity of the Cube. The Cube makes a nice decorative addition to an office, as well as keeping noise pollution to an absolute minimum since there are no fans to cool it. Bonus!
I have a Cube I've been using as a backup server for a while now and I love it. I had maxed it out on storage with a 120GB drive (yes, I know 128GB is the actual max but I do not like hitting the barrier with a 160GB) and this was sufficient for backing up our laptops, but I really wanted to back up our 90GB worth of music and movies from the entertainment center as well. I had planned to use a firewire drive, but then I'd lose the elegance of my small-footprint, 3 cord solution (power, ethernet, APC USB cable). While looking for cheap hard drives, I noticed that OWC (http://eshop.macsales.com) was selling an OEM copy of the Hi-Cap Extender very cheap if you bought a drive with it. This piece of software allows you to use large drives in old Macs. I skimmed some reviews to verify that it seemed to work and decided to go this route as I could make a much better NAS for my entry by getting massive storage while retaining the footprint and cable count. I wanted the 750GB drive, but was trying to stay on the cheap. So, I settled for the 400GB knowing that when the 750s come down in price, I can upgrade and pass the 400 down to another machine or external case.
Remember that I was already using this machine as a NAS, so this tutorial is not about setting up every detail from scratch, but rather taking an existing install and cloning it over to a new large drive and then taking advantage of the additional size using the Intech software. There were no tricks to the original setup, though. This Cube is running a basic install of OS X 10.3.9 with file sharing and ssh (Remote Login) enabled in the Sharing section of System Preferences. The only additional software requirement was a VNC server so that it would be possible to access the desktop over the network since this runs headless. The screen shots below were taken over this VNC connection, which is why they are a little "grainy". Now that you are up to speed on the starting point, follow along with the steps that led me to NAS bliss.
Step 1: Deciding How To Partition
First of all, I had to decide how I wanted to partition the hard drive. The manual for the
Hi-Cap Driver states in one section that every partition should be 128GB or less. At first, I was
disappointed because I had hoped to have one large contiguous chunk of storage space so I could
avoid having to manage free space - which was causing me to procrastinate in doing my
backups. Upon reading through the remainder, though, I noticed the section for
"New or Unformatted High-Capacity Disk Drives". This told how to set it up with a single 128GB
partition for the boot volume and the remaining space all allocated to another single partition.
This is the route I chose. It means that I have to use the boot partition for some of my backups
to avoid wasting space, but this is fine with me as that large partition will really only be for
my iTunes Library anyway.
Step 2: Install the Hi-Cap Driver and Speed Tools
The order I am doing things here is different from what is described in the manual, because I am
taking an existing install of OS X and moving it to the 400GB hard drive. So, I need to make sure
I have the driver installed and ready to use in the existing installation of OS X
prior to cloning it over to the new drive. This will prevent possible issues when I boot from the
drive after cloning.
On the CD, there is an app labeled "ATA Hi-Cap OEM Installer". The installer will ask for your
password, then present you with a very straightforward interface.
The install process is quick and painless and requests a restart when it is done.
After the restart, I went ahead and installed the "Intech Hard Disk SpeedTools for Mac OS X".
It offers a handful of tools and I read the Info on each before installing (see the View buttons in
the image below). The only one I opted out of was "Device Tuner" because its Info panel stated that
it is unsupported. I have learned the hard way over the years not to take chances with drives, so
I'll pass on this.
This installer also requests a restart before using the tools, so I went ahead and restarted since I
intend to give their cloning tool a chance to prove its worth.
Step 3: Drive Partitioning
To partition the drive, I installed it into the miniStack case that I have and hooked it up via
firewire to the Cube. I fired up Disk Utility and set the drive to 2 partitions. The first was
designated to have 127.99GB, Journaled file system, no Mac OS 9 drivers (I said good riddance to 9
LONG ago), and named it Cube2. I will later rename it to Cube, but I have never used Intech's clone
tool and want to be sure there are no problems cloning from one drive to another if the partitions
are named the same. The second partition set the remainder of the drive as free space.
After the partitioning was over, the drive now showed up as a single partition in Disk Utility and I could not "see" the free space. For some reason, my brain is telling me this is not normal and that I should be seeing the free space partition, but I'm going to ignore that for now and bank on the Extender program to fix it. We'll see.
Step 4: Cloning to New Drive
The SpeedTools utility for backups is called QuickBack, and it is the tool for cloning as well.
I am really tempted to stick with what I know and use Carbon Copy Cloner, but I am going to give
this a chance since I bought it.
I open up QuickBack, choose the internal drive for my Source, then choose the external as my Target.
Immediately, I get a dialog warning me that "Ignore Permissions" is set on the Target drive and that
I need to fix that before proceeding. Nice. I am liking this tool already.
So, off to the Finder to "Get Info" on the drive and disable "Ignore Permissions":
Now back to QuickBack, I check off the "Make Destination Bootable" and "Erase Destination" options and
click "Backup". I am presented with a very nice progress meter which tells me how many MB it has
completed and what directory it is currently copying. Again, very nice. Assuming the clone comes out
right, I think I may be sticking with QuickBack for my cloning needs in the future.
I let it run overnight, so I can't say how long it took, but when I came back to it, I found a dialog
stating that the backup had completed successfully. I clicked Okay and then I shut down so I could
transfer the hard drive into the Cube.
Step 5: Installing the Hard Drive
The Cube is one of the coolest hardware designs I have ever worked with. To get to the innards,
you just flip it over, push in the release handle, then pull up on it to remove the frame from the
shell.
Click above images for larger versions.
Once, it is out, there are 2 hex screws that hold a guard plate in place behind the drives. After
removing that, the IDE cable and molex connector can be unplugged from the back of the hard drive.
To remove the drive, there are 3 hex screws on the side that are mounted through the heatsink. They
have clips that prevent them from falling out when they are removed from the drive, so no magnetic
tip is needed here. Once these 3 are unscrewed, the drive can be pushed from the back and it comes
out through an opening on the front of the frame.
Click above images for larger versions.
The only thing left to do is remove the guide rail from the other side of the drive. That's all there
is to it. Before installing the new drive, you MUST be sure the drive jumper
is set to Master. Most
drives ship with the jumper in Cable Select mode. If you leave it that way, the CD/DVD drive will not
be accessible and you will need to pull the frame back out and remove the guard plate to relocate the
jumper (I know because I was on the phone while installing the drive and forgot to change the jumper,
so I had to go through this).
Step 6: Run Hi-Cap Extender
After starting the Cube back up and reconnecting to it over VNC, it is time to run the "Intech ATA
Hi-Cap Extender" app. This is what will do the magic for us in terms of growing our partition to
exactly the right size and configuring that free space as an accessible partition. It requests a
password, then opens up to a small window that lets you choose a drive and click "Extend Capacity Now".
It does its magic extremely quickly (so much so that I was concerned it may not have done anything at
all), then tells you to restart and use Disk Utility to configure the new partition.
Step 7: Finish the Drive Configuration
After a restart, I open Disk Utility to discover the new partition waiting to be formatted. So,
my blind trust in Intech's tools paid off and I can say I am a happy customer. :)
After formatting the partition, I do my first test copy by backing up the Intech CD. I definitely
want to make sure I never lose this invaluable set of tools after seeing how well they work.
My final touch is to rename the main partition from Cube2 to Cube now that I am sure that this is all
finished and I will not need to redo anything. I am always a skeptic when using new software, so I
was not really expecting this all to work quite as advertised, but I must say that everything worked
perfectly and I am now a believer in the Intech tools.
Adding Features
One of the inherent limitations with a normal NAS device is that you are stuck with whatever feature
set the manufacturer has provided. The beauty of making your own NAS, however, is that you can add as many
features as you'd like through software and/or AppleScripting. The automation capabilities of OS X are
very powerful, so I will put these to use to make my Cube do all manner of menial labor. Below
are my own implemented features and some additional ideas to get you started on your own NAS.
Feature 1: Automatic File Downloading
Some of the newer NAS devices on the market include the ability to set up BitTorrent queues for doing
unattended downloads. That is fine if you do a lot of Torrent downloads, but what about the normal, yet
large, downloads we go through all the time? To me, it would be more useful to easily automate those
than Torrents. Personally, I do not get into Torrents as they are generally used for the types of things
I rarely download, and the speed can be atrocious if it is not a popular file. On the other hand, I am
often downloading ISO files of Linux distros, trial versions of software, and free or open source software,
all of which can be pretty large at times. Even if I'm just downloading the latest version of Cyberduck
at 10MB, if I'm doing it at the coffee shop the network is clogged enough to begin with so it would be nice
to offload that to my Cube which is sitting at home waiting for something to do.
AppleScript to the rescue! So, I create a special email account for my Cube and get it set up to check
for new mail every 5 minutes. Then I set up a Mail Rule that will check each message for a certain subject
line and fire off an AppleScript, which I call AutoDownload.scpt.
The AppleScript AutoDownload.scpt(download it) does the following:
- Get the content of the message body and set that as the URL for downloading
- Tell Safari to open the URL, which causes Safari to beginng downloading to the downloads folder I have specified in the settings

You can see the specifics of this process in the script itself. I created a folder called "Downloads" on the iNAS partition where all the downloads will be stored. I actually tried a more elaborate script and folder structure that used curl, but after several hours of troubleshooting, I gave up and took this approach with Safari. It has several benefits. The first is that Safari uses those placeholder files while it is downloading, so it is very easy to see by checking the folder whether a file is done or not. Also, it is easy to verify a link before mailing it to the Cube to be sure it will work when the script catches it.
The only real disadvantage to this approach is that you will occasionally come across servers that are not configured properly and will give you a window of garbled text instead of downloading to a file unless you Ctrl-click the link and choose "Download Linked File As...". Again, this can be verified before mailing the URL.
Aside from this one caveat, this setup is pretty cool and when I want to let the Cube handle a download for me, all I have to do is send it an email with the special subject line and the link to the download file, and trust that it will be waiting for me when I return home. This is especially good if you often browse the internet from a mobile device. When you see a download you want, just send a link in an email instead of having to remember to do it later when you are at your real computer.
Feature 2: Public IP Reporting
Now that I have a decently powerful computer running as my NAS, why limit myself to accessing stuff from
the local network? It will often happen that I end up needing a file from the NAS while I am away from home.
Yes, I could pay for a static IP, but why give the telco monopoly more money to crush competition with?
I could get a Dynamic DNS hostname, but this will require setup in my router and may not be reliable depending
on the way my ISP rotates IP addresses. What to do? Once again, AppleScript to the rescue.
I create another Mail rule to look for a custom Subject line and run my SendIP.scpt (download it) when it receives a message that matches. [Be aware that there are several places in the script you need to edit before using it yourself] This script will do a shell script which uses curl to get the page from ipchicken.com (which reports your IP) and pipe the result into the grep command with a search for 'size="5"' and an option to get 1 additional line after the matching one. This is the only reliable info in the source of the page at this point without using some perl scripts, so I decided to keep it easy. If they change their source, I'll have to go and change the grep command, but for now it works. This final result gets set to a variable, which becomes the body of a new message. The new message is then sent out to one of my email addresses.
Whenever I need to get into my home network, I just send an email to the Cube with my custom subject and wait for the reply so I know which IP to use. This has a several minute delay, but saves me the cost of a static IP and the headache of dealing with Dynamic DNS services. I should also note that you technically do not need to run the curl against ipchicken.com to get your IP and put it in the body because the headers of the email will have the IP in them and you can view them by selecting an option in the Mail menus. Using my script does save you a few extra clicks, though. Obviously, accessing your network requires that you have already configured a DMZ Host or Port Forwarding in your home router. I will not cover that as directions can be found all over the internet if you do not know how to do it yet.
Feature 3: Impending Doom Notice
It would be nice to know when all our work is in danger of going down the tubes, so it is a good idea to head
over to MacUpdate and download SMARTReporter.
In case you are unfamiliar with this tool, it is a simple app that you can configure to check the SMART status on
your drives at a recurring interval. It can be configured to give you various warnings if the SMART status reports
any problems. I set it up to start automatically at boot, to check the drive every 12 hours, and to send me an
email if there are errors. Just be sure you click "Send" when configuring the mail settings and check to be
sure the test message came through. Again, this is a headless server, so running SMARTReporter will be pointless
if it is unable to send an email when there are problems.
Additional Ideas 1: iTunes Server
I do not need this with my setup, but since the NAS now has a backup of my iTunes Library, it could
also be configured to use that library in its own iTunes and share that to the network. In a case where the
computer in the entertainment center was running over wireless, it would be much preferable to share this stuff
from the Cube over a wired LAN connection. The only technical part to this would be insuring that iTunes is not
running while the backup updates the iTunes Lirary. The easiset way to do this would be to write AppleScripts
to quit and open iTunes, and schedule these to run before and after the backup using
Cronnix or iCal.
Even more useful, if you use Tiger for your NAS's operating system, you could install MyTunesRSS and share the library in a way that allows other computers or devices to access it through the web browser. Just be aware that this works best if your iTunes Library is in the mp3 format (especially if accessing it from a Wii).
Additional Ideas 2: Print Server
This is another feature I do not need, but I get a lot of help requests from people wanting to share a printer on
their network. With the Cube set up the way it is, there is 1 avaliable USB port. So, you could easily install a
printer then go into the Sharing section of System Preferences and enable Printer Sharing. If you would want to
access it from Windows machines, remember to enable Windows Sharing.
Additional Ideas 3: Massive Storage
If one large internal drive is not enough for you and if you do not mind destroying the minimalist motif we have
going here, there are 2 Firewire ports on the Cube so you could add several terabytes of additional fast storage if
you really have that much to backup.
Additional Ideas 4: Web Server
For a simple place to host internal web sites, just open up System Preferences, go to Sharing, enable the Web Server,
and copy your site (yes, php is supported by default) over to /Library/WebServer/Documents/ on the Cube.
Additional Ideas 5: Video Surveillance
With a Firewire camera, or a USB camera with the macam driver,
and SecuritySpy you can set up video surveillance
with time-lape or motion detection so you can find out who keeps stealing your Lucky Charms.
Closing Thoughts
As you can see, using a Mac as the basis for a NAS is much better than using an off-the-shelf product due to the
flexibility. Having a real computer allows you to do so many cool things that simply are not possible otherwise.
Steve Jobs' beloved Cube is great for this as it is compact, cheap on the used market, and a pleasing addition to
the decor of your office or entertainment center. As you can see in the pictures below, the Cube is such a nice piece
of decor that it stands out as a contrast in my office full of junk! :) Perhaps it can serve an additional purpose
of inspiring me to clean up.
This same project could also be done with a Mac mini and a MiniStack, or even a full-blown desktop PowerMac if you do not mind the noise and additional wasted space. As I mentioned in the intro, though, this tutorial was really intended to inspire Cube owners to keep their beloved machines out of retirement for a little while longer. So, spread the word... Save the Cubes!
Final Glamour Shots
My Cube in its happy home. Click image for larger version.
Only 3 cables! This would bring a tear to Steve Jobs' eyes. Click image for larger version.
The rules say 5 images of the final product, but noone wants to see 5 pics of a standard Cube. Since this is really
a software mod anyway, here are 3 of the final interface for the Cube.
Here's what my happy little Cube is up to most of the time.
Here are my Login Items... don't forget a VNC server before making this headless!
Here I am connected to it from another machine looking at the Download folder. Notice the Safari download file
which indicates that my Kubntu ISO is not done downloading yet. This is the cool part of using Safari as the
autodownloader. Using any other means, I'd have to keep checking the file size to see when it stopped going up to
know for sure that it was finished.
This mod submitted by:
Todd Russell