Building a new Microserver


Back in 2011, I bought an HP Proliant Microserver G6 for £250. Last week I upgraded to... A Proliant G8 for £270. Nice! Hurrah for Moore's Law!

Of course, setting it up is a bit of a mare. So here's a tangled mess of notes to hopefully remind me what to do...

Firmware

Download the latest gen8 firmware / BIOS / iLO.

Find a site offering demo licence keys for iLO 4.

Boot Order

I stuck in an SSD on the internal SATA port which is meant to be used for a DVD drive.

The internal RAID has to be set to "Legacy" - see Re: Microserver Gen8 - Boot order from different SATA Drive.

Then the PCI boot order has to be be set to boot #2 first.

BIOS

There's no UEFI. So any USB stick that you format will need to be made with:

sudo dd bs=4M if=Downloads/ubuntu-whatever.iso of=/dev/sda conv=fdatasync status=progress

Or mkusb.

It will take ages from boot until it starts installing.

Install

As per normal. Enable SSH when asked.

Make 2nd Ethernet Port Optional to prevent a slow start

As per StackOverflow.

Edit /etc/netplan/*.yaml and make the 2nd port optional: true

Make sure the root disk is taking up all the available space:

sudo lvextend -l 100%VG ubuntu-vg/ubuntu-lv
fdisk -l /dev/mapper/ubuntu--vg-ubuntu--lv
sudo fdisk -l /dev/mapper/ubuntu--vg-ubuntu--lv
sudo resize2fs /dev/mapper/ubuntu--vg-ubuntu--lv

SMART

Check the HDD quality.

sudo apt install smartmontools
sudo smartctl --all /dev/sda
sudo smartctl --all /dev/sdb
...

ZFS

Install ZFS

sudo apt install zfsutils-linux

Get the list of disks so you can refer to them by ID:

ls -l /dev/disk/by-id/

Create a RAIDZ with somewhat optimal values:

sudo zpool create -O utf8only=on -O normalization=formD -O atime=off -O compression=lz4 -o ashift=12 -O dedup=off -f data raidz  /dev/disk/by-id/ata-... /dev/disk/by-id/ata-... /dev/disk/by-id/ata-... /dev/disk/by-id/ata-...

That gives it UTF8, improved performance by not using access times, no deduplication, sensible block size, and transparent compression.

Check it has worked with:

zfs list

Take ownership of the pool:

sudo chown $(whoami): /data

Check the pool's health:

sudo zpool scrub data
sudo zpool status

Make it chunter a little less with:

sudo nano /etc/modprobe.d/zfs.conf:

And adding the line:

options zfs zfs_txg_timeout=30

Add the following ~/.profile

df -t ext4 -t zfs -Th
zpool status

Read-Only Share

sudo apt install nfs-kernel-server
sudo systemctl start nfs-kernel-server.service
sudo nano /etc/exports

Add:

/data  *(ro,async,root_squash,insecure)

Restart with:

sudo exportfs -a

Make Ubuntu less chatty on login

sudo rm /etc/update-motd.d/88-esm-announce
sudo apt-get purge landscape-client landscape-common
sudo rm /etc/apt/apt.conf.d/20apt-esm-hook.conf
sudo rm /var/lib/ubuntu-advantage/messages/motd-esm-announce
sudo touch /etc/cloud/cloud-init.disabled

Set Up Python's pip

wget https://bootstrap.pypa.io/get-pip.py
python3 get-pip.py

Misc

Set the right timezone:

sudo timedatectl set-timezone Europe/London

Update the certificates

sudo update-ca-certificates

And...?

What else do you install on a new server?


Share this post on…

  • Mastodon
  • Facebook
  • LinkedIn
  • BlueSky
  • Threads
  • Reddit
  • HackerNews
  • Lobsters
  • WhatsApp
  • Telegram

4 thoughts on “Building a new Microserver”

  1. says:

    I enable unattended-upgrades to do my deb-based updates for me in the background. I also enabled esm with pro enable or something, so I get live kernel patches and more security updates than the default. I also install uptimed and run uprecords periodically because I'm a sucker for uptimes. As the server is in my office, it can be a bit noisy, especially when recording podcasts and stuff. So I ssh into it and sudo pm-suspend to make it sleep then just stab the power button later to wake it up again.

    I also use mine as a backup server for the various devices in the house and my remote servers. I use rsnapshot to do backups every 4 hours or so. I wrote a blog post about it a while back: https://popey.com/blog/2020/12/straightforward-linux-backups-with-rsnapshot/

    Reply
  2. GothBoyUK says:

    I bought the G6 too because they had an excellent cashback offer. It is still under my desk, completely unused. I never even switched it on. The true definition of an impulse buy that you later realised you didn't need.

    Reply

What are your reckons?

All comments are moderated and may not be published immediately. Your email address will not be published.

Allowed HTML: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <p> <pre> <br> <img src="" alt="" title="" srcset="">