Windows 10 update changes partition table and breaks GRUB

It’s holiday season and so I got a hold of playing some games longly missed on Windows. Booting Windows 10 certainly unveiled several pending updates (Antivirus, Geforce, Windows updates). Since Windows 10 does not explicitly tell about big updates anymore I just did let it reboot several times, waiting for manual grub selection then.

Though this time the update essentially broke GRUB. “error: unknown filesystem. Entering rescue mode…” is certainly not what I expect from a Windows 10 update. After googling a bit I found this thread including an explanation as well as a solution for the problem: The Windows 10 update adds yet another hidden partition, but essentially rewrites the partition table which then breaks GRUB finding the correct /boot partition containing grub2/. Congrats Microsoft!

So, Windows 10 “Upgrade to Windows 10 Home, version 1511, 10586” breaks grub2 because boot block grub2 still thinks it should boot grub2 from (hd0,msdos2) when it now needs to boot from (hd0,msdos3).

The solution is simple but nasty without bash-completion and English keyboard layout on a German keyboard.

First find the boot partition containing the grub2/ directory.windows10_upgrade_dec2015_breaks_grub

grub rescue> ls (hd0,msdos1)/grub2
error: unknown filesystem.
grub rescue> ls (hd0,msdos2)/grub2
error: unknown filesystem.
grub rescue> ls (hd0,msdos3)/grub2
./ ../ themes/ device.map i386-pc/ locale/ fonts/ grubenv grub.cfg

Next set the changed boot prefix and root attributes:

grub rescue> set prefix=(hd0,msdos3)/grub2
grub rescue> set root=(hd0,msdos3)
grub rescue> set
prefix=(hd0,msdos3)/grub2
root=hd0,msdos3
grub rescue> insmod normal
grub rescue> normal

Change from “rescue” to “normal” GRUB mode, and quickly select Fedora from the boot menu. In order to fix GRUB log into Fedora, open a terminal and become root. Now generate a new grub configuration.

sudo -i
grub2-mkconfig -o /boot/grub2/grub.cfg
grub2-install /dev/sda
reboot

Reboot and the GRUB menu should be fixed. Now safely choose to continue the Windows 10 upgrade.

Logitech K800 wireless not working on dm-crypt passphrase

This bug did bite me in the past with Kernel 3.2 and Debian testing too, and I consider the Logitech wireless keyboard drivers in a similar tested fashion such as NVIDIA proprietary drivers – pretty much exotic and hard to maintain all the changes.

It’s not fun once you’ve chosen the grub entry and are prompted to enter your password for the encrypted LVM in order to boot your entire system – and nothing happens on the Logitech K800 wireless keyboard. But before it did work on selecting the correct grub entry.

Some googling for the error unveiled several threads providing insights and workaround fixes. This one told me that dracut is the root cause being responsible for loading the logitech kernel module before cryptsetup would prompt for the password. Which totally makes sense.

So how to convince dracut to load the logitech driver? It actually tries to do so already. So the initial workaround below did not work.

 

# vim /etc/dracut.conf

add_drivers+=" hid-logitech-dj "

# dracut -f

In a different manner, it came up that the kernel module had been renamed recently from “hid-logitech-dj” to “hid-logitech-hidpp”. Renaming something normally breaks all other dependencies, but looking at this fix – well, hardcoding everything somewhere in a shell script, oh my.

While waiting for an updated dracut, either patch the module-setup.sh – which might break on dracut package update again.

 

imagine ~ # yum install dracut
imagine ~ # cp /usr/lib/dracut/modules.d/90kernel-modules/module-setup.sh /usr/lib/dracut/modules.d/90kernel-modules/module-setup.sh.orig
imagine ~ # vim /usr/lib/dracut/modules.d/90kernel-modules/module-setup.sh
imagine ~ # diff -ur /usr/lib/dracut/modules.d/90kernel-modules/module-setup.sh.orig /usr/lib/dracut/modules.d/90kernel-modules/module-setup.sh
--- /usr/lib/dracut/modules.d/90kernel-modules/module-setup.sh.orig	2015-04-03 12:45:32.779223333 +0200
+++ /usr/lib/dracut/modules.d/90kernel-modules/module-setup.sh	2015-04-03 12:45:45.843129483 +0200
@@ -45,7 +45,7 @@
 
         instmods yenta_socket scsi_dh_rdac scsi_dh_emc \
             atkbd i8042 usbhid hid-apple hid-sunplus hid-cherry hid-logitech \
-            hid-logitech-dj hid-microsoft firewire-ohci \
+            hid-logitech-dj hid-logitech-hidpp hid-microsoft firewire-ohci \
             pcmcia usb_storage nvme hid-hyperv hv-vmbus \
             sdhci_acpi
 

Or fix the dracut configuration for loading the correct additional driver. Note: Only rebuild the image for 3.19.x – the renamed driver does not exist in 3.18.x and below. (I did boot the old kernel allowing me to drecrypt the system).

 

# vim /etc/dracut.conf

add_drivers+=" hid-logitech-hidpp "

# dracut -f /boot/initramfs-3.19.1-201.fc21.x86_64.img 3.19.1-201.fc21.x86_64

Fedora 21 Workstation with Docker

fedora21Now that Fedora 21 is going the feature release way, I’ll stick with workstation. Since I recently just installed Fedora 20, I did not yet have the pleasure to do a dist upgrade (and they do tell it might not work, hehe, as always with RHEL).

Make sure that fedup is the latest version.

$ sudo yum update fedup fedora-release

Now do the network update magic. At the time of writing the fedoraproject.org site was under heavy load generating lots of 503 errors.

$ sudo fedup --network 21 --product=workstation
setting up repos...
default-installrepo/metalink                                |  16 kB  00:00     
default-installrepo                                         | 3.7 kB  00:00     
default-installrepo/group_gz                                | 113 kB  00:00     
default-installrepo/primary_db                              | 1.4 MB  00:00     
getting boot images...
.treeinfo.signed                                            | 2.1 kB  00:00     
vmlinuz-fedup                                               | 5.5 MB  00:01     
initramfs-fedup.img                                         |  40 MB  00:07     
setting up update...

For me it’s 2268 packages being updates so it takes a while. Once it tells you to reboot and select ‘fedup’ do it. You can safely ignore icedtea* and kmod* kernel modules with unsatisfied dependencies, if asked.

The upgrade takes a while, but will then boot from the basic system into your finally upgraded system. akmod will run and build new kernel modules for my nvidia and virtualbox modules (kmod breaks too often anyways).
After successful login, re-run update to fetch the latest debug symbols I keep for Icinga development (boost to be exact).

$ sudo yum update

Some pitfalls: Gnome 3.14 ignores the button-layout in my overrides settings for certain windows. The default terminal window coloring is somewhat ugly dark green.

docker_grafanaNow for Docker: docker-io is gone, the new package name is only ‘docker’. Simple test with trying grafana and graphite:

$ sudo docker run -d -p 80:80 -p 8125:8125/udp -p 8126:8126 --name kamon-grafana-dashboard kamon/grafana_graphite

Installing C&C RA2 Yuri’s Revenge on Fedora 20

Playing 3D games also requires the 32bit OpenGL drivers installed, apart from Wine itself.

yum -y install xorg-x11-drv-nvidia-libs.i686
yum -y install wine

Then grab your First Decade installation DVD, install at least Command & Conquer: Red Alert 2 & Yuri’s Revenge by calling setup.exe with wine. After the serial number orgy, copy over a no-cd crack (do that at your own risk, otherwise keep the dvd in your drive all the time).

Yuri’s revenge requires a virtual desktop in Wine, so adjust that one inside ‘winecfg’:

wine_cfg_yuri_01 wine_cfg_yuri_02

 

Then make sure to select Pulseaudio as audio source.

wine_cfg_yuri_03

Start Red Alert 2 – Yuri’s Revenge either directly where it is installed using ‘wine YURI.exe’ or natively from the Wine menu.

Voilà!

wine_yuri_01wine_yuri_02

Hello, Fedora 20

Since I recently switched my work notebook to Fedora 20, I figured that working with Fedora and Gnome 3 works rather smooth these days.

You’ll get a fairly stable distribution, use community provided repositories (for the nvidia driver), and you’re able to play with bleeding edge software without entirely breaking your production system. I didn’t like (K)Ubuntu that much (dist-upgrade was a huge fail all the time), several alternatives such as Linux Mint or other forks just don’t have a large community base (google the error, and find a solution within minutes). Lately, Debian Testing wasn’t so much pleasure either, and Debian stable is something I will only use for servers, not for notebooks or private workstations.

Other than that, I always play around with RPMs in Icinga Vagrant demo boxes, or keep updating them for Icinga and NETWAYS all the time. Which leaves Fedora the perfect choice for the next years (let’s see about that though).

imagine_fedora_20

Find a list of tools installed below, for whoever that may be useful, I’m certain it is for me when re-installing again. I am still too lazy for a puppet module 😉

The install itself happens from a netinstall ISO, choosing the default crypted LVM with a Gnome desktop installation. Once done, I’ll go get Steam and Wine for some Command & Conquer Red Alert 2 mod action.

yum -y install vim

# NVIDIA driver
yum localinstall --nogpgcheck http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm
yum localinstall --nogpgcheck http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm

mv /boot/initramfs-$(uname -r).img /boot/initramfs-$(uname -r)-nouveau.img
dracut /boot/initramfs-$(uname -r).img $(uname -r)
yum install -y vdpauinfo libva-vdpau-driver libva-utils

# Backup - 1. ssh key
scp -r sys@192.168.2.200:/raid/data/private/imagine/michi/.ssh .
# Backup - 2. rest
scp -r sys@192.168.2.200:/raid/data/private/imagine/michi/{.Xauthority,.Xresources,.bash*,.dosbox,.gitconfig,.openvpn,.rtorrent.rc,.vimrc,docs,download,private,tools,coding} .

Chrome fc20 RPM: https://www.google.com/chrome/browser/ 
Vagrant fc20 RPM: http://www.vagrantup.com/downloads.html

# passwordless sudo
sudo visudo

# Allow members of group sudo to execute any command
%sudo ALL=(ALL:ALL) ALL

michi ALL=(ALL) NOPASSWD: ALL

curl https://raw.githubusercontent.com/git/git/master/contrib/completion/git-prompt.sh > ~/.bash_git

sudo -i

yum install -y gnome-tweak-tool dconf-editor gparted
yum install -y google-chrome-stable rdesktop shutter pigdin pigdin-otr gimp gimp-paint-studio
yum install -y hplip hplip-gui
yum install -y thunderbird thunderbird-lightning thunderbird-lightning-gdata
yum install -y httpd php php-pear php-mysql php-pgsql php-gd php-soap php-ldap
yum install -y screen lynx tcpdump wireshark htop rrdtool
yum install -y cairo-dock cairo-dock-plug-ins
yum install -y NetworkManager-openvpn NetworkManager-openvpn-gnome openvpn
yum install -y git git-csv git-svn git-email
yum install -y autoconf automake libtool zlib-devel strace gdb valgrind clang ccache cmake gcc-c++
yum install -y rpmlint @development-tools fedora-packager
yum install -y mysql mysql-server mariadb-devel postgresql postgresql-server postgresql-devel
yum install -y nagios-plugins-all
# icinga 1.x
yum install -y httpd gcc glibc glibc-common gd gd-devel libjpeg libjpeg-devel libpng libpng-devel net-snmp net-snmp-devel net-snmp-utils docbook-simple
yum install -y libdbi libdbi-devel libdbi-drivers libdbi-dbd-mysql libdbi-dbd-pgsql
# icinga 2.x
yum install -y cmake bison flex openssl openssl-devel
yum install -y boost-devel boost-regex boost-signals boost-system boost-test boost-thread boost
# icinga-vagrant
yum install -y VirtualBox
yum install -y libvirt-devel libxslt-devel libxml2-devel ruby
# icingaweb2
yum install -y php-ZendFramework php-ZendFramework-Db-Adapter-Pdo-Mysql php-ZendFramework-Db-Adapter-Pdo-Pgsql php-devel


chmod a+r /etc/fuse.conf
vim /etc/fuse.conf
# Allow non-root users to specify the allow_other or allow_root mount options.
user_allow_other

vim /etc/vimrc

" custom
set background=dark
set showcmd
set showmatch
" Show (partial) command in status line.
" Show matching brackets.
highlight ExtraWhitespace ctermbg=red guibg=red
match ExtraWhitespace /s+$/
autocmd BufWinEnter * match ExtraWhitespace /s+$/
autocmd InsertEnter * match ExtraWhitespace /s+%#@<!$/
autocmd InsertLeave * match ExtraWhitespace /s+$/
autocmd BufWinLeave * call clearmatches()
" disable shell beep
set vb


exit

Config

# Gnome Config

gnome-tweak-tool
# 'obere leiste' - date, calendar week
# start apps: terminal, chrome, thunderbird, cairo-dock, pidgin
gnome-session-properties
# options - session restore
dconf-editor
# org -> gnome -> shell -> overrides -> button-layout :minimize,maximize,close

# Add __git_ps1 sourcing
vim ~/.bashrc

source ~/.bash_git
function myPrompt() {

# Default dirs
vim ~/.config/user-dirs.dirs

XDG_DESKTOP_DIR="$HOME"
XDG_DOWNLOAD_DIR="$HOME/download"
XDG_TEMPLATES_DIR="$HOME/docs"
XDG_PUBLICSHARE_DIR="$HOME/download"
XDG_DOCUMENTS_DIR="$HOME/docs"
XDG_MUSIC_DIR="$HOME/music"
XDG_PICTURES_DIR="$HOME/pics"
XDG_VIDEOS_DIR="$HOME/download"

# Thunderbird
thunderbird + CTRL+C
cd .thunderbird
scp -r sys@192.168.2.200:/raid/data/private/imagine/michi/.icedove/y4oegof8.default .
vim profiles.ini

[General]
StartWithLastProfile=1

[Profile0]
Name=default
IsRelative=1
Path=y4oegof8.default

# VPN
mv .openvpn .cert
restorecon -R -v ~/.cert

# printer
sudo hp-setup

Software

# RPMBuilds

/usr/sbin/useradd makerpm
usermod -a -G mock makerpm
chmod -R o+rx /home/makerpm/
passwd makerpm
su - makerpm

[makerpm@imagine ~]$ rpmdev-setuptree
[makerpm@imagine ~]$ tree
.
└── rpmbuild
    ├── BUILD
    ├── RPMS
    ├── SOURCES
    ├── SPECS
    └── SRPMS

6 directories, 0 files

exit
# Databases
systemctl start mariadb
mysql_secure_installation


vim /root/.my.cnf
[client]
password = XXX

postgresql-setup initdb
systemctl start postgresql
# Users
useradd icinga
groupadd icingacmd
usermod -a -G icingacmd icinga
usermod -a -G icingacmd apache