Monday, May 31, 2010

Windows 7 - (K)Ubuntu coexistance nightmare

I had been running Windows and Kubuntu on a dual boot configuration for a long time now. My current Presario CQ60 laptop came with Windows Vista pre-installed. When Windows 7 was launched, I got a copy for the $50 promotional price. I use Grub2 as the default boot manager.

I use Kubuntu as my primary OS and only log into Windows 7 mostly for applying updates, which is why I didn't bother to investigate when windows 7 did not start without restarting the computer 3 - 4 times. Then one day, I decided to install Visual Studio 2010 Express editions. The first part of the installation requires restarting the computer to apply come settings and then continues to complete the rest of the installation. Except, for me, the computer went into a restart frenzy. I tried safe mode with no luck. The 3 - 4 restarts turned into 7 - 8 before letting me log into windows. When starting in Safe Mode, I noticed that the last driver that was loaded before the computer restarted was classpnp.sys. Bing-ing and Google-ing "CLASSPNP.SYS Windows 7" made chills run down my spine.

With no solution available on the Internet, I decided to reinstall Windows 7. I got Windows back, but my home partition (/home) I use with Linux went missing. GParted listed it as "Unallocated." My months and years worth of work went poof! I also noticed some issues with my partition table. I had restructured my HDD earlier to increase the size of the /home partition and ever since, certain partitions in the partition table had overlapping boundary sectors. TestDrive utility bundled with PartedMagic came to the rescue. I got my /home partition, and hence, Linux installation back, but the Windows 7 restarting issue came back as well. And this was a fresh OS install with no additional software installed yet. Moreover, GParted listed the entire 250GB HDD as unallocated. My partition table was messed up.

Next few were some of the most painstaking days of my life. I had an external HDD with not nearly as much space as I needed for my /home partition, not even after tar.gz-ing all the files. I knew that sacrifices would have to be made. After leaving behind all the application configuration files and downloads, I managed to copy my most valuable content to the external HDD. I wiped the 250GB HDD clean and installed Windows 7 64-bit on 100GB partition. Then I reinstalled Linux, and restored my files to the new 100GB /home partition. Linux installation make Grub2 as the default boot loader. The nightmares returned.

Windows 7 was back, and so was the problem with multiple restarts. I decided to install Windows 7 32-bit to see if that resolved the issue. Once installed, I restarted my computer multiple times to see if the issue was still there. To my surprise, Windows behaved this time. Excited about this, I restored Grub2 using the LiveCD of Kubuntu. Soon enough the grin on my face turned into a frown. It appeared that as long as Windows got to hold the MBR with its boot loader, it was happy. However, when Grub2 took over, Windows started throwing a fit.

I decided to let Windows boot loader hold on to the MBR. I followed Method two from:

http://www.sevenforums.com/tutorials/668-system-recovery-options.html

Once on the Command Promt, I browsed to the Windows System32 folder. I issued the following command to restore MBR:

bootsect /nt60 c: /mbr

I now had to figure out how to chain load Grub2 from windows boot loader. I came across this article:

http://ubuntuforums.org/showthread.php?t=208951

Three differences I found with the configuration addressed in the article and mine were:

  1. No separate /boot partitions
  2. Grub2 instead of Grub Legacy.
  3. No boot.ini in Windows 7 which I did not realize until much later

I decided to improvise. I understood that I needed the boot sector with Grub2 installed on it. After installing Grub2 to the external HDD /dev/sdc, I issued the following command:

sudo dd if=/dev/sdc of=/home/{my-user-id}/Desktop/kubuntu.lnx bs=512 count=1

I then copied the kubuntu.lnx to the root directory on the Windows 7 partition and restarted the computer into Windows to rig the boot.ini. Here I ran into the issue with no boot.ini in Windows 7. I research and came across this article:

http://apcmag.com/how_to_dualboot_vista_with_linux_linux_is_already_installed.htm?page=5

EasyBCD tool seemed promising. I promptly installed it and followed the instructions when I ran into another brick wall. EasyBCD was not Grub2 compatible. It only worked with Legacy Grub. However, I noticed that a new entry was added to Windows boot loader options and it referred to NeoGrub.mbr file residing in C:\NST folder. It was time to improvise again. I renamed the original NeoGrub.mbr file to NeoGrub-bak.mbr effectively breaking the reference and renamed my kubuntu.lnx to NeoGrub.mbr. With my fingers crossed, I rebooted the laptop. It worked! I was able to load Kubuntu using the Windows boot loader. I haven't had the restart issues ever since. I've also updated the boot option description from "NeoSmart Linux" to "Kubuntu" and changed the file path from C:\NST\NeoGrub.mbr to C:\kubuntu.lnx.

Few things to note. The restart issue is not limited to dual/multi boot configuration in Windows Vista/7. People have also reported this issue to be related to certain hardware, mainly with NIC and VGA. While the problem seems to be resolved for now, I am not sure if I've seen the end of the multiple restarts.

Sunday, May 30, 2010

Turned to the Dark Side

I've been using Linux, Ubuntu more specifically, as my primary OS since the past few years. KDE has been my favorite Display Manager. I've always preferred bright desktop themes over dark ones and blue has always been my favorite color for wallpaper. Changing desktop themes and color schemes are like making a lifestyle change. Unless one is satisfied with its every aspect, one can not continue with it for too long. Every ones in a while, I would try dark backgrounds and themes but get quickly displeased and switch back to the original "Oxygen" and "Air" themes. One major factor was that one perfect color scheme that would complete the theme.

This past week when I had to rebuild my laptop, I decided to give a dark theme another shot and spent some time on tweaking the colors to see if I could find the right mix. I finally did. I switched from the default "Air" theme and the default color scheme to "Arezzo" theme and "Obsidian Coast" color scheme. I even changed from the default icon set to "OSDark-K" set. And while I was writing this article, I came across the "Obsidian Coast Cursor set."

Note that the above themes and schemes are for KDE based Linux distributions.





Saturday, May 29, 2010

Karim Who???

I am a full time programmer. I primarily work with .Net, Java, and C++ languages. My interests lie in distributed computing, large volume data transformation and migration, applications for handheld devices, and cloud based application hosting.
I use Linux on my computers. I still maintain a Windows partition for those difficult situations.
I am a big fan of Doctor Who series (hence, the Who in title :) ), especially the Tenth Doctor as portrayed by David Tennant. My cell phone rings to the Doctor Who theme song, and it absolutely mesmerizes me every time someone calls me. Apart from being a Doctor Who fanatic, I also enjoy Torchwood, X-Files, Castle, 24, Family Guy, American Dad, and few other TV shows.
I co-founded Infinidigm LLC, based in Murfreesboro, TN. At Infinidigm, we handle data. We transform data for applications and move it from one system to another.
I also work for Wipro Gallagher Solutions, based in Franklin, TN, as an Implementation Specialist for their flagship product - NetOxygen.
Any thoughts or opinions expressed on this blog are solely my own and are not of any of my employers.

and also....

.... my local client works as well

By the way, I use Blogilo blogging client on a Kubuntu 10.04 64bit Compaq CQ60 laptop. And I've had to rebuild my laptop over past week. So, it has also got an Extreme Makeover..... and I am loving it.

Its Alive!!!!!

..... so lets blog :)