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

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.

Adventures in the land of building Google Chrome OS

Okay I have now been working through the process of building Google Chrome OS for a little more than 12 hours. My main desktop computer has been on all night trying to sort out the development build environment so the code can be compiled. It does not help that we went over our data cap a few weeks back and are stuck on 64k internet until mid next week this makes downloading the required files ultra slow.

The build instructions provided by Google so far are quite clear and straightforward to follow. However, they are not very detailed. There are no timings for each step of the process or information about what each step does. So far I have downloaded the full source code (270mb) at uni so I would not have the dial up speed internet problem. However in order to compile the code it is required a strict development be provided. As such the compiling script creates a debootstrap environment virtualizing a minimal Debian OS. While this is a cool feature designed to ensure every build remains consistent it is a pain that this is not explained before the start of the process because the amount of data required to set this up is a lot more than the entire source code for the operating system.

Because the process of building from scratch is so long there has been a build snapshot uploaded onto The Pirate Bay. This is a good idea and I have seen on a few blogs comments that Google should be releasing a nightly build snapshot of the compiled OS. While this takes away the fun of building from scratch it does make testing the OS a lot more accessible. It is something I hope Google implement soon.

Hopefully my next blog on the OS will be a little more positive and lot more further down the building track.

Google Chrome OS goes open source available now

I have something to play with over the weekend.

Around two hours ago Google released the source code to their new operating system.

I am going to download it later today and will set about compiling and organising the installation of it.

For more info: http://googleblog.blogspot.com/2009/11/releasing-chromium-os-open-source.html?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+blogspot%2FMKuf+%28Official+Google+Blog%29&utm_content=Google+Reader

Thoughts on Google Chrome OS

It was interesting returning to Auckland on Thursday night to find out that in the past few days the world has completely changed. Yes Google has finnaly let the cat out of the bag (but I think it actually escaped months ago) that it was developing an operating system to rival Windows.

Google Chrome OS is not planned to be released until late 2010 however the source will be released later this year (so in some ways you could start using it later this year). The full announcement is here: http://googleblog.blogspot.com/2009/07/introducing-google-chrome-os.html

The points that I am most interested in are:

  • This is not Google’s first OS, in fact it is their third. In house they use Goobuntu (http://en.wikipedia.org/wiki/Goobuntu) which is a modified version of Ubunutu Linux. And at the end of 2008 they released Android an open source operating system for cellphones, and it rocks.
  • Cloud Computing. The operating system is going to be very light weight on the end users system and plug directly into the internet. This is going to be a lot like the Android where it is always on and things are straight away at your finger tips. This works really well for a cellphone but I do wonder how much functionality it is going to have for more high end activities. Sure you may be able to edit a word document etc, but what about being able to do some coding, or playing a game. In those realms I think that a full desktop environment will still be a lot better.
  • It is free. Well being open source and based off linux they really didn’t have much more of a choice. Having said that it really gives Microsoft a kick up the pants with the cost of Windows even at OEM price being really expensive.
  • The number of companies involved: Acer, Adobe, ASUS, Freescale, Hewlett-Packard, Lenovo, Qualcomm, Texas Instruments, and Toshiba. This shows that it has some major industry support and the chances of success are high.

I am excited about what it can deliver, but building a web browser that gets 30 million users in 9 months is one thing. Building a operating system that can deliver a smooth user experience without bugs or issues is a whole lot harder.

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

Windows vs Linux Installation

Okay in the last week I have had to do a windows installation and a linux installation onto a laptop.

In the past the windows install would have won hands down in terms of getting everything running out of the box. But not any longer, I now think that over the last two years linux has really come of age and is just simple to use and for the most part just works.

Firstly my experiences in windows installing.

  • Insert CD rom and install OS – about 30 minutes.
  • Remove cd rom restart do end user install, about another 30 minutes.
  • Boot into windows remove norton anti virus, install avast and do a boot time scan to ensure that in the few seconds between norton and avast nothing snuck onto the system – 1 hour.
  • Download and install windows updates 10 minutes to download 1 hour to install.
  • Reboot and install firefox and thunderbird 30 minutes.

All up for a basic working machine: 3.5 hours.

Linux installation.

  • Install OS from cd rom… 20 minutes
  • Reboot do end user install 10 minutes.
  • Get wireless networking drivers working – 1 hour.
  • Download and install updates less than 30 minutes.
  • Install anti-virus… not needed it is linux.
  • Install other software… apt-get install software name… under 5 minutes per piece of software.

All up… 2 hours… an hour of which was getting drivers for a wifi card to work, and if hardware vendors properly supported linux you could have a fully functioning up to date OS in under 1 hour.

Two years ago a linux set up would have taken days because of driver problems and even dependancy problems, but now linux has really matured and unless windows can improve its security a lot then in the long run linux will just become more and more popular.

….

Now of course people are going to come back and say that windows has more security holes because more people use it so therefore it is easier to break and if linux increased in popularity more people would write viruses and try to break it too. I do think there is half a point here. However for the most part linux makes you manually do stuff where windows if sometimes just a little to smart for its own good. I placed a flash drive into my computer yesterday that had a virus on it set to autorun, lucky for me my system stopped it. However, why windows insists on letting flash drives autorun is just plain weird… so windows getting lots of viruses is as much microsoft’s slack approach to system security as is it the fault of the virus writers themselves. Then again if there wasn’t security holes in windows norton and mcaffee would be out of work so there is an economics side to viruses as well.

Wubi

Okay, now there is no excuse for any geek or anyone with a keen interest in computers to not try out linux.

For the past year and a bit I have been playing around with Virtualbox and virtualization, the major problem here however is the speed of booting, and drivers etc as it is in an emulated/simulated environment.

Enter WUBI. Wubi is an installer that allows you to install Ubuntu and Linux Mint on an NTFS partiation and use the windows boot loader so it does absolute nothing to windows at all. And to make matters better you can access your windows files straight out of the box.

I have now had a WUBI Ubunutu set up for the past week and it is brilliant.

I am now trying a new distro called Linux Mint which is aimed at end users.

If you want some help getting it installed or just want to try it out just contact me, it is brilliant just really awesome.