Saturday, May 19, 2007

Reinstalling GRUB in Ubuntu Feisty Fawn

After reading from many forums and mailing lists, these are the steps I used to reinstall GRUB in Ubuntu.

1. boot using the Live CD
2. open terminal
3. sudo mkdir /mnt/ubuntu
4. sudo mount /dev/hdxn /mnt/ubuntu (replace hdxn with the device where you have installed Ubuntu, mine is hdb5)
5. sudo chroot /mnt/ubuntu
6. type 'sudo grub' and then Enter, you will see grub prompt ('grub>')
7. find /boot/grub/stage1 (please remember the output)
8. root (hdn,n) -> replace with the output from step 7
9. setup (hd0) -> install the grub in MBR
10. quit

Restart your computer and voilaaaa.... grub is installed!

Saturday, May 05, 2007

Installing nVidia driver in Ubuntu

Probably installing nVidia driver in Ubuntu is the toughest thing to do. I have followed the exact steps as described in the nVidia website, trying many methods which I read from googling around. This is the one which actually works!

Note: I am using old nVidia (GeForce2 GTS) and Ubuntu 7.04 (Feisty Fawn)

First, download nVidia driver from http://www.nvidia.com/object/unix.html. My graphic card is old, so I used the driver which supports it (version 1.0-7185).

The installer complained that it could not find a binary module which matched my kernel, so I had to compile it manually. Before doing that, make sure that you have g++ installed.

First, you need to disable the restricted module since it will load in the beginning and throw errors. This is the most important thing to do. I have read many weird suggestion from the internet, including uninstalling it! I tried it and guess what? My computer crashed! So, here is the right thing to do:

sudo vim /etc/default/linux-restricted-modules-common

Change this line 'DISABLED_MODULES=""' to 'DISABLED_MODULES="nv"'. Save the file and exit. With this step, the 'nv' module for nVidia graphic card will not load next time you boot your Ubuntu.

Second, you need to boot to prompt only, do not login until the GUI. The method I used was renaming gdm, so when you reboot it will throw error and stop loading the GUI.
Command: sudo mv /etc/init.d/gdm /etc/init.d/gdm.bak

Third, boot your computer, login through the prompt, go to the location where you downloaded the nVidia driver and run this: sudo sh nVIDIA* Build the driver and follow the instructions in the README file.

In short, the README file will ask you to do:
- sudo vim /etc/X11/xorg.conf
- make sure you have 'Load "glx"' line
- delete line which says 'Load "dri"'
- delete line which says 'Load "GLCore"' too
- change 'Driver "nv"' with 'Driver "nvidia"'

Save the file and restart your computer. Voila...

This method is inspired from:
http://www.ubuntugeek.com/how-to-fix-nvidia-acceleration-in-feisty-nvidia-8800-and-legacy-users.html