Grub rescue prompt after updating ubuntu 10.04

Asked by peter

Please help: I am not very technical.

I created a dual boot Ubuntu using Windows Installer (Wubi). I had Windows XP running on my internal HDD and Ubuntu on a Drive Bay slot drive in my laptop. All running fine until I did a update. It installed the updates, inc GRUB and rebooted. Now I'm in trouble because I cant boot either OS. When I start the laptop it goes to
Error: no such device: xxxxx-xxxxx-xxxxx-xxxxxxxxxx
grub rescue>

I can boot up a Ubuntu from my USB stick and can se my drives and data ok. I just think that the MBR is screwed but I dont know how to get it back..

Please help, I know little about boot records etc etc..

I tried a Windows recovery disk, but that gives me a blue screen. Can I just fix the MBR so it gives me the OS list again?

Question information

Language:
English Edit question
Status:
Solved
For:
Wubi Edit question
Assignee:
No assignee Edit question
Solved by:
peter
Solved:
Last query:
Last reply:
Revision history for this message
peter (pete-webster-btinternet) said :
#1

To add: I tried to restore the Grub bootloader as per 1st part of this post:
http://ubuntuforums.org/showthread.php?t=1014708
 but doesnt seem to help.

fdisk -l output is: (sda = my winXP HDD, sdc = the Ubuntu drive bay disk)
Disk /dev/sda: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xfe0c6372

   Device Boot Start End Blocks Id System
/dev/sda1 * 1 5222 41945683+ 7 HPFS/NTFS
/dev/sda2 5223 5810 4723110 c W95 FAT32 (LBA)
/dev/sda3 5811 14593 70549447+ f W95 Ext'd (LBA)
/dev/sda5 5811 14593 70549416 7 HPFS/NTFS

Disk /dev/sdb: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000d85d6

   Device Boot Start End Blocks Id System
/dev/sdb1 1 1245 9999360 b W95 FAT32
/dev/sdb2 * 1245 2550 10482491 c W95 FAT32 (LBA)

Disk /dev/sdc: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x17ea2f28

   Device Boot Start End Blocks Id System
/dev/sdc1 1 9729 78148161 7 HPFS/NTFS

Revision history for this message
PeterPall (peterpall) said :
#2

I think you can try the super-grub2-disk (http://www.supergrubdisk.org/wiki/SuperGRUB2Disk) - or follow the instructions that are given here: https://help.ubuntu.com/community/RecoveringUbuntuAfterInstallingWindows
Your problem seems to be caused by a different thing, but --- the solution should be the same.

My standard personal standard solution to this problem is:
 - Try to somehow get into the system you have installed. Either by managing to start it e.G. the Super-grub2-CD or a live system or by chrooting into it, which means: By starting a different Linux e.G. from a CD and then telling this system using the chroot command that the topmost directory ("/") now is the topmost directory of the Ubuntu installation I want to rescue.
 - Once you have managed to get the system on your hard disk running by whatever means simply open a terminal and type:
sudo grub-install
 - Now grub is installed again and should therefore again work like magic.

Revision history for this message
jorge_mantilla (jennyfreizam) said :
#3

Hi, I am Ecuatorian and my english is not so good, but i had the same problem and I undestood.
if you have the prompt of grub rescue you can try this:

1. ls
2. set prefix=(hdX,Y)/boot/grub
3*. set root=(hdX,Y)
4. set
5. ls /boot
6. insmod /boot/grub/linux.mod
7*. linux /vmlinuz root=/dev/sdXY ro
8. initrd /initrd.img
9. boot

* For Wubi installs (within Windows) only substitute these commands in Steps 3 and 7:

set root=(loop0)
linux /vmlinuz root=/dev/sdXY loop=/ubuntu/disks/root.disk ro

Ok, the X and Y you must substitute for your data of HD.

You can find this info in the:

https://help.ubuntu.com/community/Grub2

section: Rescue Mode

I hope that you can fix your problem.

Revision history for this message
peter (pete-webster-btinternet) said :
#4

Peter - Thanks for your help:
Firstly, when I try to run: sudo grub-install --root-directory=/media/Drivebay /dev/sda
I get: "/media/Drivebay/boot/grub/stage1 not read correctly" - Not sure what this means? Several key files dont seem to be present (eg grub.cfg) in the /media/Drivebay/boot/grub dir.

I try to chroot and get operation not permitted and no such file if I do it from root.

Super grub 2 disk looks interesting but I need the CD bay for the extra drive I have ubuntu installed on so cant run grub2disk util from a CD and have the drive bay disk in at the same time: Do you know if you can run this from a bootable USB stick? Tried a USB iso util but it didnt work.

I notice in the Disk Utility that my internal HDD 'Partition Flags' field is set to bootable but blank for the Dravebay disk and both have the 'Partitioning' field set to Master Boot Record (if that at all relevant?)

Revision history for this message
peter (pete-webster-btinternet) said :
#5

Interestingly the SuperGrub2Disk > 'Detect any OS' menu item does recognise the Windows NT/XP loader and when i select that the Windows bootloader with XP or Ubuntu comes up. This gives me a workaround to get to Windows..

When I select ubuntu I get a
GRUB version 1.98-1ubuntu5 screen and a "grub>" prompt
(I wont be able to run ubuntu anyway while the Grub2Disk is in the CD drive because I need to swap this to put in the drive bay disk drive with Ubuntu on it)

Thanks again, for any help...

Pete

Revision history for this message
marcobra (Marco Braida) (marcobra) said :
#6

Please try reinstall grub2 on your hard-disk https://help.ubuntu.com/community/Grub2

Revision history for this message
marcobra (Marco Braida) (marcobra) said :
#7

Please try to reinstall grub2 using the Ubuntu live cd... https://help.ubuntu.com/community/Grub2#Reinstalling GRUB 2

Revision history for this message
bcbc (bcbc) said :
#8

You need to reinstall the windows bootloader, not the grub bootloader, because it's a wubi install. See this bug report: https://bugs.launchpad.net/wubi/+bug/610898

I assume - hope by now - you've found the fix. If you are having problems still and can't boot your windows recovery, you can also install an equivalent bootloader from the live CD:

sudo apt-get install lilo
(ignore the warnings you get, you are using it to boot windows, not linux)
sudo lilo -M /dev/sda mbr

This will install a bootloader that acts just like the windows bootloader - it boots the partition marked active. Then you'll see your windows boot manager with "Windows" and "Ubuntu". Both of these should work normally as before.

Revision history for this message
peter (pete-webster-btinternet) said :
#9

Turns out that somehow (I dont know how) the partition that I usually boot from wasn't marked as bootable... God knows how that happened but also the update of GRUB was deceiving for non techie. Turns out i ended up installing it which is the default recommended on the update but actually i didn't want to because Id used wubi.. Big old pain in the ass this caused... but Im ok now... Learnt a lot about disks and boot partitions tho ;-)

Thanks all for your helpful advice.