
If you ever find yourself unable to boot into your Ubuntu OS, have grub legacy installed and only get the grub command – try this fix to resolve.
Normally, you can follow the How to’s on the Ubuntu Help pages. But if your setup is strange, i.e you have multiple drives and partitions – Grub can lose where your Linux installation lives.
Trying the conventional methods can land you in initramfs command.
Load your Ubuntu Live CD and download the following script: boot_info_script055.sh
http://sourceforge.net/projects/bootinfoscript/
Open up a terminal and type:
cd Desktop
sudo bash boot_info_script055.sh
A txt file will be created on your Desktop called Results.txt
Open this file and locate your linux partition.
Drive: sdb ___________________ _____________________________________________________ Disk /dev/sdb: 250.0 GB, 250059350016 bytes 255 heads, 63 sectors/track, 30401 cylinders, total 488397168 sectors Units = sectors of 1 * 512 = 512 bytes Disk identifier: 0x844b844b Partition Boot Start End Size Id System /dev/sdb2 16,065 488,392,064 488,376,000 f W95 Ext d (LBA) /dev/sdb5 16,128 5,381,774 5,365,647 83 Linux /dev/sdb6 5,381,838 485,420,039 480,038,202 83 Linux /dev/sdb7 485,420,103 488,392,064 2,971,962 82 Linux swap / Solaris
Note that you must be familiar with your partitioning. For me, Ubuntu is installed on the largest partition. I make a note of /dev/sdb6.
Reboot back to your grub command and follow these steps:
find /boot/grub/stage1
You will be given a result, something like (hd0,0) for me it was (hd0,5)- do the following with it in the command:
root (hd0,5)
Next type, for your (hd*)
setup (hd0)
You will be given a set of completed actions. Then load your kernel + the hd as follows:
kernel /boot/vmlinuz-2.6.31-20-generic root=/dev/sdb6 ro splash
The above kernel will be specific to you of course. Best thing to do is type ‘vmlinuz’ and then hit tab for a list of available kernels, and use your most recent. Make sure root= the info you got from Results.txt earlier
initrd /boot/initrd.img-2.6.31-20-generic
Finally type:
boot
This should get you into your OS. Now we need to edit this into grubs menu.lst.
Open a terminal and launch nautilus:
gksu nautilus
Navigate to your Primary Drive (note that just simply clicking File System will take you to the Live CD File System which is not where you need to be) and find /boot/grub/menu.lst
Double click to open and edit. At the bottom of the file type in the following: Use this as a guide only. You will need to enter your own details.
## ## End Default Options ##
title Ubuntu 9.**
root (hd0,5)
kernel /boot/vmlinuz-2.6.31-20-generic root=/dev/sdb6
initrd /boot/initrd.img-2.6.31-20-generic
### END DEBIAN AUTOMAGIC KERNELS LIST
Save the file and reboot to test. At this point you won’t have a splash – so you can edit this back in later. At least your computer is booting again!!!
Related posts:
Excellent news! At least it’s a workaround for now! Time for a fresh install when 10.4 comes out!