Goodbye Windows 10, Hello Ubuntu

I’ve had enough of Windows 10 and it’s stupid Updates policy.  Time and time again the system would reboot when it was actually doing something useful and after installing updates sometimes USB or the audio would not work.  I’ve observed this behavior not only on my PC but my girlfriend’s PC also.  Games were pretty much the only reason why I stayed with windows, but since I realized that Steam does offer games on Linux I decided to switch.  Like many people out there I still have a Windows VM for some bits and pieces that only work in Windows, but in general Linux is the way to go for me.

As with any Linux distribution there are always surprises along the way.  This is a record of my adventure with moving from Windows 10 over to Ubuntu 16.04.2 LTS (https://www.ubuntu.com/download/desktop).

To start of with I decided to do a dry run on a spare SSD drive.  So I formatted it and unplugged all other drives prior to installing from an USB stick.  The install went ahead without a glitch, but that’s when the fun started. My first impression of using Linux after about 10 years was one of surprise as to how far along it has gotten.  Ubuntu in particular seems to be fantastic.

Crashing on ‘Reached target Shutdown’

Boot-up time was quite slow and turning to the console I observed lots of messages to do with USB. I also noticed that the PC would not restart and would instead hang.

For a while I thought the cause could be the power supply with its USB cable, but that was not the case.

Could be happening because I have to ROG front panel plugged into USB56 and that is one of the USB devices I’ve disabled, yet the ROG unit continues to show data.

disable legacy USB 3.0

disable Asmedia USB

disabled USB 15-212….

Now I’m down to the 4 front-panel usb ports, 2 of which are USB and two USB 2.0 ports on the back.  All USB3.0 ports on the back are dead.

OC-ing breaks the file system.

Initially I setup my Linux install without any OC profiles, just used the stock BIOS config.  Having set up the install and getting to a point where I was happy with it, I decided to apply the over clock which I had in place before. By changing the base-clock I managed to break the file format and had to fsck it.  How on earth this happened, I have no idea. The only possible cause that comes to my mind is that the system crashed due to voltage issues during start up.  And yes, I think the system did crash a couple of time, which was odd because I restored an existing OC profile that has worked in the past.  I’ve given it a bit more voltage and now after the fsck the beast boots again.

Asmedia SATA controller and DVDRW

This one had me in tears. After running a single drive for about 5 days while I was testing Ubuntu, I’ve decided the time was right to finally rid myself of the Windows nuisance once and for all. I went ahead and installed Ubuntu on my main drive and tested it out. All went well.  I then formatted my older drive which I used for initial testing using the live CD. No problems.  Then I went on to plug in all my drives and this is where the fun began.

failed command: IDENTIFY PACKET DEVICE
 status: { DRDY }

I never ever suspected that a system could not start because it could not identify a device that is connected to a SATA port.  ASMedia seems to be sucking here, first the USB3 controller doesn’t work and now their SATA controller gives up when trying to identify a DVDRW.

Random system freezes

I noticed that after doing a clean install on my preferred drive the OS would lock up every so often.  The freeze was particularly brutal becuase it would even prevent the reset button from working. After a while of fiddling around I noticed that it would freeze when watching flash videos.  Then again sometimes it would blow up when watching an .avi file.  I began to suspect the Nvidia drivers so I changed them from the propriety ones to the open-source version – no luck.  Downgraded the open-source version – no luck. Disabled all plugins in Chrome – no luck.  At this point I was baffled because the same USB key install worked on a different drive without an issue. I ran the machine for 8 days, played videos and everything.

Turns out I had to enable the pre-release updates.  This issues was actually fixed by some package that was released after 16.04 was rolled out, but for some odd reason it’s not available with system updates unless you opt-in specifically to the ‘upcoming’ updates.  No idea which package it was unfortunately. Given that many people have reported this issue, even in older versions of Ubuntu, I would imagine it would have been a high-priority fix.

Some commands I used to install stuff

nvidia

log out and CTRL-ALT-F1

sudo apt-get purge nvidia-*
sudo add-apt-repository ppa:graphics-drivers/ppa
sudo apt-get update
sudo apt-get install nvidia-375

python

sudo add-apt-repository ppa:jonathonf/python-3.6 sudo apt-get update sudo apt-get install python3.6

java

sudo apt-get install default-jre
sudo apt-get install default-jdk

Gkrellm

sudo apt-get install gkrellm

MYSQL Workbench

sudo apt-get install mysql-workbench

Cisco VPN

sudo apt-get install openconnect

#For VPN UI (doesn't seem to work as well) 
sudo apt-get install network-manager-openconnect network-manager-openconnect-gnome

#To use: 
sudo openconnect <vpn_url>

Some useful config

slowing down the mouse (for some reason the default mouse speed is set to light speed)

xset m 2 2

keeping an eye on the temperature (you need to install lm-sensors and allow them to scan your PC to pick up sensors)

watch -n 1 | sensors

Monitor CPU Cycles

watch -n 1 "lscpu | grep 'MHz' | awk '{print $1}'"

Keep an eye on gfx card temperatures

watch -n 1 nvidia-smi -q -d temperature

Using stack trace to see what programs are doing

strace -f /usr/bin/sensors 2>&1

Copy files to your instance

sudo scp -i <path to key>.pem <path to file> ec2-user@<hostname>:

Note: that semicolon at the end means the file will go to the specified user’s home directory

Adding Google docs support for Nautilus:

 sudo apt install gnome-control-center gnome-online-accounts 

One thing to keep in mind here when using Unity is that you need to open the Gnome Settings controller and not the Unity one.  They icons are the same (the system cog), but the Unity version is called System Settings, while the Gnome version is just called Settings.  Both windows show the same thing, but you will notice that the Online Accounts icon differs and the UI the Gnome controller launches is the correct version.

When running Ubuntu on a VM and it doesn’t show the default resolution: 2560x1440p:

xrandr --newmode "2560x1440_60.00" 311.83  2560 2744 3024 3488  1440 1441 1444 1490  -HSync +Vsync xrandr --addmode Virtual1 2560x1440_60.00

Very useful links:

http://askubuntu.com/questions/765974/chrome-freeze-very-frequently-with-ubuntu-16-04

Create a file and add text to it:

sudo sh -c “echo some text has been written > /mnt/data-store/file.txt”

Using tee

echo “/dev/sdf /mnt/data-store ext3 defaults,noatime 1 2” | sudo tee -a /etc/fstab