Monday, December 26, 2011

Fedora 16 - Uninstall proprietary Nvidia driver and switch back to Nouveau

If you have an Nvidia graphics card, then one of the first things you'd probably do after installing Fedora is to disable nouveau driver and install the Nvidia proprietary driver. The easiest way to do this is using the packages from RPMFusion.

But if you happen to be unlucky like me, you'd have KDE apps (and some others too) crashing all around the place with this proprietary Nvidia driver. Apparently, there's some compatibility problem between glibc and the Nvidia driver. Switching back to nouveau is the best way out.

Here's how to uninstall the proprietary Nvidia driver from RPMFusion and get back to nouveau driver.

  1. Switch to a terminal by pressing Ctrl+Alt+F3 and login as 'root'
  2. Switch to runlevel 3 (terminate X):
    init 3
  3. Get a list of all nvidia packages installed:
    yum list installed "*nvidia*"
  4. Remove these packages. Use the following sample command:
    yum remove kmod-nvidia kmod-nvidia-PAE nvidia-settings nvidia-xconfig xorg-x11-drv-nvidia xorg-x11-drv-nvidia-libs
  5. Confirm that none of the following files exists. If they do, delete them or move them to some backup location.

  6. Re-create initramfs to remove the blacklisting of nouveau
    dracut --force
  7. Reboot the computer

The above steps worked for me and brought back nouveau. All these days, I was waiting for the proprietary driver to be fixed. In the mean time, I was using LD_PRELOAD=/usr/lib/ in my profile file to avoid the crashes. But so many days have passed without any improvement. With nouveau, I get reasonable 3D performance and desktop effects. Best of all, no crashes :-)

Wednesday, December 21, 2011

Kochi Flash Mob - No Hate Mate!

This happened last week - 16th Dec, 2011 at the Oberon Mall, Kochi. Over 150 dancers took to the floor - for a noble cause.

With the Mullaperiyar issue going viral and threatening the livelihood, and more importantly the lives, of people, it's heartening to see such efforts. Kudos to the organisers!

I'm supposed to travel to Kanyakumari district on official business tomorrow. Who knows what awaits me at the border!

PS: The music and choreography reminds me of Step Up 3. May be it was indeed inspired from the movie.

Saturday, December 3, 2011

Fedora 16 / Windows 7 - Dual booting with GRUB2

Fedora 16 was released almost a month back. This is the first Fedora release to have switched to the GRUB2 boot loader. I had some trouble installing Fedora 16 - the boot loader won't get installed on my MBR since there wasn't enough space to accommodate the boot image. The details of my struggles can probably be the subject of another post. Here, it must suffice to say that I had nuked my first partition, containing Windows 7, to make sufficient space (unallocated sectors) at the beginning of the HDD for grub2 boot image.

After installing F16, I reinstalled Windows 7 on to the first partition on the HDD. Everything was fine, except, unsurprisingly, that it replaced grub2 boot loader with its own.

Getting back grub2 to boot Fedora was a matter of doing this:
  1. Boot using Fedora 16 DVD
  2. Select 'Troubleshoot' and use the 'rescue mode'
  3. Let Anaconda autodetect existing Linux installations, and when prompted, select your F16 installation from among the multiple existing installations
  4. Read the message that says the partition has been mounted under /mnt/sysimage and I could do: chroot /mnt/sysimage if I wanted
  5. Do exactly that:
    chroot /mnt/sysimage
  6. Reinstall GRUB2 on to my MBR:
    grub2-install /dev/sda
  7. Reboot and viola! I was able to boot in to Fedora again :-)

That being said, should I be able to boot in to Windows 7 now? I wasn't! This one was a bit surprising since old grub-install used to auto-detect other operating systems and made everything work. Things have changed, and apparently for the worse!

After booting in to F16, I tried to get Windows entry in to GRUB2 menu. After reading a little bit, here's what I should've done:

  1. Make sure a package called os-prober is installed:
    yum install os-prober
  2. Back-up my existing grub.cfg file
    cp /boot/grub2/grub.cfg /boot/grub2/grub.cfg.bak
  3. Re-create the cfg file, hoping grub2 would autodetect Windows
    grub2-mkconfig -o /boot/grub2/grub.cfg
  4. Reboot and hope it works
It seems that the above four steps would've worked. If you reached this page after searching for a way to dual boot Fedora 16 and Windows 7, this is exactly what you should do.

As for me, I did a lot of other stuff:
  1. Assume that grub2 was unable to auto-detect Windows and I should do it manually
  2. Add the following entry in /etc/grub.d/40_custom

    menuentry "Windows 7" {
    insmod ntfs
    set root=(hd0,1)
    chainloader +1

  3. Find the wrong grub2 configuration file at /etc/grub2.cfg and replace it with:
    grub2-mkconfig -o /etc/grub2.cfg
  4. Reboot and find that Windows entry is still missing
  5. Boot back in to Fedora and find that /etc/grub2.cfg indeed contains the entry for Windows
  6. Re-install grub2 in a desperate attempt:
    grub2-install /dev/sda
  7. Reboot and find that nothing has changed
  8. Search the internet and repeat steps 4-7 above without any use
  9. Again verify /etc/grub2.cfg and find that there are in fact two entries for Windows 7 - one that I added manually and one, wait for it, auto-detected by grub2 (os-prober)! Apparently, the assumption I made in step-1 was wrong and step-2 wasn't really necessary!
  10. Get back in to the reality that Windows entry is still missing in grub2 boot menu even though it appears in the cfg file
  11. Search more and stumble up on a bug report that indicates /boot/grub2/grub.cfg is the right grub2 file for Fedora!
  12. Do it  right this time with:
    grub2-mkconfig -o /boot/grub2/grub.cfg
  13. Reboot and find that everything's merry

Apparently, /boot/grub2/grub.cfg is the real file that grub2 uses. On Fedora, /etc/grub2.cfg is a symbolic link to /boot/grub2/grub.cfg.
But if that's the case, then everything should've worked when I used grub2-mkconfig to overwrite the file in /etc, right? Again, as my luck would have it, grub2-mkconfig is buggy in that it doesn't follow the symlink. It just replaced /etc/grub2.cfg with a real file - a file that nobody cares about!

So, if you find that the entries you very clearly see in the cfg file are missing in the boot menu, check if you're using the right cfg file.