Fixing Ubuntu Boot Loader with Boot-Repair

As I am slowly adapting to the Linux world there are still occasions when I need to boot into the Windows partition of my hard drive to perform a task that I have yet to get working in Linux. Yesterday was one of those times and upon rebooting my computer today to go back into Ubuntu the boot loader was bypassed and Windows was directly loaded without any option to select which operating system to boot.

After a brief moment of staring blankly into the screen I recalled many resources online stating that when setting up a dual-boot with Windows 8 or 8.1 you need to disable fast startup in Windows and secure boot in UEFI. Fast startup is a feature whereby Windows saves some information to a file during shutdown, such as a registry cache or mounted partition state, which allows Windows to boot more quickly. This sounds great but it creates a problem for Ubuntu because the partition information is stored in Windows which prevents Linux from successfully mounting the partitions at startup. UEFI secure boot is a security feature that only allows boot loaders which are signed to the UEFI firmware to boot.

When installing Ubuntu I had read somewhere that secure boot didn’t always have to be disabled, some computers could work around the restriction. In my case, I disabled fast startup but not secure boot and everything worked fine. Well, until today, as I could no longer boot into Ubuntu. To alleviate this issue I needed to disable secure boot as well as fix my Ubuntu boot loader, GRUB.

Secure boot needs to be disabled from within UEFI, so upon rebooting my computer I had to hit the esc key to show the menu followed by F10 to load the UEFI configuration. Once the utility was loaded I navigated to the Secure Boot Configuration within the Security section. As you can see below it is from this prompt that you can disable secure boot. I changed Enable to Disable, then accepted the changes and rebooted. However, that was only step one as upon rebooting my computer booted back into Windows without showing any operating system selection options. I still needed to complete step two, which is to fix GRUB.

UEFI Secure Boot Configuration
UEFI Secure Boot Configuration

There is a tool called Boot-Repair which will fix GRUB and restore access to Ubuntu as it was before. This tool is run from within Ubuntu, which obviously I couldn’t boot into, so that meant I needed to boot to the Ubuntu Live CD. Once the Ubuntu live-session loaded I opened a Terminal window and followed the steps listed on the Ubuntu Boot-Repair community site (actual commands bolded below):

ubuntu@ubuntu:~$ sudo add-apt-repository ppa:yannubuntu/boot-repair
 Simple tool to repair frequent boot problems.
Website: https://launchpad.net/boot-repair
 More info: https://launchpad.net/~yannubuntu/+archive/ubuntu/boot-repair
Press [ENTER] to continue or ctrl-c to cancel adding it
gpg: keyring `/tmp/tmpv5oz0cq5/secring.gpg' created
gpg: keyring `/tmp/tmpv5oz0cq5/pubring.gpg' created
gpg: requesting key 60D8DA0B from hkp server keyserver.ubuntu.com
gpg: /tmp/tmpv5oz0cq5/trustdb.gpg: trustdb created
gpg: key 60D8DA0B: public key "Launchpad PPA for YannUbuntu" imported
gpg: Total number processed: 1
gpg: imported: 1 (RSA: 1)
OK
ubuntu@ubuntu:~$ sudo apt-get update
Ign cdrom://Ubuntu 14.04.1 LTS _Trusty Tahr_ - Release amd64 (20140722.2) trusty InRelease
Ign cdrom://Ubuntu 14.04.1 LTS _Trusty Tahr_ - Release amd64 (20140722.2) trusty/main Translation-en_US
Ign cdrom://Ubuntu 14.04.1 LTS _Trusty Tahr_ - Release amd64 (20140722.2) trusty/main Translation-en
Ign cdrom://Ubuntu 14.04.1 LTS _Trusty Tahr_ - Release amd64 (20140722.2) trusty/restricted Translation-en_US
Ign cdrom://Ubuntu 14.04.1 LTS _Trusty Tahr_ - Release amd64 (20140722.2) trusty/restricted Translation-en
Ign http://archive.ubuntu.com trusty InRelease
Ign http://archive.ubuntu.com trusty-updates InRelease
Hit http://archive.ubuntu.com trusty Release.gpg
Ign http://security.ubuntu.com trusty-security InRelease
Ign http://ppa.launchpad.net trusty InRelease
Get:1 http://archive.ubuntu.com trusty-updates Release.gpg [933 B]
Hit http://archive.ubuntu.com trusty Release
Get:2 http://archive.ubuntu.com trusty-updates Release [62.0 kB]
Get:3 http://security.ubuntu.com trusty-security Release.gpg [933 B]
Get:4 http://ppa.launchpad.net trusty Release.gpg [316 B]
Get:5 http://security.ubuntu.com trusty-security Release [62.0 kB]
Get:6 http://ppa.launchpad.net trusty Release [15.1 kB]
Hit http://archive.ubuntu.com trusty/main amd64 Packages
Hit http://archive.ubuntu.com trusty/restricted amd64 Packages
Hit http://archive.ubuntu.com trusty/main Translation-en
Get:7 http://ppa.launchpad.net trusty/main amd64 Packages [1,970 B]
Hit http://archive.ubuntu.com trusty/restricted Translation-en
Get:8 http://archive.ubuntu.com trusty-updates/main amd64 Packages [441 kB]
Get:9 http://ppa.launchpad.net trusty/main Translation-en [2,123 B]
Get:10 http://security.ubuntu.com trusty-security/main amd64 Packages [214 kB]
Get:11 http://security.ubuntu.com trusty-security/restricted amd64 Packages [8,875 B]
Get:12 http://security.ubuntu.com trusty-security/main Translation-en [109 kB]
Get:13 http://security.ubuntu.com trusty-security/restricted Translation-en [2,266 B]
Get:14 http://archive.ubuntu.com trusty-updates/restricted amd64 Packages [8,875 B]
Get:15 http://archive.ubuntu.com trusty-updates/main Translation-en [210 kB]
Get:16 http://archive.ubuntu.com trusty-updates/restricted Translation-en [2,266 B]
Ign http://archive.ubuntu.com trusty/main Translation-en_US
Ign http://archive.ubuntu.com trusty/restricted Translation-en_US
Fetched 1,141 kB in 3s (296 kB/s)
Reading package lists... Done
ubuntu@ubuntu:~$ sudo apt-get install -y boot-repair && boot-repair
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
boot-sav boot-sav-extra efibootmgr gawk glade2script libsigsegv2 pastebinit
Suggested packages:
mbr mdadm clean-ubiquity boot-info os-uninstaller gawk-doc
Recommended packages:
gksu
The following NEW packages will be installed:
boot-repair boot-sav boot-sav-extra efibootmgr gawk glade2script libsigsegv2
pastebinit
0 upgraded, 8 newly installed, 0 to remove and 338 not upgraded.
Need to get 1,401 kB/1,429 kB of archives.
After this operation, 5,370 kB of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu/ trusty/main libsigsegv2 amd64 2.10-2 [15.0 kB]
Get:2 http://archive.ubuntu.com/ubuntu/ trusty/main gawk amd64 1:4.0.1+dfsg-2.1ubuntu2 [781 kB]
Get:3 http://ppa.launchpad.net/yannubuntu/boot-repair/ubuntu/ trusty/main glade2script all 3.2.2~ppa47~saucy [42.3 kB]
Get:4 http://ppa.launchpad.net/yannubuntu/boot-repair/ubuntu/ trusty/main boot-sav all 4ppa33 [392 kB]
Get:5 http://archive.ubuntu.com/ubuntu/ trusty/main pastebinit all 1.4-3 [14.9 kB]
Get:6 http://ppa.launchpad.net/yannubuntu/boot-repair/ubuntu/ trusty/main boot-repair all 4ppa33 [11.6 kB]
Get:7 http://ppa.launchpad.net/yannubuntu/boot-repair/ubuntu/ trusty/main boot-sav-extra all 4ppa33 [143 kB]
Fetched 1,401 kB in 7s (189 kB/s)
Selecting previously unselected package libsigsegv2:amd64.
(Reading database ... 169556 files and directories currently installed.)
Preparing to unpack .../libsigsegv2_2.10-2_amd64.deb ...
Unpacking libsigsegv2:amd64 (2.10-2) ...
Setting up libsigsegv2:amd64 (2.10-2) ...
Processing triggers for libc-bin (2.19-0ubuntu6) ...
Selecting previously unselected package gawk.
(Reading database ... 169564 files and directories currently installed.)
Preparing to unpack .../gawk_1%3a4.0.1+dfsg-2.1ubuntu2_amd64.deb ...
Unpacking gawk (1:4.0.1+dfsg-2.1ubuntu2) ...
Selecting previously unselected package glade2script.
Preparing to unpack .../glade2script_3.2.2~ppa47~saucy_all.deb ...
Unpacking glade2script (3.2.2~ppa47~saucy) ...
Selecting previously unselected package boot-sav.
Preparing to unpack .../boot-sav_4ppa33_all.deb ...
Unpacking boot-sav (4ppa33) ...
Selecting previously unselected package boot-repair.
Preparing to unpack .../boot-repair_4ppa33_all.deb ...
Unpacking boot-repair (4ppa33) ...
Selecting previously unselected package boot-sav-extra.
Preparing to unpack .../boot-sav-extra_4ppa33_all.deb ...
Unpacking boot-sav-extra (4ppa33) ...
Selecting previously unselected package efibootmgr.
Preparing to unpack .../efibootmgr_0.5.4-7ubuntu1_amd64.deb ...
Unpacking efibootmgr (0.5.4-7ubuntu1) ...
Selecting previously unselected package pastebinit.
Preparing to unpack .../pastebinit_1.4-3_all.deb ...
Unpacking pastebinit (1.4-3) ...
Processing triggers for man-db (2.6.7.1-1) ...
Processing triggers for gnome-menus (3.10.1-0ubuntu2) ...
Processing triggers for desktop-file-utils (0.22-1ubuntu1) ...
Processing triggers for bamfdaemon (0.5.1+14.04.20140409-0ubuntu1) ...
Rebuilding /usr/share/applications/bamf-2.index...
Processing triggers for mime-support (3.54ubuntu1) ...
Setting up gawk (1:4.0.1+dfsg-2.1ubuntu2) ...
/usr/share/boot-sav/gui-g2slaunch.sh: line 33: hash: gksudo: not found
/usr/share/boot-sav/gui-g2slaunch.sh: line 35: hash: gksu: not found
ubuntu@ubuntu:~$

Once the Terminal actions have completed the Boot-Repair application will launch. Select the Recommended repair option and the tool will run for a few minutes doing its thing. When it’s completed it will provide a URL that you can paste in the Ubuntu support forums if the problem was not fixed and allow others to see the log file to help with troubleshooting.

Boot-Repair
Boot-Repair

After that just close Boot-Repair, eject the Ubuntu Live CD, and reboot your system. And voila, this time the GRUB menu will be presented and you can select and boot into Ubuntu like usual.

Read More

Spotify in Ubuntu

Those with a keen eye may have noticed Spotify running in the screen shot from my return to Linux post yesterday. As it turns out, installing Spotify in Linux (and I’m sure this may become a more common scenario as I delve deeper into Ubuntu) is not quite as straightforward as it is on Windows or Mac OS X. In fact, on their web site Spotify list Windows and Mac as the only supported platforms. However, all is not lost, as there are a few different ways to get Spotify running in Linux.

The first way is to use the Spotify Web Player, which provides a browser-based interface that allows you to run Spotify in all its glory without installing the application, thus removing any dependency on what operating system is used. All you need to do is navigate to https://play.spotify.com and login to start listening.

If you don’t fancy the web player and want to actually install the application in Linux, Spotify does provide a Spotify for Linux preview build, which basically means they do their best to provide an application for use in Linux but it’s not officially supported so it may be buggy and they’re not responsible if it doesn’t work. That said, I’ve been using it for a little while now and have not had any issues whatsoever. It works as flawlessly as on Windows or Mac. The installation was pretty straightforward, the preview web page has some Terminal instructions which worked a charm – the commands below entered in sequence:

jon@holato:~$ sudo gedit /etc/apt/sources.list

When gedit opens then add the Spotify repository to the file and save:

deb http://repository.spotify.com stable non-free

sources.list (-etc-apt) - gedit
sources.list (-etc-apt) – gedit
jon@holato:~$ sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 94558F59
jon@holato:~$ sudo apt-get update
jon@holato:~$ sudo apt-get install spotify-client

And that’s it. Spotify will be installed and in no time you’ll be able to launch and run it locally on your Linux desktop.

The final way to get Spotify running under Linux is to use Wine, and I must confess I don’t know much about this method at all however I’d be remiss if I didn’t mention it, but essentially it’s a program that allows applications designed for Windows to run on Unix-based operating systems.

And those are some of the various ways to run Spotify in Linux. Personally I prefer the second approach of installing the preview build but to each their own. The most important thing is that it works, and my dependency on Windows or Mac is reduced as one of my favorite, everyday programs works great in Ubuntu.

Read More