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

 

 

5 Comments »

RSS feed for comments on this post. TrackBack URI

  1. THanks so much for this ‘how-to’, just what I want/need as I attempt to set up my very first NAS using Ubuntu on the HP Proliant MicroServer. The detailed instructions are especially welcome and valued. Thanks from Sheffield, England. Graham.

  2. Thanks for this easy-to-do configuration. However I got an error in one step.
    I did a clean install of everything, as you indicated at every step. The system hdd is on the internal USB. And installed Ubuntu Server 16.04 TLS.
    I only have two HDD on bays 1 and 2.
    The problem comes configuring ZFS:
    $sudo zfs create tank/home
    Ok.
    $sudo zfs set mountpoint=/home tank/home
    I get some kind of warning saying the directory is not empty but the command may have worked.
    $sudo zfs set compression=on tank/home
    Ok.
    $sudo zfs mount -a
    I get an error: cannot mount ‘/home’: directory is not empty.

    I’ve read quite a bit of this error on forums but I can’t solve it and since I followed your how-to, can’t understand what went wrong. I’d appreciate some advice. Thanks from Catalonia.

  3. Thanks for this how to, much appreciated.

    Everything seems to be setup ok but I get this error:

    sudo zfs mount -a
    cannot mount ‘/home’: directory is not empty

    I’m setting this up on Ubuntu Server 18.04 (Clean install), with a root partition “/” and a home partition “/home” on a SSD drive on bay 1 instead of the internal usb port, on the HP Gen8 server.

    I’m not an expert on this so any help appreciated. Following your how to I assumed that my zfs pool would be mounted in my home directory. It is instead mounted at top level.

    Many thanks for your time again.

    Cheers

    • You probably have a home directory already created in /home from when you first installed Ubuntu. All you need to do is delete whatever’s in /home and try the mount again. Or, you could move /home to, say, /home2 (“mv /home /home2”) and either create a new /home or use the zfs tool to create it automatically, e.g. “zfs set mountpoint=/home tank/home”

      • Hey,
        Thanks a lot, I’ll give it a try 🙂


Leave a comment

Blog at WordPress.com.
Entries and comments feeds.