The joys of server hardware

Server hardware vendors are asses.

Generally speaking, and specifically in my case.

I have a need for a new NAS. Simple enough, since I could buy one, but I’m competent and don’t like being tied into a particular vendor’s idea of functionality – when one can drop Linux on pretty much anything, why constrain yourself to a shitty UI, or a hardware constraint, or a particular feature you don’t even want?

So, I’ll build one. I could go buy some used/refurbished HP DL380s from eBay… but I want some low-cost, low-power, low-power-consumption hardware to sit quietly and just work. A quick look about and it’s clear that the HP Microserver Gen8 fits the bill. I don’t need oomph, nor a particularly large amount of memory (yet, let’s review ZFS in a bit), so the base G1610T Celeron w/ 2GB fits the bill nicely. Really it’s the case I’m after…

It doesn’t take a lot of Googling to know that, despite the product photos, my server will not have a DVD drive, or a switch on top. And indeed, it turns up with no drives. Good so far.

I don’t want my storage array and my storage OS on the same disks, so I’ll need another disk for that. Obviously I’ll get a reasonable 1TB 2.5″ SATA drive for that. A quick look inside the case tells me I’ll also need a short SATA cable and a power cable adaptor too.

So, a few days later we’re all plugged in and ready to go.

  • Create Ubuntu installer USB stick – Check!
  • Boot up – Check!
  • Install Ubuntu to SATA disk – Check!
  • Reboot successfully – Check!
  • Add first storage disk into swap bay – Check!
  • Reboot successully – Oh! 🙁

In their infinite wisdom (or rather, deliberate crippling effort), HP have elected to make it impossible to put SATA-5 (the internal slot into which an extra disk might be connected) ahead of SATA-1 to 4 (the front disk bays) in the boot order. I can boot from disk, network, USB… hell, even the internal microSD slot! But I can’t boot from the one obvious choice that anybody might want to!

It turns out though that the microSD option is a useful one in the Linux world. I have my OS installed, albeit onto a disk that this machine doesn’t want to talk to first. And I have Linux. It’s pretty trivial to dump Grub onto the card, and tell it to boot the disk.

Grub doesn’t need much space, but it’s still almost impossible to find a small memory card these days. If I drop the morning cappucino and
get one of these instead, I’ll be fine.

Unplug all the front bay disks and boot up. Back in the familiar (and sensible) territory of Ubuntu we need only initialize my microSD card:

dd if=/dev/zerp of=/dev/sdb bs=1M count=256M; # Zero out any existing content
fdisk /dev/sdb; # Create a single 256M partition.
mkfs -t ext2 /dev/sdb1; # Format that partition to ext2, ready for Grub
mkdir /mnt/sd && mount /dev/sdb1 /mnt/sd; # Mount the card
mkdir /mnt/sd/boot; # Create a directory for Grub's config
grub-install --boot-directory=/mnt/sd/boot /dev/sdb; # Install Grub onto the card
update-grub --output=/mnt/sd/boot/grub/grub.cfg; # Configure Grub on the card to use this disk
parted /dev/sdb; # One last thing... make it bootable with the "toggle", "1", "boot" options.

There’s a flaw in the above instructions, in that /dev/sdb will likely be a different device after a few reboots. Use the appropriate /dev/disk/by-id/… symlink instead.

Reboot, et voila!