Installing an HP ProLiant Gen8 G1610T MicroServer as an Ubuntu Linux ZFS NAS Server

Friday 24th March, 2017 at 18:08 | Posted in Uncategorized | 5 Comments

The HP ProLiant Gen8 G1610T MicroServer is a very compact and well made x86 server that is ideal as the hardware for a Network Attached Storage server and Linux host.  It has several very desirable features:

  • It is very compact (about a 1 foot cube)
  • It has 4x externally accessible disk bays with their own disk caddies
  • It has 2x usable Gigabit Ethernet (1000/100/10 Base-T) ports
  • It has an internal USB socket from which it can be booted via USB-Stick

The machine is also very cost competitive even though it contains a lot of ‘value add’ features that you won’t be using in the configuration described here (i.e. the one I use).

Configuration Summary

For those of you familiar with installing Linux systems here is the headline configuration; I will go into details further below.

  • Install Ubuntu Server 16 on a USB stick (I used a 32GB Kingston DataTraveller USB3 G3) inserted into the internal USB Boot socket
  • Place 4x WD Red 3TB 3.5″ SATA NAS Hard Drives into the external drive bays
  • Bond both Gbit NICs into a single network (using mode 6)
  • Create a single ZFS pool comprising all 4x HDD in a RAID-Z configuration (effectively consumes the equivalent of one whole HDD to provide protection against the failure of any one of the four disks in the array without data loss).  Note that you can’t use the ‘so-called’ integrated RAID controller in the HP server as this is really a software RAID controller with a dedicated driver for Windows provided by HP.  Just ignore it completely and all will be well.
  • Configure NFS, SAMBA3 (CIFS), AFP, HTTP, etc.  Note that you can use iSCSI too but the ZFS implementation in Ubuntu 16 does not support native iSCSI so you will have to configure an iSCSI target yourself.

Considerations

Ubuntu is a truly free to use Linux OS.  It comes in two flavours; desktop and server.  We want to use the server version.  Ubuntu Server is a very high quality and stable OS and this is provided in two further flavours, one of which is called the LTS version.  If you plan to just install this system and leave it running without change then LTS is a very good choice as it will be the most stable and consistent OS.  Ubuntu Server 16 comes with ZFS, which is a well proven scalable filesystem with lots of flexibility and built in data integrity features. The reason to use ZFS rather than the very similar BTRFS in this instance is that ZFS supports RAID configurations natively; BTRFS only supports disk mirrors at time of writing (also known as RAID1 or RAID10) which consumes too much of our available storage capacity in this implementation (we only have 4x disks so it’s better to use ZFS and only lose 1x HDD capacity compared to using BTRFS and losing 2x HDD capacity for same result).

The 4x external drive bays will support a large number of types and sizes of disks.  The official HP documentation indicates that only HP drives are supported but in fact, any standard HDD will work just fine.  If you plan to build this machine as a NAS then you will typically leave this system powered on and functioning permanently, which means you want both efficient and reliable disks.  Even though the ultra-fast and/or mega-capacity desktop drives will fit and work in this system they are not the best choice; they may get very hot, they may vibrate and they may consume lots of power, any one of which is likely to shorten their lives – especially when they are all plugged in and running along side each other.  Luckily there is a class of disk drives provided by manufactures that lend themselves perfectly to this task and they even label them appropriately; NAS.  These tend to be a little more expensive and a little slower than their desktop cousins but they are vastly more reliable when purchased from known vendors.  I have used WD drives for many years with good results.

The machine comes with an ILOM capability but this is effectively useless in this configuration – it’s really mean for people running Windows.  I have the NIC to the ILOM plugged in to my network but I’ve never found a use for it.

To make best use of this system as a NAS you should have a Gbit Network Switch.  If you have a managed switch (in other words, one you can configure) then turn on jumbo frames (MTU 9000).

Installing Ubuntu Server 16

The HP server does not come with an optical drive (or, in fact, any drive at all) but it does have the bay to install one.  I chose not to install one so in order to install the OS I did the following:

  • Download the Ubuntu installation ISO
  • Copy the exact contents of this ISO onto a bootable USB stick, making sure it has at last 8GB space (you will need 2x USB sticks to perform this type of installation) If you are using Linux or OSX then just use ‘dd’ as in;
  • $sudo dd if=~/Downloads/ubuntu-16.10-server-amd64.iso of=/dev/disk2
  • Open the HP server, locate the internal USB socket (it’s on the far left edge of the motherboard beside the disk connector cables) and insert your high quality USB stick (use at least 32GB and as high quality as you can afford – this will be your boot disk so you don’t want it to fail; speed is not too important but nice to have).  If you are reusing this USB stick then make sure it is erased and unbootable (just reformat it).
  • Install all your HDD drives in their bays and insert them into the chassis.
  • Close up your case and insert the Ubuntu installation USB disk you just created above into the top USB socket on the front of the server (doesn’t really matter which socket but that’s as good as any).
  • Power on your machine and as set the machine to boot from USB in the BIOS.  Keep this as the permanent setting.
  • When the Ubuntu 16 Server installation starts, choose the internal USB disk as the target ( you will see that 4 disks are the same so don’t choose any of those – if both your USB disks are the same size and you pick the wrong one it just won’t install, so just pick the other one).  When the installation tells you to reboot the system, remove the USB from the external slot and reboot.
  • Your machine will boot into a brand new Ubuntu 16 Server OS ready for you to configure.

Configuring Your Storage

We’re going to use ZFS in a RAID array to provide protected storage with least loss of capacity.  We want protected storage as we’re going to have such a large capacity that we won’t want to loose whatever we have stored on there if a disk drive fails.

First we need to install the ZFS tools to allow us to configure it:

$sudo apt-get install zfsutils-linux

Then we need to get the labels for the disk drives in our array:

$ls /dev/disk/by-id

Note down the 4x similar labels and use them to create your ZFS pool as a RAID-Z array:

$sudo zpool create -f tank raidz1 wwn-0x50014ee20d932c9e wwn-0x50014ee262e86b74 wwn-0x50014ee262e86cc6 wwn-0x50014ee2b83e245a

Create our first ZFS volume for our home directories and set the permanent mount point:

$sudo zfs create tank/home
$sudo zfs set mountpoint=/home tank/home

Turn on compression for this volume and then mount it (it will be auto mounted from hereon)

$sudo zfs set compression=on tank/home
$sudo zfs mount -a

We can check the features of the volume by:

$sudo zfs get all tank/home

If you want to create a NAS volume to use for TimeMachine backups for Macs and confine how much of your NAS it can consume you can set up a volume thus:

$sudo su –
#zfs create tank/timemachine
#zfs set mountpoint=/export/timemachine tank/timemachine
#zfs set quota=2tb tank/timemachine
#zfs set compression=lz4 tank/timemachine
#zfs mount -a

 

Configure Your Networking

We’re going to use a bonded network connection using both the Gbit NICs so that we get maximum bandwidth and continuous operation even if we have a problem with the cables (which is the most likely issue to be faced by this system).

$sudo apt-get install bridge-utils ifenslave

Edit your network interfaces configuration by editing /etc/network/interfaces to look similar to the following but use your IP addresss:

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto bond0
iface bond0 inet manual
bond-miimon 100
post-up ifenslave bond0 eno1 eno2
pre-down ifenslave -d bond0 eno1 eno2
bond-slaves eno1 eno2
bond-mode 6
bond-downdelay 0
bond-updelay 0
mtu 9000

auto eno1
iface eno1 inet manual
bond-master bond0
mtu 9000

auto eno2
iface eno2 inet manual
bond-master bond0
mtu 9000

auto br0
iface br0 inet static
address 192.168.3.2
netmask 255.255.255.0
network 192.168.3.0
broadcast 192.168.3.255
gateway 192.168.3.1
dns-nameservers 192.168.3.1
bridge_ports bond0
bridge_stp off
bridge_fd 9
bridge_hello 2
bridge_maxage 12
dns-domain my-domain.com
# dns-* options are implemented by the resolvconf package, if installed

A breakdown of the file’s settings follows:

Jumbo Frames

mtu 9000

…enables jumbo frame support for better network throughput and lower CPU usage but only works if you have a managed switch with jumbo frame support enabled.  If you don’t have a switch that supports jumbo frames then delete the mtu 9000 lines from your file.

IP Address

address 192.168.3.2

…this is the IP address you assign the server on your network – your home broadband router is likely to default to the 192.168.0.0 local network range.  You will need to be able to change the network and set the range of DHCP addresses it gives out to exclude the ones you want to permanently set in your network

DNS Server

dns-nameservers 192.168.3.1

…this will typically be your home router’s IP address but can be any DNS server.

Now is also a good time to name our new server.  We can do this simply by entering the name into the file /etc/hostname: (here we’ve called our new server “filer”)

$sudo echo “filer” > /etc/hostname

Restart your networking to get your settings working:

$sudo systemctl restart networking
$sudo systemctl status networking

Configure NFS

Perhaps the most useful network storage facility is NFS, although this is unlikely to be used by common Windows or Mac users who are much more likely to use SAMBA3 or AFP (see below).

Linux users should be familiar with NFS but for completeness here is how to install it on Ubuntu Server 16:

$sudo atp install nfs-kernel-server

Once you have it installed you can use the native NFS export functions in ZFS to automatically export your volumes.

$sudo zfs set sharenfs=on tank/home

and then add this line to your /etc/exports file:

/home (rw)

And run the command:

$sudo zfs set sharesmb=on tank/home

Configure AFP

AFS is provided by the open source netatalk project.  You will need to download the source code and compile the package if you want to use it on your Ubuntu server.  I used version 3.1.10 which I configured, compiled and installed using:

$sudo su –
#cd netatalk-3.1.10/
#./configure –with-init-style=debian-systemd –without-libevent \ –without-tdb –with-cracklib –enable-krbV-uam \        –with-pam-confdir=/etc/pam.d \        –with-dbus-daemon=/usr/bin/dbus-daemon \        –with-dbus-sysconf-dir=/etc/dbus-1/system.d \       –with-tracker-pkgconfig-version=1.0
#make
#make install

Once you have built and installed netatalk you need to configure it for your environment by editing “/usr/local/etc/afp.conf”.  An example configuration is here.

/usr/local/etc/afp.conf

;
; Netatalk 3.x configuration file
;

[Global]
; Global server settings
spotlight = yes

; [Homes]
basedir regex = /home

; [My AFP Volume]
; path = /path/to/volume

[My Time Machine Volume]
path = /export/timemachine
time machine = yes
spotlight = no

[micky]
valid users = “Micky Mouse” micky
path = /home/wayne
search db = yes
[Media]
search db = yes
path = /export/media
valid users = “Micky Mouse” micky
[Software]
valid users = “Micky Mouse” micky
path = /export/software
search db = yes
[Public]
file perm = 0555
unix priv = yes
valid users = “@Micky Mouse” @micky @macuser
rwlist = “@Micky Mouse” @micky
path = /var/www/html/Public

Start your AFP service:

$sudo systemctl start netatalk

You will also want to publish these services so that your Macs can find them on the network automatically.  We do this by installing AVAHI (known as Bonjour by Apple).

Configuring AVAHI (Zero Conf Networking|Bonjour)

Install the AVAHI service and tools:

$sudo apt-get install avahi-daemon avahi-discover avahi-utils libnss-mdns mdns-scan

Create the following file to advertise our AFP services to Apple devices:

/etc/avahi/services/afpd.service

<?xml version=”1.0″ standalone=’no’?><!–*-nxml-*–>
<!DOCTYPE service-group SYSTEM “avahi-service.dtd”>
<service-group>
<name replace-wildcards=”yes”>%h</name>
<service>
<type>_afpovertcp._tcp</type>
<port>548</port>
</service>
</service-group>

Another very useful service to advertise is ssh, which means that you can log into the system across the network without knowing the IP address you have set it by just referring to it as “server.local”, where server is the hostname you have given your Ubuntu Server.  (You can set the hostname by just putting it in the file /etc/hostname).

/etc/avahi/services/ssh.service

<?xml version=”1.0″ standalone=’no’?><!–*-nxml-*–>
<!DOCTYPE service-group SYSTEM “avahi-service.dtd”>

<!–
This file is part of avahi.

avahi is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.

avahi is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.

You should have received a copy of the GNU Lesser General Public
License along with avahi; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
–>

<!– See avahi.service(5) for more information about this configuration file –>

<service-group>

<name replace-wildcards=”yes”>%h</name>

<service>
<type>_ssh._tcp</type>
<port>22</port>
</service>

</service-group>

Finally we need to start the service that make this work:

$sudo systemctl start avahi-daemon

 

 

TomTom must have worst customer service in history

Monday 16th August, 2010 at 18:12 | Posted in Uncategorized | Leave a comment

Wow.  So I just updated my TomTom and all the live services stopped working; gives an error.  TomTom Home says nothing, so on impulse I got to TomTom.com and click on the support tab, where a little box finally says click here if you have that error.  Clicking on it says they know your device will be broken and to downgrade.  Which leads to the question: “If you knew it would break it, why the hell did you automatically install it when it performed the routine update?”

TomTom quality control is closely matched by its customer service level – the worst I have ever experienced. Ever.

Hack iPhone 3G SIM to work in iPhone4

Thursday 24th June, 2010 at 11:47 | Posted in iPhone | 1 Comment

I’ve used the method highlighted in this article with both O2 and Vodafone SIMs that worked in my iPhone 3G and they both work fine in my iPhone4.

http://www.macnotes.net/2010/06/21/cut-your-micro-sim-for-iphone-4-and-ipad-3g-stencil-and-scissors-solution/

W

Difference between a VM clone and a VM Template?

Wednesday 24th February, 2010 at 18:51 | Posted in Uncategorized | 4 Comments

There is a bit of confusion in the virtualisation space between two common technologies; VM Cloning and VM Templates.  An example of this confusion is in SearchServerVirtualization.com’s new Virtualisation Explained glossary.

In fact, they are not the same thing at all and serve two very different purposes.

A VM Clone is, as SearchServerVirtualization.com says, an exact copy of a VM at a specific moment in time, although this is usually a non-running VM (a clone of a running VM is called a snapshot).  VM Clones are excellent tools for working in test and development environments where one wants to examine or work with exact copies of test systems in multiple but isolated environments.  VM Clones are not at all suited to mass deployment of VMs, however, for the simple reason that each of these VMs would be identical, with identical hostnames and IP addresses and perhaps OS specific values such as UUID or System IDs, that would render them inoperable when deployed together on the same network and causing huge problems even when deployed on separate networks.

VM Templates are copies of pre-installed VMs containing all the software and configuration settings that would make the VM work when deployed but without any uniquely identifying configuration settings such as hostname and IP address.  This is essential, so that when new VMs are deployed in the environment from these VM Templates they automatically configure themselves, taking and applying new values for all unique identifiers the first time they are started up.  VM Templates are then, the only suitable mechanism for mass deployment of standardised VMs.

This could be summarised as:

  • VM Clones are for use in test and development.
  • VM Templates are for use in production.

W

Check your iPhone’s current signal strength

Monday 18th January, 2010 at 11:04 | Posted in iPhone | Leave a comment

Since moving from O2 to Vodafone on my iPhone (not out of choice) I found that my iPhone runs out of juice very quickly.  I also noticed that it is almost constantly “searching” for a signal, which jumps from no bars to 5 bars in the space of seconds, although I do have 3G coverage on the little signal I seem to get. On O2 I had a solid 5 bars but no 3G coverage at all.  I switched off 3G to see if I get better signal/battery life, which I do seem to.  It now shows pretty steady 3 bars.

To really check the signal strength your iPhone is getting, call *3001#12345#* – this will actually bring up a hidden app, Field Test.  In the top left-hand corner, the signal bars of the iPhone will now show a negative number, the nearer the number is to zero the better (i.e. -50 is better than -100).  Mine is -89 on Vodafone, but -69 on O2 from the same place.  This isn’t much but it does seem to make a difference.  The really interesting thing is that, when I switch 3G back on, my Vodafone signal strength goes to -107!

Clearly, enabling 3G where I live is killing my Vodafone signal and draining my battery so if you are having low signal strength and short battery life on Vodafone (or any other network I suspect) switching off 3G may improve things a lot for you too.

W

Hello world!

Tuesday 5th January, 2010 at 16:48 | Posted in Uncategorized | Leave a comment

Yes, this is my first post on my new blog…   blah…blah…blah…

OK, for anyone still reading this, my name is Wayne Lewis and I’m a computer systems professional working and specialising in the virtualisation and operating system arena.  For those who think may know me – yes, I am that Wayne Lewis 🙂

I’ve decided to start this blog to share some of the things I’ve learned with anyone who may find them interesting or useful.  I turn to Google all the time to help me with tricky problems and it often takes quite a while to piece together all the info I need to solve them – I will post solutions to those things here.

I work for a large software vendor and I’ve been in the operating system and virtualisation business for over a decade (well, technically, exactly a decade in the case of virtualisation at time of posting, but quite a bit longer in operating systems).  I work with UNIX, Linux, Mac OS, Windows, VMware, Xen, Oracle VM, Parallels and others on a daily basis so I’m pretty familiar with all of them.  I’ve worked with vendors of all those systems and I’ve even worked for some of those vendors on the hardware and software side.  I hope this gives me a fair and open view of each of those technologies thus allowing me something of a nonpartisan stance when discussing them; of course, I have my favourites, who doesn’t?  But I hope that I can give considered opinion where I do express one.

Here endeth my first blog entry.

W

Create a free website or blog at WordPress.com.
Entries and comments feeds.