Sunday, February 17, 2019

grub2 - Stuck in grub rescue after Windows install

I used to have a dual boot between Ubuntu (lucid) and Windows 7, but wanted to upgrade my Windows to 64 bit, so I installed the new Windows, which naturally wrote over the MBR, and so I attempted to repair it using the following guide: https://help.ubuntu.com/community/Grub2#Reinstalling%20GRUB%202.


I had a lot of trouble following it, but managed to get the system to boot to some grub command line, instead of Windows, which I thought was useful. Then I did something screwy and now when I boot I get a grub rescue command line.


So I follow the instructions on that same page related to rescue mode, but am a bit confused. If I do ls, I get:



(hd0) (hd0,msdos1) (hd1) (hd1,msdos5) (hd1,msdos1)



If I attempt to list the contents of these partitions, the only one that works is (hd1,msdos1), all of the others say "unknown filesystem." Examining the contents of this partition, it appears to contain my Ubuntu home directory.


In any case, I found some combination of commands that do something:


set prefix=(hd1,msdos1)/boot/grub
set root=(hd1,msdos1)
insmod /boot/grub/linux.mod
linux /vmlinuz root=/dev/sdb1 ro
initrd /initrd.img
boot

It then looks like it's going to work, but I find myself in some kind of prompt which calls itself busybox initramfs. I try various things, but can't figure out how to run the command update-grub as recommended.

No comments:

Post a Comment

11.10 - Can't boot from USB after installing Ubuntu

I bought a Samsung series 5 notebook and a very strange thing happened: I installed Ubuntu 11.10 from a usb pen drive but when I restarted (...