kate: a home computer

Table of Contents

Intro

This machine was constructed in late 2015.

Goals:

  • Runs Linux.
  • Dual use: (1) multithreaded performance for transcoding, (2) low power for day long desktop use.
  • SSD system disc: low power, cool, quiet
  • Two hot swap hard drives with off buttons for temporary media file storage and backups

Non-goals:

  • Bleeding edge.
  • Saving money compared to a prebuilt system.
  • Cool appearance
  • PCI expansion slots.
  • Video capability

Hardware

Motherboard

GIGABYTE GA-H97M-HD3

  • GIGABYTE GA-H97M-HD3 LGA 1150 Intel H97 HDMI SATA 6Gb/s USB 3.0 Micro ATX Intel Motherboard
  • 1 x HDMI port, supporting a maximum resolution of 4096x2160@24Hz or 2560x1600@60Hz
  • DSUB, DVI
  • 6 x SATA 6Gb/s connectors
  • 6 x USB 3.0/2.0 ports (4 ports on the back panel, 2 ports available through the internal USB header)
  • 6 x USB 2.0/1.1 ports (2 ports on the back panel, 4 ports available through the internal USB headers)
  • from: Amazon
  • price: $78.99

CPU

I was tempted by the AMD FX-6300, $100 and six threads, champion price/performance leader now. But it is only slightly faster than the Intel in Handbrake benchmarks, runs hotter with higher wattage. You also have a greater motherboard selection with Intel.

The i3-4360's multithreaded Handbrake benchmarks compare favorably to i5 and i7 processors which cost more.

Intel Core i3-4360

  • Intel Core i3-4360 Haswell Dual-Core 3.7 GHz LGA 1150 54W BX80646I34360 Desktop Processor Intel HD Graphics 4600
  • 2 cores / 4 threads
  • 54W TDP
  • from: Amazon
  • price: $149.99

CPU cooler

At max load the processor was running too hot, so I bought a Noctua NH-L9i.

This is my first aftermarket cooler. The build, finish and fit are more impressive that the stock cooler (which I've always had good luck with in the past). Much more metal in the Noctua for a better heat sink. Bolting it from the rear of the motheboard seems a more reassuring method than the plastic twist connectors the stock coolers use.

I had room for a larger cooler, but this one is lighter than the others and I hope will be less strain on the motherboard. Weight: 420g (= 14.8oz).

When removing the stock cooler I noticed the thermal pad had not spread very much. Maybe a reason for the high temperatures?

  • from: Amazon
  • price: $39.95

Memory

Crucial Ballistix Tactical 8GB Kit (4GBx2) DDR3-1600 UDIMM LP CT5859739

Found using the Crucial memory configuration tool, just enter the motherboard.

2 sticks for the dual-channel CPU and motherboard.

  • DDR3 PC3-12800 • 8-8-8-24 • Unbuffered • NON-ECC • DDR3-1600 • 1.35V • 512Meg x 64 • Low Profile •
  • from: Crucial
  • price: $55.99 + 3.92 tax

Case

LIAN LI PC-9NA

I wanted light-colored case because dust is less visible on it, and a metal case because plastic does not last long enough for me.

  • LIAN LI PC-9NA Silver Aluminum ATX Mid Tower Computer Case
  • from: Newegg
  • price: $109.99

Hard Drive Cages

ICY DOCK TurboSwap MB171SP-B

Important features: the 80mm fan can be replaced, and with a 120mm fan; fan speed control and off switch on the front.

  • ICY DOCK TurboSwap MB171SP-B Tray-Less 3.5" SATA Hard Drive Mobile Rack with 80mm Cooling Fan
  • qty: 2
  • from: Newegg
  • price: $38.99 each

Power supply

SeaSonic Platinum Series SS-400FL2

This may be higher end than I need, but since the system is meant to run on an SSD system disc, I wanted to try a silent power supply. Fully modular is a plus, as is 6 SATA connectors.

  • SeaSonic Platinum Series SS-400FL2 Active PFC F3 400W ATX12V Fanless 80 PLUS Platinum Certified Modular Active PFC Power Supply New 4th Gen CPU Certified Haswell Ready
  • from: Newegg
  • price: $109.99

SSD

Kingston Digital 120GB SSDNow V300 SATA 3 2.5

  • Kingston Digital 120GB SSDNow V300 SATA 3 2.5 (7mm height) Solid State Drive (SV300S37A/120G)
  • from: Amazon
  • price: $39.99

Optical Drive

ASUS BC-12B1ST

I used this same model for a build 4 years ago.

  • ASUS Black 12X BD-ROM 16X DVD-ROM 48X CD-ROM SATA Internal Blu-ray Drive Model BC-12B1ST/BLK/B/AS - OEM
  • from: Newegg
  • price: $52.99

Accessories

  • Zalman Fan Mate 2

    A fan speed controller for the input fan to reduce noise. It is a Y-cable that plugs inline between the power source (not the motherboard in this case) and has a knob to turn the speed up and down. Double sided tape mounts it on the rear of the case.

    • from: Amazon
    • price: $8.99

Assembly notes

Case

  • Remove four thumbscrews on the rear and both sides pop off easily.

  • The front bezel comes off with a pull. The hinges holding this on are the only plastic on the case.

  • The micro-ATX motherboard mounted at four bolt positions, which is plenty firm. There are two more mounting holes, but I would need spacers to match the case.

  • The 3 external 5.25" drive slots are in a fixed metal cage, which may make for cooling problems for the 2 turboswap cages and 1 optical drive.

    The turboswap cages have 80mm fans on the underside, but there is little space for them to blow into in this arrangement. We may get some hot air out of the rear of the cage.

    I mounted the optical drive between the two removable cages, hoping for a greater heat sink if both hard drives are operating at the same time.

  • Two of the three 5.25" slots have quick release mounts which seem of limited use here. I used bolts at every position possible, on both the right and left.

  • The front bezel has only a narrow air intake opening.

  • The internal 3.5" drive cage is removable and I took it out so as to allow less obstruction for the front fan.

  • There is no space for cable storage behind the motherboard.

  • The audio sockets in the little I/O port are not labeled. From the front, it is "Headphone" on the left and "Microphone" on the right.

  • The 140mm fan in front is running at full speed, and although not objectionably noisy, I'll slow it down with a separate controller.

SSD

  • The SSD has no mounting facility, but it weighs almost nothing so I taped it to the floor of the case.

Hard drive cages

Power supply

Motherboard

Smoke test

  • Booted into Arch Linux the first time, all devices recognized. Confirmed booted in UEFI mode.

Hardware summary results

  • Power consumption

    • Idling with only the SSD mounted: 22W.
    • With a 7200RPM 3.5" SATA drive spinning: 32W. (5400RPM: 30W)
    • Running a HandBrake encode on the above drive and using all 4 threads: 73W.
  • Temperature

    • With the original stock Intel CPU cooler, when idling it was cooler than my i3-2000 system, but at max load running HandBrake it was hotter: about 10C in both cases.

      With the Noctua NH-L9i

  • Noise

    A quiet machine, although the front case fan running at full speed was the loudest component. After I added a manual speed controller it can be turned down to be very quiet.

    The fanless power supply may not have been necessary.

  • Appearance

    I'm very pleased with the quality of this case. Apart from looking minimalistically elegant, it has a clean design and is well-built. Lightweight aluminum.

Linux

Installation

After many years with openSuSE I wanted to give Arch Linux a try. I keep hitting their pages when searching for help.

Get the installation live system

Fetch the installation ISO from one of the mirrors at https://www.archlinux.org/download/.

That page has checksums for PGP, MD5 and SHA1. I checked them all to make sure no villain had tampered with the ISO. (I edited the *.md5 and *.sha1 files by hand).

  • md5sum  -c archlinux-2015.11.01-dual.iso.md5

  • sha1sum -c archlinux-2015.11.01-dual.iso.sha1

  • gpg --recv-keys 9741E8AC

    gpg --verify archlinux-2015.11.01-dual.iso.sig

Instead of burning a CD, I used a USB stick:

dd bs=4M if=archlinux-2015.11.01-dual.iso of=/dev/sdc && sync  # VERIFY DEVICE!

There is also a netboot method, which I did not try.

Before installation

I followed the detailed Beginner's Guide. I'll give a brief summary of the steps here.

I did an UEFI/GPT/SYSTEMD-BOOT install to the SSD.

Note: have ethernet connected before booting.

Boot the install media

Automatic console login as root.

Start the time-sync daemon:

# timedatectl set-ntp true

Prepare the system SSD

Where is the SSD?

# lsblk

... says /dev/sda.

Is it partitioned?

# parted /dev/sda print

... says not.

Create the partition table and partitions: one for booting and one for everything else:

# parted /dev/sda

(parted) mklabel gpt

(parted) mkpart ESP fat32 1MiB 513MiB

(parted) set 1 boot on

(parted) mkpart primary ext4 513MiB 100%

Verify alignment on the boot partition and exit:

(parted) align-check

(parted) quit

Verify alignment with another utility:

# blockdev --getalignoff /dev/sda1

Create the file systems and mount:

# mkfs.fat -F32 /dev/sda1

# mkfs.ext4 /dev/sda2

# mount /dev/sda2 /mnt

# mkdir /mnt/boot

# mount /dev/sda1 /mnt/boot

Install the base packages

# pacstrap -i /mnt base base-devel

Prepare the new system

Create fstab:

# genfstab -U /mnt > /mnt/etc/fstab

Change root:

# arch-chroot /mnt /bin/bash

Locale: edit /etc/locale.gen and uncomment en_US.UTF-8 UTF-8

Run:

# locale-gen

Create /etc/locale.conf and add LANG=en_US.UTF-8

Time:

# ln -s /usr/share/zoneinfo/America/Chicago /etc/localtime

# hwclock --systohc --utc

Swap

Use a swap file instead of a partition. This is not in the Beginner's guide, I got it from Swap:

# fallocate -l 2G /swapfile

# chmod 600 /swapfile

# mkswap /swapfile

# swapon /swapfile

Edit /etc/fstab to add /swapfile none swap defaults 0 0

Install bootloader

# pacman -S intel-ucode

# bootctl install

Create /boot/loader/entries/arch.conf:

title          Arch Linux
linux          /vmlinuz-linux
initrd         /intel-ucode.img
initrd         /initramfs-linux.img
options        root=/dev/sda2 rw

Edit /boot/loader/loader.conf to have:

timeout 3
default arch

Network

Hostname. Create /etc/hostname and add kate

Edit /etc/hosts and add 127.0.1.1 kate.localdomain kate

Find interface with:

ip link

Make persistent with:

systemctl enable dhcpcd@enp2s0.service

Add the MAC address to the router list for assigning fixed IP addresses. Find it with ip link or cat /sys/class/net/DEVICE_NAME/address.

Done

Set passwd and reboot:

passwd

exit (from chroot)

umount -R /mnt (open files? Shutdown will close them)

reboot (remove USB stick before the next boot)

Care of the system SSD

We want to reduce writes to the SSD as much as possible.

Mount with noatime

Edit /etc/fstab to use noatime for the mounts.

Enable periodic TRIM

systemctl enable fstrim.service

systemctl enable fstrim.timer

Adjust scheduler

Create /etc/udev/rules.d/60-schedulers.rules and add:

# set deadline scheduler for non-rotating disks
ACTION=="add|change", KERNEL=="sd[a-z]", ATTR{queue/rotational}=="0", ATTR{queue/scheduler}="deadline"

Adjust swappiness

Create /etc/sysctl.d/99-sysctl.conf and add:

vm.swappiness=1

Sync busy directories to RAM

Installed profile-sync-daemon and configured it for firefox. See the note in the article on moving the firefox cache directory into the profile tree. (LATER: switched to the palemoon browser and removed caching of firefox).

Installed anything-sync-daemon and configued it to copy .cache/ in the home directory.

Care of WD Green Drives

This article has techniques for preventing frequent head parking in these drives: Special Consideration for WD Green HDDs.

Desktop

I did not note all the xorg packages I installed. See the Arch wiki articles for suggestions.

I installed lxde and enabled graphical login with:

systemctl enable lxdm.service

Fonts: added ttf-dejavu fonts.

Normal setup

I won't list all the packages installed or easy config files edited (like /etc/hosts).

Add user

useradd -m wmcclain

passwd wmcclain

Enable sshd daemon

systemctl enable sshd.service

sudo

Run visudo and add:

wmcclain   ALL=(ALL) NOPASSWD: ALL

email

Installed getmail to fetch mail from my accounts. On the IMAP servers, all mail is fetched and deleted, and the deleted messages are copied into INBOX.Trash.

A cron job checks the servers every 10 minutes.

A log is written to /dev/shm/getmail.log.

samba

Necessary steps for both thunar and the OPPO player to see the share:

  • Start and enable nmbd.service as well as smdb.service.

  • Edit the samba password for a chosen user: pdbedit -a -u wmcclain, and use that to access the share from the client. (This is different than the user's account password).

  • After upgrade to samba 4.5.0, reenable old security to placate OPPO players:

    lanman auth = yes
    ntlm auth = yes raw NTLMv2
    auth = yes

The share is defined as:

[wem]
comment = WEM media files
path = /mnt/queen/home/wmcclain/wem
public = yes
writable = no
browse list = yes
guest ok = yes

ntp*

Install ntp.

Start and enable ntpd.service.

todo: auto on boot, set system clock

allow X11 forwarding over ssh

NOTE: not working yuet.

Edit /etc/ssh/sshd_config:

verify that AllowTcpForwarding and X11UseLocalhost options are set to yes, and that X11DisplayOffset is set to 10 (those are the default values if nothing has been changed, see man sshd_config)

set X11Forwarding to yes

Restart the sshd daemon

xhost +

Arch User Repository

A large body of submitted software not yet in the official repository. The installation procedure for these packages is different.

Home and search page: AUR Home

Read:

Must have: base-devel installed and sudo configured.

Edit /etc/makepkg.conf and set MAKEFLAGS to -j4 to allow 4 threads.

Example:

Profile-sync-daemon, which manages browser profiles in RAM to save wear on the SSD.

  • Get the .tar.gz file, save to ~/installs/aur

  • cd /dev/shm/ # compile in tmpfs, save the SSD

  • tar zxvf ~/installs/aur/profile-sync-daemon.tar.gz; cd profile-sync-daemon

  • Inspect the PKGBUILD and .install files for maliciousness.

  • Build and install (never run as root):

    makepkg -sri

The AUR helpers page has supporting utilities. I use cower and burgaur to search for packages, download and build them. They will also show available updates and build those.

Pacman tips

Also see:

Update package list and upgrade all packages afterward:

pacman -Syu

Install package only if there is an update:

pacman -S --needed <pkg>

Search repository for package:

pacman -Ss <string>

List packages that have updates available:

pacman -Qu

Package server

I've installed pacserve and will use it on every Arch machine I have in the future, allowing the systems to share the same package downloads.

Use the pacsrv command instead of pacman.

Whole disc backup

See Full system backup with rsync for the general approach.

Create /usr/local/sbin/backup-sys as:

rsync --info=progress2 -aAXHS --delete --exclude-from=/root/exclude-from-backup.txt / /mnt/$1

... where /root/exclude-from-backup.txt is:

/boot/
/dev/
/proc/
/sys/
/tmp/
/run/
/mnt/
/media/
/lost+found
/swapfile
/home/*/.thumbnails/
/home/*/.cache/mozilla/
/home/*/.cache/chromium/
/home/*/.local/share/Trash/
/home/*/.gvfs/
/etc/fstab

Bootable backups

The system disc is an SSD and I have two hot-pluggable hard drives for work space and backups. The goal is to make the backups bootable so I can switch to them at any time should the SSD fail.

Again, see Full system backup with rsync for the general approach.

Using systemd-boot the only adjustments that need to be made on the backups:

  • The default boot entry in /boot/loader/loader.conf and the collection of boot choices in /boot/loader/entries/.
  • The file system entries in /etc/fstab.
  • Create some optional mount points.
  • Create the swap file.

In the example below, king is the system SSD, and the two backup discs are queen and jack. All have the same partition scheme as shown in the installation section above: a small /boot partition (marked bootable) and another for the rest of the disc.

king and queen have already been set up, and we show how to prepare jack.

As a convention I use PARTLABEL names to identify the partitions. This is more readable than UUID and allows easy introduction of replacement discs: none of the system settings need to be changed.

(I think filesystem LABEL might also be used, but PARTLABEL is independent of file system type).

Label the partitions

Spin up jack.

parted /dev/sdb

(parted) name 1 jack-boot

(parted) name 2 jack

(parted) quit

Confirm the names with lsblk -O or blkid.

Copy the boot files

mount /dev/sdb1 /mnt/jack

(That's usually where jack's root is mounted, but we'll use it for the boot partition temporarily. We do it just this once).

cp -varp /boot/* /mnt/jack

In /mnt/jack/loader/entries/ the boot files king.conf and queen.conf should be ok as is. Create a new jack.conf file:

title   jack: Arch Linux
linux   /vmlinuz-linux
initrd  /intel-ucode.img
initrd  /initramfs-linux.img
options root=PARTLABEL=jack rw

Edit /mnt/jack/loader/loader.conf and change the default so that we have:

timeout 3
default jack

At any time, copy /mnt/jack/loader/entries/jack.conf to the /boot/loader/entries/ directories on the other discs.

umount /mnt/jack

Backup the rest of the disc

mount /dev/sdb2 /mnt/jack

backup-sys jack

fstab

The backup procedure does not copy this file, so do it just this once:

cp /etc/fstab /mnt/jack/etc

Edit /mnt/jack/etc/fstab and change king to jack for the new system. Add an optional mount point for king. The swapfile should be ok as is. The new contents should include:

PARTLABEL=jack      /           ext4  rw,noatime,data=ordered 0 1
PARTLABEL=jack-boot /boot       vfat  rw,noatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro 0 2
/swapfile           none        swap  defaults 0 0
PARTLABEL=king      /mnt/king   ext4  rw,noatime,user,noauto 0 0
PARTLABEL=queen     /mnt/queen  ext4  rw,noatime,user,noauto 0 0

Create mount points for the optional drives:

cd /mnt/jack

mkdir -p mnt/king

mkdir -p mnt/queen

swap

When you first boot jack there will be an error about the missing swap file. (We don't back that up). Just create it as we did for the original installation above:

# fallocate -l 2G /swapfile

# chmod 600 /swapfile

# mkswap /swapfile

# swapon /swapfile

What does this get us?

  • We can select which (running) drive to boot from by using the BIOS override.
  • When the boot menu appears it will contain entries for each of the three discs. We have another chance to boot any of the (running) drives at that time.

Issues

History

  • 18-dec-2015: new build
  • 25-dec-2016: replaced older system (montag)

This document was generated on September 12, 2016 at 15:14 CDT with docutils.