2016-09-04

Ubuntu 16.04 boot failure

One of my homelab servers (ts01) running Ubuntu 16.04 refused to boot today.

It's running kernel 4.4.0-36-generic.

Looking at the console I see this


Multiple /scripts/local-block ... done lines. The USB keyboard I have attached did not work, so I rebooted and at the grub boot menu I choose another kernel:

  4.4.0-34-generic instead of the default  4.4.0-36-generic which fails to boot.

Kernel  4.4.0-34-generic boots ok.

I tried to re-install the packages for the kernel, but still got the same failure.

So, I compared the files kernel files with another identical homelab server (ts02).

This server works:
root@ts02:/boot/grub# ls -l /boot/
total 87640
-rw-r--r-- 1 root root 32061904 Aug 29 21:55 initrd.img-4.4.0-36-generic


This server fails during boot.
root@ts01:/boot/grub# ls -l /boot/
total 87555
-rw-r--r-- 1 root root 31977897 Sep  4 20:42 initrd.img-4.4.0-36-generic

So I copied the initrd.img-4.4.0-36-generic from ts02 to ts01. This fixed the problem and ts01 booted OK.



2016-08-23

DC/OS installation on Ubuntu 16.04

Work In Progress ...

My work notes so far trying to install DC/OS 1.8.1 on Ubuntu 16.04

Source: https://dcos.io/docs/1.8/administration/installing/custom/advanced/

My DC/OS homelab servers: 192.168.1.71, 192.168.1.72, 192.168.1.73
My bootstrap server: 192.168.1.73



WORKDIR: /sw/dcos

FILE: genconf/config.yaml (bootstrap server)
---
bootstrap_url: http://192.168.1.73:8877
cluster_name: 'soulfunk'
exhibitor_storage_backend: static
ip_detect_filename: /genconf/ip-detect
master_list:
- 192.168.1.73
- 192.168.1.72
- 192.168.1.71
resolvers:
- 8.8.4.4
- 8.8.8.8


FILE: genconf/ip-detect (bootstrap server)
#!/usr/bin/env bash
set -o nounset -o errexit
export PATH=/usr/sbin:/usr/bin:$PATH
echo $(ip addr show | grep inet | grep 192.168.1 | grep -Eo '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | head -1)



FILE: get_boostrap_install.sh (bootstrap server)
#!/bin/bash
curl -O https://downloads.dcos.io/dcos/EarlyAccess/dcos_generate_config.sh


FILE: create_build_file.sh (bootstrap server)
#!/bin/bash
bash dcos_generate_config.sh


FILE: run_nginx.sh (bootstrap server)
#!/bin/bash
docker run -d -p 8877:80 -v $PWD/genconf/serve:/usr/share/nginx/html:ro nginx

FILE: symlink_binaries.sh (all servers)
#!/bin/bash
cd /usr/bin || exit -1
FILES="ln mkdir tar"
for f in $FILES ; do
  test -e /usr/bin/$f || ln -s /bin/$f $f
done

FILE: get_dcos_installer_from_bootstrap_server.sh (all servers)
#!/bin/bash
curl -O http://192.168.1.73:8877/dcos_install.sh


1) On boostrap server, download installer and create build file:


# cd /sw/dcos
# mkdir genconf
# <create genconf/config.yaml> 
# <create genconf/ip-detect>  
# ./get_bootstrap_install.sh
# ./create_build_file.sh


2) On bootstrap server, start nginx:
# ./run_nginx.sh

3) On each server:
# ./get_dcos_installer_from_bootstrap_server.sh
# ./symlink_binaries.sh
# bash dcos_install.sh master
# bash dcos_install.sh slave



Monitor Exhibitor

http://192.168.1.73:8181/exhibitor/v1/ui/index.html



DC/OS Web Interface:

http://192.168.1.73/





2016-08-13

Upgrading from Ubuntu 14.04 to 16.04

Upgraded from Ubuntu 14.04 to 16.04 on one of my homelab test-servers today.

After the upgrade, running 'apt-get update' resulted in this error:

# apt-get update
apt-get: relocation error: /usr/lib/x86_64-linux-gnu/libapt-pkg.so.5.0: symbol _ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE7compareERKS4_, version GLIBCXX_3.4.21 not defined in file libstdc++.so.6 with link time reference




To fix this, I tried to manually install libstdc++6:

Download:

wget http://security.ubuntu.com/ubuntu/pool/main/g/gcc-5/libstdc++6_5.4.0-6ubuntu1~16.04.2_amd64.deb


Install:

# dpkg -i libstdc++6_5.4.0-6ubuntu1~16.04.2_amd64.deb

 But this failed with:

dpkg: warning: downgrading libstdc++6:amd64 from 6.1.1-3ubuntu11~14.04.1 to 5.4.0-6ubuntu1~16.04.2
dpkg: regarding libstdc++6_5.4.0-6ubuntu1~16.04.2_amd64.deb containing libstdc++6:amd64:
 libstdc++6:amd64 breaks libboost-date-time1.55.0
  libboost-date-time1.55.0:amd64 (version 1.55.0-1) is present and installed.


dpkg: error processing archive libstdc++6_5.4.0-6ubuntu1~16.04.2_amd64.deb (--install):
 installing libstdc++6:amd64 would break libboost-date-time1.55.0:amd64, and
 deconfiguration is not permitted (--auto-deconfigure might help)
Errors were encountered while processing:
 libstdc++6_5.4.0-6ubuntu1~16.04.2_amd64.deb



So, ran this a few times, to remove libboost libraries:

# for p in $(dpkg -l |grep libboost|awk '{print $2}'); do dpkg --purge "$p" ; done

To do a  dry-run (ie check what would be removed but not actually do it), add an echo infront of dpkg:

Dry-run (test without removing)

# for p in $(dpkg -l |grep libboost|awk '{print $2}'); do echo dpkg --purge "$p" ; done



And then could finally run:

# dpkg -i libstdc++6_5.4.0-6ubuntu1~16.04.2_amd64.deb
dpkg: warning: downgrading libstdc++6:amd64 from 6.1.1-3ubuntu11~14.04.1 to 5.4.0-6ubuntu1~16.04.2
(Reading database ... 147174 files and directories currently installed.)
Preparing to unpack libstdc++6_5.4.0-6ubuntu1~16.04.2_amd64.deb ...
Unpacking libstdc++6:amd64 (5.4.0-6ubuntu1~16.04.2) over (6.1.1-3ubuntu11~14.04.1) ...
Setting up libstdc++6:amd64 (5.4.0-6ubuntu1~16.04.2) ...
Processing triggers for libc-bin (2.23-0ubuntu3) ...


And apt-get was working again



2016-04-02

GitLab CE web-interface "broken" after upgrade on Ubuntu 14.04

I've installed GitLab CE in my homelab as detailed here.

After an apt upgrade, the web interface was not loading the JavaScript and CSS assets:



The fix that worked for me:

mygitlab$ sudo gitlab-rake cache:clear 
mygitlab$ sudo gitlab-ctl restart






2016-03-15

Pc power on problems

Suddenly got this problem with my Komplett Gamer PC, after working for 18 months.


Update: 2016.08.28 - I've had to replace two faulty Corsair AX1200i PSUs in the past 5 months.


2016-02-14

GitLab CE Quick Installation Guide on Ubuntu 14.04


Here's a short write up of how I installed GitLab CE on one of my homelab servers

Install GitLab


First add gitlab repository, key and install it with 'apt-get' thru the script 'gitlab_ubuntu1404_setup.sh'

File: gitlab_ubuntu1404_setup.sh

#!/bin/bash
#
# GitLab CE Quick Installation Guide on Ubuntu 14.04
#
# @NorSoulx 2016
#

if [ "$EUID" != 0 ] ; then echo "Please run as root"; exit ; fi

#####################
# 1) Add GitLab Repos
#
APTSRC=/etc/apt/sources.list.d/gitlab_gitlab-ce.list
BACKUPFILE=/tmp/gitlab.apt.source.bak.$(date '+%Y%m%d-%H%M%S').$$
if [ -f $APTSRC ]; then cp $APTSRC $BACKUPFILE ; fi

cat << APTEND > $APTSRC
#GitLab
deb https://packages.gitlab.com/gitlab/gitlab-ce/ubuntu/ trusty main
deb-src https://packages.gitlab.com/gitlab/gitlab-ce/ubuntu/ trusty main
APTEND


#####################
# 2) Add GitLab key
#
wget -qO - https://packages.gitlab.com/gpg.key | apt-key add -

#####################
# 3) Install packages
#
PKGS="openssh-server ca-certificates postfix gitlab-ce"

apt-get update
for PKG in $PKGS; do
  apt-get install $PKG
done

#####################
# 4) Configure
#
gitlab-ctl reconfigure

# 5) Summary
#
cat << DIREND
GITLAB DIRS
-----------
/opt/gitlab             application code
/var/opt/gitlab         application data and configuration files (gitlab-ctl)   DO NOT EDIT
/etc/gitlab             configuration files (omnibus-gitlab).                   EDIT MANUALLY
/var/log/gitlab         log data (omnibus-gitlab)
DIREND




Installed by running:

mygitlab$ sudo ./gitlab_ubuntu1404_setup.sh


Configure GitLab


I have multiple bonding interfaces and subnets configured on this homelab server, so I  put GitLab on a new ip alias.

Add alias IP


To manually add the alias ip, I did (I've also added this IP to my boot-startup-script)

mygitlab$ sudo ip addr add 10.11.12.13/32 dev bond0


Added new alias IP to local DNS or /etc/hosts.

mygitlab$ grep mygitlab /etc/hosts
10.11.12.13 mygitlab


Create certificate


Created local certificate for https:

mygitlab$ sudo mkdir -p /etc/gitlab/ssl
mygitlab$ sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/gitlab/ssl/mygitlab.key -out /etc/gitlab/ssl/mygitlab.crt


Edit /etc/gitlab/gitlab.rb


Made changes to /etc/gitlab/gitlab.rb.
Change url and ssh host, move backups and datadir, configure ssl.

Set:

external_url 'https://mygitlab'
gitlab_rails['gitlab_ssh_host'] = 'mygitlab'
gitlab_rails['backup_path'] = "/data02/gitlab/backups"
git_data_dir "/data01/gitlab/git-data"
nginx['ssl_certificate'] = "/etc/gitlab/ssl/mygitlab.crt"
nginx['ssl_certificate_key'] = "/etc/gitlab/ssl/mygitlab.key"
nginx['listen_addresses'] = ['mygitlab']


Reconfigure


Ran gitlab-ctl reconfigure for changes to take effect:

mygitlab$ sudo gitlab-ctl reconfigure


Login and change default root password

Login with web-browser: https://mygitlab

Default:
Username: root
Password: 5iveL!fe (change to something else)


Next add users and create projets via web-interface.

Git repositories are located under directory:

/var/opt/gitlab/git-data/repositories




2014-09-12

Windows 8.1 - "Preparing Automatic Repair" Loop

Today, when I rebooted my Windows 8.1 instance (running under VMware Fusion 7 Pro), I was greeted by the "Preparing Automatic Repair" during boot. I keep backups of my VMware instances so I could easily restore the instance from backup - and all my source code is also kept in remote git repositories. But, I wanted to test if I could salvage this instance, and maybe learning something in the process.

Say hello to: Preparing Automatic Repair
 

I tried the various options presented but could not get out of "Preparing Automatic Repair"; 
on every reboot it would enter this state.




In addition, when I tried to do a repair, I was notified that I had to little space left (3.4 GB left). 
First, I tried to remove some unnecessary user produced files, by dropping into the command console and deleting them, but even 6GB free space was not enough. So, instead I decided to increase the VMware disk size for this instance by about 20GB. This allowed repair to start.

However, when I tried to complete a "fresh repair", it failed right after 1%.




  
So, I rebooted, and then through the Advanced options dropped into the command console, and ran these commands:




I also disabled "Automatic Repair", 



When I next rebooted, I was greeted by this message during boot:

 

     Boot critical file is corrupt: C:\Windows\system32\drivers\intelide.sys



I choose once again to run Repair





and this time it completed. 
All installed applications, such as Visual Studio, were gone, but my user data/source code was still there.

Next up, restore my VMware instance backup.