Recovering from Grub Rescue after upgrading to Ubuntu 11.04

Over the weekend I upgraded one of my computers to the new beta of Ubuntu. Upon restarting the computer I got dumped into grub-rescue with the message missing-xputs. Part of the cause of this was having Adobe CS3 installed in my dual boot with Windows 7.

When you install Adobe products a little DRM program called FlexNet gets installed into your boot sector which is also where grub resides. When grub is upgraded along with Ubuntu it flicks a warning about the FlexNet being in the sector but then continues to install. However, when you restart grub will not run and will be unable to boot your system into either Ubuntu or Windows.

The following instructions is a result of about five hours of googling, reading forums and talking to other linux geeks. The following commands should take about 15 minutes to complete.

This is how I got my system back:

Warning: I cannot gaurantee this instructions will work on your computer. Please read them all before continuing and take extreme care. I am not responsible if these instructions result in corrupt data or the loss of system functionality.

1. Boot to the LiveCD Desktop (Ubuntu 9.10 or later). Please note that the Live CD must be the same as the system you are fixing – either 32-bit or 64-bit.

2. Open a terminal

3. Determine your normal system partition

sudo fdisk -l

4. Mount your normal system partition:

sudo mount /dev/sdXX /mnt
Example: sudo mount /dev/sda1 /mnt

5. Mount the critical virtual filesystems:

sudo mount -B /dev /mnt/dev
sudo mount -B /dev/pts /mnt/dev/pts
sudo mount -B /proc /mnt/proc
sudo mount -B /sys /mnt/sys

6. Chroot into your normal system device:

sudo chroot /mnt

7. Attempt to install grub

apt-get install grub-pc grub-common

During install a warning should appear about FlexNet being in one of the sectors. In my case it was sector 51, others have reported it in 32 and elsewhere.

8. Purge grub

apt-get purge grub-pc grub-common

9. Remove the flexnet sector

dd if=/dev/zero of=/dev/sda bs=512 count=1 seek=X

Where X is the sector number grub-install warned about, in my case 51.

10. Reinstall grub

apt-get install grub-pc grub-common

11. Exit chroot

CTRL-D

12. Unmount

sudo umount /mnt/dev/pts
sudo umount /mnt/dev
sudo umount /mnt/proc
sudo umount /mnt/sys
sudo umount /mnt

13. Reboot

sudo reboot

Further References:
https://help.ubuntu.com/community/Grub2#Reinstalling%20GRUB%202
http://ubuntuforums.org/showthread.php?t=1661254

Getting ATI Radeon HD Drivers to work in Ubuntu 10.04 Beta 1

These instructions will hopefully help those who are testing the Beta over the next few days to get full hardware acceleration from their graphics cards.

These instructions are based off Ubuntu’s guide here: https://help.ubuntu.com/community/RadeonHD and I can only comment on my set up, I cannot guarantee that they will work for anyone else.

Firstly make sure that you graphics card is not already working properly, in a terminal type:

glxinfo | grep “renderer string”

If you see “software rasterizing” as the output then the drivers are NOT working right, if you see something else then they most likely are.

First prepare your system for installing the new drivers, do this by removing the old drivers and making sure you have the right libraries installed:

sudo sh /usr/share/ati/fglrx-uninstall.sh

If the file cannot be found then it is good, just means the driver was never installed in the first place.

sudo apt-get purge xorg-driver-fglrx fglrx-amdcccle fglrx-kernel-source xorg-driver-fglrx-dev

Package not found errors here are also really good.

sudo apt-get --reinstall install libgl1-mesa-glx xserver-xorg-core

Make sure that the reinstall of these two packages completes properly. (Note: the reinstall flag has two – before it not one, some web browsers render the double dash as a single long dash).

Next you need to install a new Kernel, Ubuntu 10.04 will ship with 2.6.32 but at a minimum (at the moment) you need 2.6.33, this is simple to do though:

cd ~/

mkdir kerneldebs

cd kerneldebs/

wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v2.6.33/linux-headers-2.6.33-020633-generic_2.6.33-020633_amd64.deb http://kernel.ubuntu.com/~kernel-ppa/mainline/v2.6.33/linux-headers-2.6.33-020633_2.6.33-020633_all.deb http://kernel.ubuntu.com/~kernel-ppa/mainline/v2.6.33/linux-image-2.6.33-020633-generic_2.6.33-020633_amd64.deb

sudo dpkg -i linux*

Now reboot and make sure that you boot into the new kernel and not the old one.

Add the following address to your systems software sources:

ppa:xorg-edgers/ppa

Reload the sources list when prompted, then go to update manager, check for new updates, install all the new updates that are listed. Once installed reboot your system.

Now try “glxinfo | grep “renderer string” again and hopefully it will no longer display software raster and instead something a lot more promising.

Ubuntu 10.04 Lucid Lynx First Impressions

Sometime in the next 24 hours Beta 1 of Ubuntu 10.04 Lucid Lynx will be released to the world. This version of Ubuntu is different from the previous few versions for two key reasons the first is that it is a long term support release and as such will be [hopefully] more stable and more complete than other versions over the past year. The second change is in the user interface with a step away from the established brown “human” theme to a new theme that looks very Mac OS like.

For the last two days I have been running the daily build of the AMD64 release candidate for 10.04 Beta 1. So far I am very impressed with it. For the past year I have been running 9.04 as the 9.10 release in October of last year broke support for my laptop’s wireless drivers and would cause frequent lock ups. I am pleased to report that those crashes are a thing of the past in 10.04.

The Good:

  • Fast boot. 9.04 was a massive improvement in boot time over 8.10 and I am surprised to see even more of an improvement in 10.04, from BIOS to logged in would be around 20 seconds.
  • Stable. Sometimes Beta and Test Releases of software are so buggy that they are not even able to be fully tested. So far I have hit a few minor problems but by far I am very impressed.
  • Smooth. The x64 version is very smooth at booting, opening and closing windows, applications, etc. The entire operating system runs quietly and quickly.

The Bad:

  • Crash errors that are almost as cryptic as Windows BSOD and illegal operations. I have had two programs crash and both times the crash errors are just strings of numbers or error codes with no meanings or descriptions. It is very hard to even supply information on a bug report when you have no idea what went wrong, one minute it was working the next it isn’t.

The Ugly:

  • Video Drivers. I am running an ATI Raedon HD Video card and there are no free or propriety video card drivers at the moment. This means that any 2d or 3d video rendering is done through MESA software rendering and is very ugly. I hope this will be sorted out in the final release (and the current bug where if you try to install the old fglrx library aptitude will try to remove ubuntu desktop).
  • Software Install. If you want to install Ubuntu (and community) released software this is a breeze through the Ubuntu Software Manager but the instant you want to install any other piece of software you will need to go through the whole process of getting the source code, resolving dependences, compiling through the terminal sorting out linking errors and a whole lot of other nasty mess.
  • User Experience. Despite the new version of Ubuntu looking very pretty and running very fast it still fails badly in terms of user experience for your average user. Ubuntu is meant to be linux for human beings but I am still finding it linux for those people who want linux to work and have some computing knowledge for how to fix things when they go wrong and also have a linux geek to really fix things when they completely corrupt. Until vendors start releasing fully stable and supported drivers for Linux and there is a software install process for third party applications that works nicely through a simple GUI and not old fashion command windows Ubuntu and Linux in general will continue to only attract nerds, geeks and people who like to break things. I like Ubuntu for its speed and ease of use in a office/development environment. But when I am at home on the weekend I live in Windows. Things just work in Windows – fonts render correctly, most software now plugs and plays correctly, most music and dvds will just play, software is simple to install etc. Now I do not want to start a paid vs free software argument but just because it is free should not mean you need a whole lot of computing knowledge to get your email every morning.

Simulating / Emulating a MPI Cluster or Supercomputer under Ubuntu Linux

Okay a few posts ago I mentioned that I had been successful in setting up my laptop as a virtual supercomputer.

Here are hopefully some relatively clear instructions on how simple it was to do.

Setting up a MPI development system on Ubuntu Linux

  1. Download Ubuntu – check out the latest version at www.ubuntu.com

  2. Intall the required mpi files.

    For Ubuntu 9.04:
    In a terminal window enter:
    sudo apt-get install libopenmpi1 libopenmpi-dbg libopenmpi-dev openmpi-bin openmpi-common openmpi-dev

    For Ubuntu 10.04:
    In a terminal window enter:
    sudo apt-get install libopenmpi1.3 libopenmpi-dbg libopenmpi-dev openmpi-bin openmpi-common openmpi-dev

  3. Test the mpi install by compiling and running a simple program

    1. mpicc testfile.c -o testfile

    2. mpirun -np 2 ./testfile

      1. Where np is the number of cores * number of processes on your system.

      2. e.g. on a two core laptop np should be 2.

  4. If you get an error regarding ssh when you enter the mpirun command install ssh

    1. sudo apt-get install ssh

  5. If you get requested for your password everytime you run mpirun set up a stored RSA key control

    1. cd $HOME

    2. ssh-keygen -t dsa

    3. cp .ssh/id_dsa.pub .ssh/authorized_keys2

Further reference:

http://www.csc.cam.ac.uk/academic/practicals.html

http://www.math.umbc.edu/~gobbert/mpi.html