17 March 2018

Unifi Controller

I have a small home/ranch network that is built on Ubiquiti hardware. An Edgerouter Lite as the entry point with Unifi switches and access points in the house and barn and shop. The barn and shop access points are linked in with a couple of Nanobeams. I use the Ubiquiti Unifi Controller to manage the Unifi components.

The Controller runs on Docker on my home workstation, a Fedora 27 based system. I do not run the Controller 24x7, only starting it periodically to check system status and do any needed updates.

The Controller runs under my user ID on the system. I use Jacob Alberty's unifi-docker image for the controller (https://hub.docker.com/r/jacobalberty/unifi/).

The shell script used to start the Controller is:

#!/bin/bash
# run unifi controller
#
# version 3
#
uUID=$(id -u)
uGID=$(id -g)
docker run --rm --init -p 8080:8080 -p 8443:8443 -p 3478:3478/udp //
   -p 10001:10001/udp -e TZ=America/Pacific //
   -e RUNAS_UID0=false -e UNIFI_UID=$uUID -e UNIFI_GID=$uGID //
   -v $PWD/unifi-vol:/unifi:Z -v $PWD/run:/var/run/unifi:Z   //
   --name unifi jacobalberty/unifi:latest

The :Z postfix on the volume settings is needed for correct selinux behaviour.  uUID and gUID pick up the user and group ID of my account at run time.

Hope this helps someone.

Brad

16 March 2018

Linux, UEFI, and Samsung 960 evo firmware update

I have a fairly new Fedora workstation build - ASUS x370 Pro motherboard, a few SSDs, and a Samsung 960 EVO NVMe as the primary drive.

I decided to configure the system to use UEFI rather than the legacy boot process so the drives are set up with gpt partitions, etc. This all works fairly nicely.

I noticed that Samsung released new firmware for the 960 and started to search for a suitable non-Windows process to apply the firmware on a linux system.  Search results seemed to indicate that Samsung used to provide a linux version of Magician firmware update software but that was no longer available.

I finally noticed on Samsung's firmware update site (http://www.samsung.com/semiconductor/minisite/ssd/download/tools/) that there is a section called Samsung Firmware Updates for Windows Users. And in that section is an NVMe SSD Firmware Update Guide which has you use UNebootin to create a bootable USB and install the firmware utility which is packaged as an ISO.

I followed the directions but this UEFI motherboard would not boot from the USB.

Instead, I used tips from https://www.codefull.org/2016/03/create-bootable-usb-flash-drive-from-iso-image-with-uefi-support/ and did the following:

1. Plug USB in;
2. Using gparted
    2a. Remove all partitions;
    2b. create a new partition table with gpt;
    2c. create new partition to fill the whole device using FAT32;
    2d. add a boot flag to the partition;
3. Use dd to copy the Samsung firmware ISO to the USB
   3a. sudo dd if=Samsung_SSD_960_EVO_3B7QCXE7.iso of=/dev/sde bs=4M
4. Boot from the USB to update the firmware

Hope this helps someone