It will not be about AI this time, neither will it be about Sci-fi. It will actually be exactly about what the title indicates. So let's begin.
Since a certain incident in the late 90's involving a 850MB drive I'm quite paranoid about having backup. For many years this paranoia was satisfied with Apple Time Capsule - a handy device that acts as a wifi/router and a network attached storage, which through afp protocol offers time machine service to Mac computers. I have one back in Poland and I had one here in California, until one day in January 2017 all of a sudden the device died. I had this device since 2010 so it served me well for quite a few years (I upgraded the drive to a 3TB in the meanwhile), but still the death was surprising and disappointing.
But what was even more disappointing, was to see the current Apple's offering in that segment. As mentioned I bough my (back then 1.5TB) capsule in 2010, now it is 2017 and Apple offers... a 2TB Capsule for $299 and a 3TB Capsule for $399. This is ridiculous!
Ultimately, I decided to build one myself, and I'm very happy about this decision, even though I may have payed a little more for that (but I also achieved a much better functionality).
Here is what I had before:
- 2.4GHz and 5Ghz 802.11n network (300Mbps)
- guest network
- 3TB backup storage
- 2TB drive attached through capsule USB port
- printer connected through ethernet
- several devices on wifi
- port forwarding for one device
In my quest I wanted to (at least) be able to recover these functions and possibly add more.
I decided to base my solution on a Linux micro PC. I don't need much horsepower, but I need several fast USB 3.0 ports (that excludes raspberry Pi on the start). I ended up getting Intel NUC NUC5CPYH. At the time I was order it was available on Amazon for $124. This kit however needs some memory and a 2.5" disk. I got 8GB SODIMM for $53 (probably an overkill, but meh). I actually had an 480GB SSD laying around so I used that for the system drive, otherwise one has to add say ~$130 to these considerations. This model of NUC does come with a dual band Wifi, which actually works very well under Linux (I'm using Ubuntu 16.04), but it does not support multiple SSID's so I would not be able to have a guest network. On top of that, it can only enable either 2.4GHz or 5GHz radio at a time. Therefore I needed an access point. I got the Edimax BR-6478AC V2 New AC1200, at the time I ordered it was on amazon for $52. It's a nice device with a few Gigabit ports, dual band 802.11ac radio (up to 870Mbps), multiple SSID and VLAN support (in Access Point mode). To glue all that together I needed an ethernet switch. I purchased NETGEAR ProSAFE GS105Ev2 5-Port Gigabit Web Managed (Plus) Switch for $35. The managed version has VLAN support which I need for separation of the guest network as well as for my main WAN interface. To complete the setup I needed an extra USB 3.0 hard drive case so I got two atolla Lay-Flat SATA to USB 3.0 HDD Enclosures, the time I got them they were $20.88 each. In addition to all that I actually decided to upgrade my backup drive to 6TB, to do so I got WD 6TB My Book Desktop External Hard Drive - USB 3.0 - WDBFJK0060HBK-NESN for $184.99. The case has a 6TB WD Green disk inside and was the cheapest way to get such storage. BEWARE, WD My Book drives are hardware encrypted even if you don't setup a password on them. When the control board dies, so does your data, even if the drive itself is fine. I find WD policy on that completely non transparent and unacceptable, therefore I gutted the drive out of the enclosure and put it into one of the USB 3.0 cases. In addition I got myself a cable crimper to make my setup tidy.
Now that all the pieces are in place, they need to be connected. I went with the following setup:
- Intel NUC is plugged through 1GBps ethernet port to the switch. The connection carries several vlans - the base untagged vlan will be my home network broadcast by the wireless. The second vlan will be tagged connection to the AT&T router. The third vlan will be the isolated guest network.
- The switch takes the above vlan configuration on port 5. It then carries over the man lan and guest vlan to port 4 where the access point is connected. The AP is configured to offer my LAN on its primary SSID (both on 2.4GHz and 5 GHz) and guest network as a secondary SSID on 2.4GHz. Both SSID sit on the same channel which limits the RF congestion (which is already pretty bad in my area).
- The switch then carries over the outside internet vlan to port 1 where it is untagged. That is where the cable provider router connects.
- Port 3 of the switch offers the untagged LAN to the printer.
The NUC will act as a router, firewall and service provider and get all three networks on a single physical interface.
6TB and old 3TB drives are connected to the NUC via USB 3.0. This solution is decently fast (5Gbps), since the fastest I can get to them over Wifi is 870Mbps. This is on par with the most recent Time Capsule from Apple. The Apple file protocol itself is provided by netatalk service, version >3 can emulate Time Capsule, but more on that in the next post. NUC offers 4x USB 3.0 ports so there is a lot of room for expanding the storage as well.
One important consideration for me is noise, since all this junk actually sits in a box in my bedroom. NUC is relatively quiet and actually has BIOS settings that control the fan. There is a temperature sensor and ability to create a policy that sets the fan RPM as a function of the temperature. However, even though I updated to the latest BIOS this setup did not work very well, under stress the NUC would heat up and then hit the max RPM on the fan which was actually quite loud. Instead I decided to keep the fan RPM fixed at ~1500 RPM. This cools the machine enough (in my home ambient temperature at least) and even under serious stress the board temperature never exceeds 70 deg Celsius (I recommend verifying if these settings work for your conditions if you decide to clone my setup). In this configuration the entire setup is practically silent.
- NUC $124
- RAM $53
- SSD $130 (I did not need one)
- Access point $52
- Switch $35
- 2x USB3.0 cases $41.6
- 6TB drive $185
Total $620.6. Since I did not need the SSD I ended up paying $490. Only a bit more than Apple's 3TB Capsule for $399, but this thing is 6TB to begin with, offers everything the Capsule does and is actually a full blown Linux computer with all the goodies of that. In my next post I will go over the config files and how to set this beast up. It's not really very difficult to anybody with sysadmin experience, but there are a few tricky parts for beginners. Bottom line, everything works like a charm, macs do backup, share files, guest network is available and isolated.
Below several pictures of my setup.
Everything seen from the top along with the power strip and a UPS.
The NUC with switch on top.
My deceased Time Capsule...