Programming Blog

Jeremy Morgan

Mostly Coherent Ramblings of a Silicon Forest Software Developer

Setting Up the Adafruit Huzzah ESP8266 Breakout

Recently I showed a friend of mine some of the projects I’ve working on with Arduino and Wifi, and he introduced me to the ESP8266 chip. I found them all over the internet ranging from $1.50 US to $20, with a variety of configurations and manufacturers. I decided to go with a company I trust, Adafruit Industries, and see what their offering is like.

Failed Request Tracing With IIS

A great tool I’ve discovered recently is the Failed Request Tracing Tool is IIS. If you’re building an ASP.Net application and having issues with requests it’s a fantastic tool. I’ll show you how to use it.

Getting Started With Adafruit IO


Raspberry Pi Newsletter


Earlier this year Adafruit Industries put their IoT dashboard Adafruit.IO into Beta, and it looks pretty cool. I’ll show you how to set up a dashboard using one of my mini weather station designs for data input. You may remember this project from a few months ago. I’ll be adding yet another endpoint to the project on Adafruit.IO.

How to Add WiFi to Your Arduino


Raspberry Pi Newsletter


If you want to add internet connectivity to an Arduino, you have quite a few options. Since most Arduino models are not bundled with Ethernet or WiFi a market has developed for it, and I decided to try one out and share my thoughts.

For this article I’ll be using the Adafruit CC3000 breakout board found here. For the platform I’m using an Arduino Mega 2560 I received from Newark element14.

How to Build a REST API With Python

In this article I will describe the process I used to create a new endpoint for my Raspberry Pi weather station, and how I set it up to to use Python and MariaDB for storage. I set this up as an endpoint for one of my IoT projects and thought I’d share the results.

How to Restore Arch Linux Boot After Installing Windows

This week they released the RTM Version of Windows 10, and I decided to install it on my laptop. Most of my development is done on my desktop Mac at home, but the laptop is good for collaborating, coffee shop coding, etc. I decided Windows 10 and Visual Studio 2015 would be good for this. There’s only one issue: I also have Arch Linux on this laptop, and it’s dialed in very nice and I definitely don’t want to remove it.

How to Restore Arch Linux Boot After Installing Windows

This week they released the RTM Version of Windows 10, and I decided to install it on my laptop. Most of my development is done on my desktop Mac at home, but the laptop is good for collaborating, coffee shop coding, etc. I decided Windows 10 and Visual Studio 2015 would be good for this. There’s only one issue: I also have Arch Linux on this laptop, and it’s dialed in very nice and I definitely don’t want to remove it.

I haven’t upgraded Windows on this machine since I put Windows 8.1 on it over a year ago, so I never had to deal with the issue of fixing grub. It is slightly different from other distributions, and there is no “boot repair” yet. I decided to Google a few things and figure out how to restore it but didn’t find a complete article on it, so I decided to write one. I installed Windows 10 on the machine without changing any of the partition data, and that’s crucial. After doing that it would only boot into Windows 10, so here’s what I did.

1. Download an Arch Linux ISO

Download a live ISO for Arch Linux here. If you’re using Windows, LiLi is a great free tool for creating bootable Linux USBs.

boot to this USB drive and you’ll be taken to a command prompt.

2. Restore Grub

This assumes of course that you were using GRUB to begin with, but here’s how to restore it.

Find the partition your linux is installed on:

1
cfdisk

You’ll see something like this:

How to restore GRUB in Arch Linux

In my case my Linux installation is at /dev/sda4. Note where yours is, then exit this application.

So mount your Linux partition:

1
mount -t ext4 /dev/sda4 /mnt

Then, change root with this command (specific to Arch Linux)

1
arch-chroot /mnt

and restore GRUB:

1
grub-install /dev/sda

And yes, it does detect Windows 10 properly.

After you reboot, you’ll see your familiar boot screen again:

How to restore GRUB in Arch Linux

And you can now boot into Linux (or Windows) again.

Configure Grub

Now if you’re like me (which you probably are if you’re reading this blog) you will be bothered that it incorrectly says “Windows 8” or whatever your previous version was. This is easy to fix by editing some entries in your Grub configuration:

Make a backup of your grub.cnf

1
sudo cp /boot/grub/grub.cfg /boot/grub/grub.cfg.8.1

Edit the file:

1
sudo nano /boot/grub/grub.cfg

Look for the Windows 8 or Windows 7 entry in the file:

How to restore GRUB in Arch Linux

and change it to whatever you want. Then reboot. Now it should look like this:

How to restore GRUB in Arch Linux

This is how I have mine set up. If you’d like to learn more about GRUB menu options click here.

Summary

This is how you can restore your dual boot options if you reinstall or upgrade Windows on a dual boot Arch Linux system. I have heard of people just reinstalling Linux afterword, and it’s a terrible idea unless you were going to change it anyway. It only takes a few minutes to fix.

A note about Arch Linux:

As I said in the article I have Arch Linux installed and it’s “dialed in” meaning I have a nice system compiled with only what I need, lean custom kernel, and my development environment is all set up. I wouldn’t advise an Arch install to everyone, but it has been fantastic for me personally. It runs very fast and reliably and it’s easy to update everything.

If you’re looking for a new disto, or just want to escape the Ubuntu crowd, you should give it a try. IT has a steep learning curve as you’ll need to know Linux really well, or be able to follow the directions explicitly, but if you do you’ll find a nice solid system that’s fast and lean.

Get Arch Linux Now

-Jeremy


Do you like articles like this?

I’m constantly hacking on stuff and writing about happenings in the programmer world. You can subscribe to my feed here, or you can get the hacker newsletter 100% spam free!

You can also follow my projects on GitHub: