PDA

View Full Version : [ubuntu] 11.04 upgrade, wrong Grub config - stuck on CLI 'GNU grub 1.97 beta 4'



sophy_m
April 29th, 2011, 01:50 PM
Hello,

When I upgraded to 11.04 it looks like i picked the wrong option when prompted about the grub configuration! I selected keep installed grub, and now I only get 'GNU Grub 1.97~beta4' bash:grub> CLI when I start up. I've tried all the instructions here:

https://help.ubuntu.com/community/Grub2#Rescue%20Mode

but then when I type 'boot' and hit enter, it just reboots to the same screen again! :confused: So frustrating. Can anyone help?!

Update: I did an install from a CD, hoping that this would solve the problem - but the same thing still happens! Seems like it's booting to an old version of GRUB that's installed in one of my many and unnecessary partitions. Alas I'm not CLI-savvy enough to be able to fix this. Fortunately I have 2 hard drives, and by booting from the other one I can now get an old version of 9.04 running (just about!) from that. I'm starting to consider backing up my files and just wiping the whole thing...

ghostborg
April 29th, 2011, 03:18 PM
I can't offer you any advice just consolation that I chose "Keep existing Grub configuration" too, but mine started up.

I'm sure someone here will help resolve you issue with Grub,
but if you happen to have to install again you could choose "Custom" under the partitioning section of the Installation and assign your root / and swap spaces but when you assign your Home partition to the same one you have now make sure the format box next to it is unchecked and that will leave it intact.

How I got Windows as the default in Grub:
Afterward I did use Start-up manager to select the default of Windows 7 in my dual boot system but it would keep Ubuntu as the default choice. I found a tip from a bug report that he chose the Mem test above the Windows7 loader as the default and when I did that Windows 7 was selected as the default which was the last line of choices in grub. So I am not entirely sure if that is a Grub or Start-up Manager issue.

Update:
I did go back to that machine and it has "GNU Grub version 1.99~rc1-13 ubuntu3" at the top
of the screen. I do remember after choosing "Keep existing Grub configuration" a text box with rapidly scrolling text the words about having to update grub. I'm not sure if that was just it echoing what it was doing or trying to tell me that I would have to run some command line voodoo to update grub later. So I'm not sure if I have the version that was supposed to be installed with 11.04 or some older version. I updated from 10.10 to 11.04.

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

It says 1.98 and later is Grub2 and 1.99 is installed with Natty

sophy_m
April 29th, 2011, 03:22 PM
Yes I've pretty much resigned myself to a reinstall. Just burning the disc now.

ghostborg
April 29th, 2011, 04:16 PM
Try to do the custom install and uncheck the format option on the home partition unless you already backed up what you need and just want to start completely fresh. Remember to backup or export your browser bookmarks if you need them. I sometimes forget.
Good Luck to you.

sophy_m
April 29th, 2011, 10:01 PM
Bumping with an update...

jerrycal
May 1st, 2011, 12:30 AM
I have the same problem...I tried the following but no luck...

http://aaron-kelley.net/blog/2011/04/grub-prompt-after-upgrade-to-ubuntu-11-04/

I get to the grub> prompt and when entering "boot" I get "no kernel" error.

The last kernel right before 11.04 upgrade didn't work right so I removed it and kept using the previous one. Now I'm guessing those got removed during the upgrade and I'm stuck...

I'm dual booting macbook pro and really hoping to avoid reinstalling both systems...

MAFoElffen
May 1st, 2011, 12:41 AM
The current version of Grub2 did not install. Current was GNU Grub 1.99~rc1 *sorry, didn't look this morning to check for today).

Grub will need to be reinstalled. These 2 links should help you be able to install grub from the Natty 11.04 LiveCDt:
https://help.ubuntu.com/community/Grub2
http://ubuntuforums.org/showthread.php?t=224351

jerrycal
May 1st, 2011, 03:11 AM
Thanks, but it didn't work...
sudo grub returns - command not found

MAFoElffen
May 1st, 2011, 03:22 AM
Thanks, but it didn't work...
sudo grub returns - command not found
Where did that come from?

Try from a terminal session booted from a LiveCD (from my first reference)




sudo fdisk -l
If the user isn't sure of the partition, look for one of the appropriate size or formatting. Running




sudo blkid

may provide more information to help locate the proper partition, especially if the partitions are labeled. The device/drive is designated by sdX, with X being the device designation. sda is the first device, sdb is the second, etc. For most users the MBR will be installed to sda, the first drive on their system. The partition is designated by the Y. The first partition is 1, the second is 2. Note the devices and partitions are counted differently.


Mount the partition containing the Ubuntu installation.



sudo mount /dev/sdXY /mnt
Example: sudo mount /dev/sda1 Note: If the user has a separate /boot partition, this must be mounted to /mnt/boot Note: If the user has a separate /home partition, this must be mounted to /mnt/home. Encrypted home partitions should work.

Run the grub-install command as described below. This will reinstall the GRUB 2 files on the mounted partition to the proper location and to the MBR of the designated device.


sudo grub-install --boot-directory=/mnt /dev/sdX
Example: sudo grub-install --boot-directory=/mnt /dev/sda
I editted that... new change for natty and this version of grub is "boot" instead of "root"...

jerrycal
May 1st, 2011, 05:45 AM
Where did that come from?

Try from a terminal session booted from a LiveCD (from my first reference)
I editted that... new change for natty and this version of grub is "boot" instead of "root"...


Sorry, I should have said, it came from Live CD...it said "command not found" when I ran "sudo grub".

I had to do this going from Karmic Koala to Lucid Lynx and it worked then, but not this time.

My installation is on sda4.
Running fdisk -l returns:

/dev/sda1/ GPT
/dev/sda2/ HFS / HFS+
/dev/sda3/ EFI
/dev/sda4/ LINUX

so I ran:
sudo mount /dev/sda4 /mnt
then
sudo grub-install --boot-directory=/mnt /dev/sda

it returns: "Installation Finished - No Errors Reported", however it still boots to GRUB prompt.
But this time it says that the GRUB Version is 1.99 so I guess it did install itself but still won't go pass the prompt.

drs305
May 1st, 2011, 05:52 AM
For Natty, there is a change to the grub install command switch, but it also changes the path a bit as well.

When using "--boot-directory" you have to designate the boot directory in the path, so it becomes

sudo grub-install --boot-directory=/mnt/boot /dev/sda

The old way of doing things will also work:

sudo grub-install --root-directory=/mnt /dev/sda

Yes, I know it's a bit confusing. The devs just wanted the command to more clearly point to the boot folder, with a bit more specificity in the command as to it's location.

jerrycal
May 1st, 2011, 06:12 AM
For Natty, there is a change to the grub install command switch, but it also changes the path a bit as well.

When using "--boot-directory" you have to designate the boot directory in the path, so it becomes

sudo grub-install --boot-directory=/mnt/boot /dev/sda
The old way of doing things will also work:

sudo grub-install --root-directory=/mnt /dev/sdaYes, I know it's a bit confusing. The devs just wanted the command to more clearly point to the boot folder, with a bit more specificity in the command as to it's location.


After doing that I get: "Installation Finished - No Errors Reported", however it still boots to GRUB prompt. But this time it says that the GRUB Version is 1.99 so I guess it did install itself but still won't go pass the prompt. So in the GRUB prompt I run "boot" and it returns: "no kernel found"...

srs5694
May 1st, 2011, 06:42 AM
My installation is on sda4.
Running fdisk -l returns:

/dev/sda1/ GPT
/dev/sda2/ HFS / HFS+
/dev/sda3/ EFI
/dev/sda4/ LINUX

so I ran:
sudo mount /dev/sda4 /mnt
then
sudo grub-install --boot-directory=/mnt /dev/sda

it returns: "Installation Finished - No Errors Reported", however it still boots to GRUB prompt.

Your summary of the partition table is revealing. It appears that you've probably got a GUID Partition Table (GPT) (http://en.wikipedia.org/wiki/GUID_Partition_Table) with a hybrid MBR. (http://www.rodsbooks.com/gdisk/hybrid.html) As such, fdisk output is unreliable, since fdisk reports only MBR partitions but Linux uses the GPT partitions on such disks. Hybrid MBRs are also themselves flaky and dangerous. It's conceivable that your GPT and MBR partitions aren't properly synchronized, which could account for some of the problems you're reporting.

What type of computer are you using? Is this a Mac? If so, you have the option of booting using the Mac's BIOS emulation and grub-pc, or of using native EFI mode and grub-efi. I've got a Web page on the latter option, (http://www.rodsbooks.com/ubuntu-efi/index.html) but it was written based on Ubuntu 10.10. Be aware that somebody in the Apple forum has reported that installing Ubuntu 11.04 in EFI mode bricked his Mac. (I suspect the installer trashed his EFI System Partition, but that's just a suspicion. If I'm right, though, it's the installer that did the damage, not the EFI-mode GRUB per se.)

In any event, when booting in BIOS emulation mode, you should have a BIOS Boot Partition (http://grub.enbug.org/BIOS_Boot_Partition) for best reliability, and I have no idea if you've got one. If you don't, it could be that's why it's not working. If you're booting in EFI mode, you may need GRUB files in the EFI System Partition; again, it's not clear if you've got those.

For more help, I recommend you boot the Ubuntu installer in "live CD" mode, launch a Terminal, type "sudo gdisk -l /dev/sda", and post the results here, between
and tags for legibility. Running the Boot Info Script (http://sourceforge.net/projects/bootinfoscript/) and posting the RESULTS.TXT file that it generates (also between
and tags) may also be informative.

jerrycal
May 1st, 2011, 06:43 PM
Your summary of the partition table is revealing. It appears that you've probably got a GUID Partition Table (GPT) (http://en.wikipedia.org/wiki/GUID_Partition_Table) with a hybrid MBR. (http://www.rodsbooks.com/gdisk/hybrid.html) As such, fdisk output is unreliable, since fdisk reports only MBR partitions but Linux uses the GPT partitions on such disks. Hybrid MBRs are also themselves flaky and dangerous. It's conceivable that your GPT and MBR partitions aren't properly synchronized, which could account for some of the problems you're reporting.

What type of computer are you using? Is this a Mac? If so, you have the option of booting using the Mac's BIOS emulation and grub-pc, or of using native EFI mode and grub-efi. I've got a Web page on the latter option, (http://www.rodsbooks.com/ubuntu-efi/index.html) but it was written based on Ubuntu 10.10. Be aware that somebody in the Apple forum has reported that installing Ubuntu 11.04 in EFI mode bricked his Mac. (I suspect the installer trashed his EFI System Partition, but that's just a suspicion. If I'm right, though, it's the installer that did the damage, not the EFI-mode GRUB per se.)

In any event, when booting in BIOS emulation mode, you should have a BIOS Boot Partition (http://grub.enbug.org/BIOS_Boot_Partition) for best reliability, and I have no idea if you've got one. If you don't, it could be that's why it's not working. If you're booting in EFI mode, you may need GRUB files in the EFI System Partition; again, it's not clear if you've got those.

For more help, I recommend you boot the Ubuntu installer in "live CD" mode, launch a Terminal, type "sudo gdisk -l /dev/sda", and post the results here, between
and tags for legibility. Running the Boot Info Script (http://sourceforge.net/projects/bootinfoscript/) and posting the RESULTS.TXT file that it generates (also between
and tags) may also be informative.


Yes, it is MacBook Pro 5,5. I think it's EFI Mode. I used these instructions to install it https://help.ubuntu.com/community/MactelSupportTeam/AppleIntelInstallation

sudo fdisk -l /dev/sda returns:

WARNING: GPT (GUID Partition Table) detected on '/dev/sda'! The util fdisk doesn't support GPT. Use GNU Parted.


Disk /dev/sda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 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: 0x00000000

Device Boot Start End Blocks Id System
/dev/sda1 1 26 204819+ ee GPT
/dev/sda2 26 9734 77977496 af HFS / HFS+
/dev/sda3 * 9734 9734 977 ef EFI (FAT-12/16/32)
/dev/sda4 9734 19056 74880859+ 83 Linux
ubuntu@ubuntu:~$

Attaching the Boot Info Script as well...

Thank you for looking into it...

mjen4
May 2nd, 2011, 04:34 AM
hello all--

i have the same problem, only none of these commands are working for me.

maybe i'm missing something trivial, but no "sudo" "mount" "fdisk" etc commands are recognized by the Grub CLI.

all return "unknown command"

also the Grub version is 1.97 beta4

can anyone shed any light on this for me?
thanks

jerrycal
May 2nd, 2011, 04:45 AM
hello all--

i have the same problem, only none of these commands are working for me.

maybe i'm missing something trivial, but no "sudo" "mount" "fdisk" etc commands are recognized by the Grub CLI.

all return "unknown command"

also the Grub version is 1.97 beta4

can anyone shed any light on this for me?
thanks

Those above mentioned commands are ran from terminal in Ubuntu Live CD...not in GRUB CLI...
Commands for GRUB CLI are here: Scroll to "Using CLI to boot"
https://help.ubuntu.com/community/Grub2

srs5694
May 2nd, 2011, 05:57 AM
hello all--

i have the same problem, only none of these commands are working for me.

maybe i'm missing something trivial, but no "sudo" "mount" "fdisk" etc commands are recognized by the Grub CLI.

all return "unknown command"

also the Grub version is 1.97 beta4

can anyone shed any light on this for me?
thanks

Please start your own thread and describe your problem as precisely as you can. Sometimes problems seem superficially similar, but are very different in reality, and trying to solve two such problems in one thread becomes very confusing.