Choosing Your Server Hardware

One of the great advantages of the Linux range of operating systems is that there is huge support for even the oldest of computers. While this is an often touted feature, the fact is though that for a server to act with the speed and response you would expect, you do need to use a half decent machine, with sufficient compute (CPU) and memory. Any half decent desktop (or laptop) from the last few years will do, once you pay attention to its memory and hard drive needs.

The machine I had available when I built my home server was an old Dell Optiplex 390. This was a budget desktop model with a 64-bit dual-core i3 3.3GHz CPU and 4Gb of RAM, definitely not a server-grade machine. I upgraded this to 8Gb and got a 1Tb hard drive. This has performed perfectly for the past few years, but for one small issue, covered below.

The server we are building is going to be headless, that is you won’t be logging onto it using a mouse, keyboard and screen very often. This means you can pack it away in a press, or up in the attic once the OS is installed, and your interactions with it will be over the network, using either a command line terminal to securely log in (SSH) or using a web browser from your laptop or phone. The only connections you will need to it are power and a network cable.

Disk Drives

True data centre servers are models of redundancy. In case of failure, they have duplicate power supplies, duplicate CPUs and duplicate memory banks. While this is overkill for the server we are building, the most common unit to fail in a computer is the hard drive. Having, and relying upon, a single hard drive in your server is something you want to avoid wherever possible. As the saying goes, ‘Two is one, and one is none…’

Google released a very interesting study back in 2007 of their analysis of hard drive failures across the hundreds of thousands of hard drives they use in their data centres. To broadly sum it up, they found that the Average Failure Rate for drives increases sharply after two years, and that SMART (Self Monitoring, Analysis and Reporting Technology) is almost useless in predicting the failure of a drive. Your data, indeed your whole server, relies on your disk drive staying alive, so placing all your trust in only one device is not a good place to be in.

Unfortunately, I learned of all of this only after I had set up and was running my own server, so this is something that is high on my to-do list to rectify. So what can be done? If the computer you are using only has physical space for one hard drive, you could look to replace the DVD/CD drive with a 2.5” hard drive caddy. These allow you to fit a 2.5” laptop disk drive into the space where your DVD drive would go. You get a nice panel for the front of it, so in looking at it, the front looks exactly the same. Then you want to enable RAID.

Stick em up, this is a RAID…

RAID (Redundant Array of Inexpensive Disks) is a technology which allows you to configure multiple drives to work together. RAID1, or disk mirroring, is most relevant for our server. In RAID1, you have two disks of equal size, and the server writes data to both as it goes. That way if (when!) you experience a drive failure, you do not suffer total data loss, allowing you time to replace the faulty disk and rebuild the RAID array.

There are hardware RAID controllers available for as little as €30 on eBay, or you can enable software RAID when installing your operating system

SpinRite

Another tool that you can use to prolong the life of your disk drive is GRC’s SpinRite. When you boot into this program, from a CD or USB, it runs a scan across your disk drives for defective clusters and sectors. If it finds any, which could cause disk corruption or a drive failure, it prompts the hard disk controller to move the data to another sector and mark this one as unusable. A Read Only scan is recommended for Solid State Drives (SSDs), to prolong their lifespan, while for Hard Disk Drives (HDDs) you can run a Read Only or a Read-Write scan, in which every bit on the drive is read, rewritten (flipped from 1 to 0, or 0 to 1) and then rewritten again (flipped back to a 1 or a 0). This ensures your HDD is reading and writing correctly and any defects are registered and swapped out.

Steve Gibson goes into much more detail on the health checks and work SpinRite does on your drives at his site GRC.com, as well as producing the excellent SecurityNow! podcast for everything Computer Security related.