Thursday, June 11, 2015

Dual Boot Adventures: Windows 8 and Ubuntu

Perhaps you read my previous post about upgrading my laptop by installing an SSD? I had installed an Ubuntu Linux OS at the same time using a USB.  I did not immediately prepare for dual booting. Instead, I set up a development environment in order to attend to a higher priority project - getting my website set up and online! That process was an adventure in itself that I will discuss in a future post.  In retrospect, I should have set up the dual boot functionality beforehand to save time, as most online tutorials suggest installing a Windows OS first, then the Linux. Since I had already set up my Ubuntu to my liking, I decided to try and find a tutorial where the Linux was installed before Windows.

In my first attempt, I followed a random recipe of advice from various tutorials and forum threads (like this one, and this one). Each one seemed to have minor details missing or added that were not found in other tutorials.  I started by making a backup of my current machine.  Then I followed the common advice to use GParted, which at the time, seemed like a scary IT word for "hey, you're going to break your computer".  I now understand it as a Linux version of Disk Manager in Windows. I used GParted to allocate a slice of the disk to the new Windows OS and formatted it to NTFS (the file system format that Windows uses, as oppose to FAT used in Linux).  Then, as in step 5 of my previous post, I entered the BIOS and changed the boot order to the Windows 8 DVD installer.  From there I followed the installation wizard, selected the installation partition, and voila! Windows 8, with the inconvenient side effect of erasing grub, so I had to reload Ubuntu from the USB and install boot repair (this process is shown in the second answer of this forum thread).  Afterwards I had a clean install of Ubuntu and of Windows, and the dual boot system was working.  I restarted the computer and easily selected whether to use Windows or Ubuntu. I did it!

 In my naive mind, all I had to do after that was run my backup to retrieve my previous Ubuntu set up and files. What's that new trend about failing fast? I think I nailed it! I managed to undo all my work within a few seconds. At first glance it appeared to work.  I had a functional Ubuntu, complete with my previously set up dev environment and files. Not until I restarted the computer, did I realized the dual boot set up (including Windows) had been erased/overwritten by the previous "whole disk" set up of my backup (at least, I think that's what happened?).  Good thing I consider these projects adventures because otherwise I might have been very upset.  Instead, I saw it as a blank slate and decided to tackle the recommended dual installation order (which turned out to be much easier!).

I booted the computer from the Windows 8 installation CD and set Windows up as normal.  Then I used Windows Disk Management to shrink the Windows partition as described in this very informative tutorial.  In step 5, it says to turn off secure boot in the BIOS, however my Lenovo did not have this option, so I skipped it (spoiler alert! ...it still worked).  Again, I changed the boot order in the BIOS, booted from the Ubuntu USB, and followed the installation instructions, which included the option to select which disk partition to put Ubuntu in.  At this point my experience differed from the tutorial mentioned above, as Ubuntu immediately recognized the dual boot configuration and asked if I wanted to install alongside Windows. Obviously I selected yes, and thanks to the wonders of modern technology, the rest of the process was done magically behind the scenes, leaving me with only the satisfaction of having my dual boot system back in working order.  In the interest of saving time, I set up my dev environment from scratch again. Luckily I had all the important files saved on a USB so I could easily transfer them back to the computer.

Now I am proud to say I have the choice to work in either Windows or Linux, and am becoming better at navigating the Linux terminal and Windows command line. Some might wonder why I did not opt to run a virtual machine with either OS on it instead.  I chose dual boot because according to my research, my Lenovo does not have the proper hardware to support the hefty VM processing needs.  Perhaps one day when I'm rich, I'll buy an i7.





1 comment:

  1. Nailed it! Wish I could run Ubuntu, but my machine needs windows to run my design tools.

    ReplyDelete