Wednesday 11 March 2020

Argon 1 Review



Recently I setup my own NAS server using a Raspberry Pi 4. So far it has been working nicely, however one thing that has been annoying me is the case.

When I chose the pi 4 (USB 3.0, better performance, etc) I was worried that it would suffer heat issues, since it ran a lot hotter than the Pi 3. Therefore i decided to buy a case which could include a fan. However at the time, Pi4 cases were not common, and the case I chose, although cheap, was not ideal.

The case had a fan which could be included in the case and ran continually. Unfortunately only after a few month the fan now creates an annoying rattle, which the more i hear it, the more it becomes annoying, to the point I have had to disconnect the fan.

Although it has turned out the Pi4 in this application runs less hot than I was expecting, I still wanted some head room, in case I added extra functions which increased performance requirements. Therefore I decided to look for another case. This is where I came across the Argon 1 review. Compared to most Pi cases, this looked robust and neat. Best of all it provided a power button and fan control out of the box, plus a heat sink for both the CPU and memory.

Yes it was a tad expensive, but I decided to go for it. I actually struggled to source one, and had to get it from Germany in the end.

The review


The box itself is actually quite small. The upper part is metal, and feels very sturdy, while the bottom is black plastic. It comes with vert clear documentation on installation and configuration.

The clever part is a small daughter board that plugs into the audio jack and 2 HMI ports and brings out to the front of the case. The USB-C is also brought out, meaning all the interfaces are at the front of the case in a neat package. The Pi itself is inserted into a GPIO pin female socket which presumably connects to the external USB-C slot. A fan is included in the top of the case, put is only turned on when a certain temperature is reached. Initial installation was quite quick, the trickiest part was lining up the  GPIO pins, and it requires a bit of a shove to get it all in. It was only when I had put the Pi, I discovered the cases neatest trick.

Neat Easter Egg


 A panel can be removed from the top of the case, held by two magnetic catches that provide total access to the GPIO pins, which is really neat touch.

Problems, Problems


However it wasn't total plain sailing. It was only when I re-installed the Pi on the NAS server I discovered a a number of issues. My 1st problem was installing the SD card. The case provides a slot in the back, but you can only install the card once the bottom of the case was on. However there is enough of a gap between the SD slot and the case for the card to slip into the case, requiring you to remove the bottom to access it

My 2nd problem was when i re-installed it on the NAS, it would not turn on.  Actually it was hard to know what it was doing, because I could not work out whether I could see the Pi status LED's or not.

In the end it appeared that the case has slightly higher power requirements that the standard Pi, and since it was being powered via a USB hub, clearly there was not enough. Once the Pi got enough power, I could see you could see the LED's through the translucent cover, but I would of preferred if  they had been brought out of the case via light pipes.

However I would recommend that the case bottom is not screwed in until, you are sure everything is working.

Once sorted, things went smoothly and I am very pleased by both the look and function of the case. If I was looking at creating a General purpose Pi computer, I would definitely choose this box.






Thursday 2 January 2020

Build your own NAS server



One of the banes of modern technology is how to keep your digital information safe.  While modern PC's are quite reliable, often you are only one hardware failure away from losing irreplaceable documents, photos and videos. Therefore it is critical that you have some sort of backup solution.

The solution  will often depend on the size of the files. Documents can often be backed up to the cloud using things like box or google drive, but cloud storage has its own issues and I would nor rely on it. While for small amounts of data it can be cheap and convenient, even with super-fast broadband backing up even moderately large files can be tedious and soon you will find yourself paying yearly subscription fees as your storage requirements increase.

The alternative then is some sort of local backup. I take a lot of photographs, and recently I have been continually hitting the limits of my disk space, which has forced me to continually prune images. It seemed like a good time therefore to look at some sort of storage expansion.

My requirements we as follows

  • Easily accessible - accessible through all our computers and via internet
  • Data Redundancy - loss of one component would not result in loss of data
  • Expandable -i.e. capable of adding extra storage when required
  • Extendable - Add extra features if required
  • Low Power - does not use much energy
  • Cheap - not expensive :) 
Over the year I had tried a number of backup solution. I started with recordable DVD's until I found the shelf life of DVD's was only 2 or 3 years and my data requirements quickly outstripped the amount data I could store. I then moved to flash disks, but that is quite an expensive per MB way of doing it. My current solution is to back up to standalone hard disks. While this is relativity cost effective, they are not very accessible and for that reason backup rarely occur more than evey 6 months, meaning that I am living on a tightrope for the rest

The obvious solution is a NAS box (or network addressed storage). This is a box that can be connected to a Ethernet cable that allows you to transfer data as if it is a hard disk. NAS boxes allow you to have 2, 4 or even more disks in a redundant configuration.

You can get a two bay NAS box for about £130. However you then need to populate it with hard disks, which means, say a 4GB 2 bay NAS box would be about £330. Not terrible, but I felt I could do better

Build your own 

The alternative is to build your own. First possibility is to re-purpose some old PC. Even a relative low power PC with two SATA interfaces will make a perfectly good NAS box. However it will be quite power hungry and noisy

The other option is to use something like the Raspberry Pi. These arevery low power, virtually silent and have good software support. However until recently, the Pi was not a good NAS server device. Firstly Pi's do not have native disk drive interfaces requiring you to connect via USB. However Pi's only supported USB2, which was relatively slow. Worse, it shard the USB bus with the Ethernet, meaning that if you are sending data and writing to disk via USB, it would cause blockages.

However recently the Pi 4 came out. This has a separate Ethernet/USB channel. Even better it supports USB 3. the difference is huge with a 10 fold increase in Ethernet throughput and a 4 fold increase in USB throughput. The Pi 4 now has a huge potential as a NAS server 

A 1 Gb Pi 4 is about £30, so is good value. All we need to do is work out how to add some disk drives and add some software

Adding the disk drives

Without a native SATA interface, you are reliant on USB to connect to a drive. One solution is a USB to SATA interface. One of problems with this however is that you will need a separate power supply to power the disk. I wanted a few power supplies as possible, so I wanted to stay away from this. 

The alternative  is a hard disk in a USB enclosure. A 4TB USB 3.0 portable disk can be powered via USB 3.0 and strangely the price is almost exactly the same as the native disk. One downside is that the disks are likely to be slightly slower, but for the work they were to do, this was not likely to be a major issue.

Another issue is whether a Raspberry Pi would have enough power to drive two USB 3.0 hard drives. It looked marginal, so i added a powered USB 3.0 hub. The hub I chose not only powered the dives but could also power the raspberry Pi and would allow me to add more drives if required in the future. The only downside was that it was a bit larger than I wanted.  

So finally I had my bits together as shown below, saving about £70 over the NAS solution.

Parts list

Raspberry Pi 4 1GB - £35
Fan £10
Pi Case £5
SD Card £10
2 WD USB 3.0 4TB disks £85
Atolla USB 3.0 Hub Powered, 11-Port USB 3.0 Hub £30

Total price £260

(The case and fan may not be needed. The PI 4 runs hotter than the Pi 3, but in this configuration it is not doing much. The fan was just a precaution, while the case was just to tidy things up. )

Getting it working

The next issue was getting it working. Here I had two solutions. Firstly set up the OS myself or install a pre-built package. I just was not in the mood to do the first, so it looked what free packages were available.  It basically came down to either FreeNAS or Open Media Vault(OMV). Both would of been fine, but OMV seemed a little bit more Pi friendly and had lower hardware requirements.

The first thing was to set it up. OMV does not have a complete raspberry Pi distribution. Instead you install the Pi basic distribution and install OMV on top of it. The complete instructions are here

Installation went smoothly,, so the we moved onto the OMV setup guide.

First decision was how to format my drives. I they were to be windows drives we would use NTFS. However linux NTFS support is not as efficient as windows, and because the drives would never be attached directly to the PC, it made sense to use a native Linux format. therefore we formatted them as EXT4 drives.

It was then we hit an issue.

RAID

The original idea was to have my two disks in a RAID configuration. So what is RAID. RAID allows you to group multiple disks in such a way that they look like one logical unit. There are about 6 different ways you can do this, but in practice most people choose 1 of two.

RAID 0 makes multiple disks look like one large disk.
RAID 1 combines 2 disks in such a way that the data written is duplicated or mirrored across both disks

However deep in the setup guide we get this.

RAID+USB= Potential Problems 

Setting up RAID of any type using “USB to drive” connections is discouraged. 

RAID over USB has known problems. The USB interface (there are several flavors) may filter some the characteristics of the drives, fail to pass SMART stat's and ATA drive commands, delay the assembly of a RAID array, etc. While USB may work in some RAID cases, it's not as reliable as using a standard hard drive interface. If RAID of any type is considered to be a requirement, drives should be connected with SATA or SAS ports. If users choose to use RAID over USB connections, it is done at their own risk with the potential for the total loss of stored data. RAID issues involving ARM boards, USB connected hard drives, or USB RAID enclosures are not supported on the forum. 

Basically raid over USB was not fully supported.  I think if I was running OMV this is information that I would put front and center and not hide it mid way through a setup document. Oh, well time for plan B

In these situations it is worth going back to first principles and see if the path you are on is where you want to be.

Clearly I wanted redundancy, but did i need RAID to do that? I chose RAID because that is what most enterprise systems use. However they have multiple users writing loads of files to disk frequently. My box on the other hand will have a few users writing infrequently to disk. In that situation RAID is not so useful and actually adds a unnecessary overhead.

Solution


So whats the alternative. Basically I want to copy files changed on one disk to another one. Linux provides a protocol to do that called RSYNC. It basically checks to see if any files have changed and copies the files to another destination. Fortunately RSYNC is supported by OMV, so I can  ask the Pi to check the main disk every set period and copy changed files to the backup disk. Here is information on how to do that 

This would not be as immediate as RAID and there is  small window where changes may not be copied, but the likelihood of a disk failing during a RSYNC process is very small, and far lower than an issue with RAID affecting both disks.

So with RSYNC setup, I could attach to my PI via a Samba network connection. On my windows PC it looks like a new drive and i can just drop files onto it. Every 12 hours, changes to the main disk are copied to the backup disk.

So after a test and 1TB of data transfer later I have working NAS server!

So did I meet my requirements?

  • Easily accessible -SMB shares mean all computers on the local LAN can access it. Internet access is still to be done. 
  • Data Redundancy - 2 hard drives should provide considerable redundancy
  • Expandable - USB hub allows extra drives to be added
  • Extendable - OMV plugins provide extra feature support
  • Low Power - PI is very low energy
  • Cheap - I think it is about as cheap as I can make it. 
So is building your own worth it?

In terms of effort it was relatively easy, however there were some cons.


  • Lack of decent housing - there just does not seem to be any 2 slot boxes out there of decent size of a Pi. Weird
  • Cost difference not that great - I was hoping for a 50% savings, but in fact the hard drives were the biggest cost. Considering there was no hot swap drives or metal cases involved the cost saving were more modest than I hoped
  • No RAID support - if I knew USB RAID was not supported when I started then I might not of gone down this route. However in hindsight RAID is not as important as I thought
On the plus side 

  • It was cheaper
  • It is more extendable
  • It was more fun

Work to done

Firstly was it worth it? Some may consider thee £70 saving over a regular NAS to be relatively modest, however that ignores that I can easily extend it by adding more or larger disks.

There are also other things I want to do. First I have not tried wireless transfer yet. The ability to add or retrieve via wireless devices would be useful. Secondly I would like to allow internet access. This will be a little more tricky, but the ability to access photos from anywhere would be great. There maybe other things to add in the future as I explore OMV more

Finally, at the moment it consists of 4 devices connected via Velcro. I need a better housing. There really is a market out there for a pi case with two disk slots, because I could not find one. While 3D printing could be an option,   at the moment I am considering  a Tupperware container, wooden box or my old standby , a cardboard box.

Performance