If you had an installation of Ubuntu or Kubuntu and now it won’t load and all you are left with is something like “sh: grub>” – DON’T PANIC! It’s happened to me twice before (which caused me to create a fresh installation), but this time I took some more time to search and I found a solution.
Why did this happen? There is a good chance that Ubuntu installed some updates. One of those updates was probably to a program called Grub. This is a small program that is one of the first to run when you start your computer. It’s job is to properly load the underlying Linux operating system (which then loads the graphical usual interface you were expecting). It seems that when Grub is updated – something in it’s configuration gets messed up which is why you are frantically searching for a solution.
First, take a deep breath, you probably haven’t lost any information and you may be minutes away from having your familiar operating system restored. There are two steps to this process: (1) manually starting your operating system from within the Grub program; (2) manually reconfiguring to automatically update it’s configuration to start properly.
There is one nice feature and trick you will need to do this process. When you type in commands in the command-line, and those commands need to refer to a file, the key “tab” does an auto-complete. For example: suppose you have a file that starts with the letters “myfile…” stored in a folder called “/myfolder”. If you type “/myfolder/myfile” and then click tab it will automatically find the file and complete the rest of it’s name. If it finds more then one file – it will show you a list of options which match – and you can then manually enter it.
Step1: Manually Starting the Operating System
In this process you will need to enter numerous commands at the command line. The actual commands are marked in bold, optional commands are marked in italics, the rest of the text is complimentary comments & explanations.
NTFS is a method for organizing files on your hard drive, and we need to load a module that will be able to read it by entering:
Next we need to tell the program where the operating system can be found – this is a reference to a partition on a hard drive. If, like me, you are working with a WUBI installation (I am running Kubuntu 9.10 on a computer with one hard drive and one partition) then Ubuntu is on the first hard driver’s second partition. Numbering starts at 0 – so the first hard drive is “hd0″ and the second partition is “1” and the command you need to type is:
In any other configuration you need to figure out which hard drive and which partition contains the Ubuntu installation. You can type an ls command which will show you what hard drives and partitions are currently available.
I am not sure what these two command do, but it seems they create some kind of temporary space for the operating system to load:
loopback loop0 /ubuntu/disks/root.disk
In this next step you are going to need to use the auto-complete feature mentioned above. You will need to enter this command in two steps:
type in: linux /boot/vmlinuz
then press tab and you will probably be shown a number of options. I found “vmlinuz-2.6.31-14-generic”, “vmlinuz-2.6.31-15-generic”, “vmlinuz-2.6.31-16-generic”. I tried to the latest version, the one labeled “16”, but that didn’t work. The one labeled “15” did work for me. So you may also have to try and see what works for you. Complete the command(for example):
linux /boot/vmlinuz-2.6.31-15-generic root=/dev/sda1 loop=/ubuntu/disks/root.disk ro
Please note that “sda1″ is another way of referring to the first hard drive “a” and second partition “1” (zero is the first partition). You may need to replace this with a reference to your installed partition.
In this next step you will again be using the auto-complete feature to create a command like this:
I believe that the the numbers, which indicate a version of the linux kernel, should match those entered in the previous command.
Finally, give the command to boot the operating system (this will probably cause the screen to scroll with lots of information – which is a good sign that indicates that the system is indeed loading):
Step2: Updating the Grub Configuration
If you are experiencing relief – that’s great and it means you only have one more thing to do. This is to make sure that the next time you reboot your computer it will be able to load automatically. You will need to open a terminal window and type in the following command:
If you experience other problems you may want to continue browsing and reading this thread – which will probably continue to evolve and update as more people encounter this problem in different settings and variations. Good luck