configuring grub-pc

Asked by Roy Lowrance

I am upgrading from the .8 kernel to the .10 kernel after having freshly installed 11.04 with the .8 kernel.

At the end of the upgrade process (which was a partial upgrade for some reason), I am asked which devices I'd like grup-install to be automatically run for. My choices are
/dev/sda (this is the drive I want to boot from and where the root directory should bw)
-/dev/sda2 (a partition on sda, formatted as ext4)
/dev/sdb (this is an extra drive in the system that I don't want to use)

When I installed, I had formatted /dev/sda as
/dev/sda1 an efi partition
/dev/sda2 as ext4 and said to put / on it

If I select none of the devices, the next panel in the install allows me to continue without installing GRUB and warns that if I do so, the boot loader may not be properly configured. It suggests that I install GRUB somewhere.

I decided to intall on /dev/sda. On the restart, the system presents a text console and freezes, not restarting. The last line of the console is CR2: <some address>.

I powered off and powered on, and I get not the normal Ubuntu startup, but a console displaying
error: invalid arch independent ELF magic
grub rescue>

What are the correct choices for in this situation?

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu grub2 Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Eliah Kagan (degeneracypressure) said :
#1

/dev/sda is the correct choice in your situation.

To fix this problem: http://www.webtechquery.com/index.php/2010/04/install-grub2-from-live-cd/

Revision history for this message
Roy Lowrance (roy-lowrance) said :
#2

Thanks Eliah but I ran into problems and found that the web page you
reference is probably out of date. On my system, one needs to create the
/mnt/dev and /mnt/proc directories before using them as mount points.

Below is a transcript of my session.

ubuntu@ubuntu:~$ sudo fdisk -l

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 19458 156290903+ ee GPT

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

Disk /dev/sdb: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 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/sdb1 1 121602 976762583+ ee GPT

# must create the directories befor mounting them
ubuntu@ubuntu:~$ sudo mkdir /mnt/dev
ubuntu@ubuntu:~$ sudo mount --bind /dev /mnt/dev
ubuntu@ubuntu:~$ sudo mkdir /mnt/proc
ubuntu@ubuntu:~$ sudo mount --bind /proc /mnt/proc

ubuntu@ubuntu:~$ sudo chroot /mnt
chroot: failed to run command `/bin/bash': No such file or directory

# /bin/bash is present
ubuntu@ubuntu:$ ls /bin/bash
/bin/bash

# nonetheless, try to install grub
ubuntu@ubuntu:/$ grub-install /dev/sda
cp: cannot create regular file `/boot/grub/915resolution.mod': Permission
denied
ubuntu@ubuntu:/$ sudo grub-install /dev/sda
/usr/sbin/grub-probe: error: cannot stat `aufs'.

Any suggestions?

- Roy

On Mon, Jul 25, 2011 at 10:45 AM, Eliah Kagan <
<email address hidden>> wrote:

> Your question #165881 on grub2 in Ubuntu changed:
> https://answers.launchpad.net/ubuntu/+source/grub2/+question/165881
>
> Status: Open => Answered
>
> Eliah Kagan proposed the following answer:
> /dev/sda is the correct choice in your situation.
>
> To fix this problem: http://www.webtechquery.com/index.php/2010/04
> /install-grub2-from-live-cd/
>
> --
> If this answers your question, please go to the following page to let us
> know that it is solved:
>
> https://answers.launchpad.net/ubuntu/+source/grub2/+question/165881/+confirm?answer_id=0
>
> If you still need help, you can reply to this email or go to the
> following page to enter your feedback:
> https://answers.launchpad.net/ubuntu/+source/grub2/+question/165881
>
> You received this question notification because you asked the question.
>

--
Roy Lowrance
home: 212 674 9777
mobile: 347 255 2544

Revision history for this message
Eliah Kagan (degeneracypressure) said :
#3

You should not ever have to create /mnt/dev or /mnt/proc while performing this procedure. Your Ubuntu partition--which itself already contains the necessary dev and proc directories--should be mounted on /mnt before you try to mount anything on /mnt/dev or /mnt/proc. (It seems you neglected to run "sudo mount /dev/sda1 /mnt" first.)

Go ahead and reboot, and start over again. Make sure to run "sudo mount /dev/sda1 /mnt" this time, as directed by http://www.webtechquery.com/index.php/2010/04/install-grub2-from-live-cd/.

Revision history for this message
Roy Lowrance (roy-lowrance) said :
#4

I got further but am still having problems.

Here is the terminal session:

ubuntu@ubuntu:~$ sudo fdisk -l

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 19458 156290903+ ee GPT

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

Disk /dev/sdb: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 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/sdb1 1 121602 976762583+ ee GPT
ubuntu@ubuntu:~$
ubuntu@ubuntu:~$
ubuntu@ubuntu:~$ sudo mount /dev/sda1 /mnt
ubuntu@ubuntu:~$ sudo mount --bind /dev /mnt/dev
ubuntu@ubuntu:~$ sudo mount --bind /proc /mnt/proc
ubuntu@ubuntu:~$
ubuntu@ubuntu:~$
ubuntu@ubuntu:~$ sudo chroot /mnt
chroot: failed to run command `/bin/bash': No such file or directory
ubuntu@ubuntu:~$ ls /bin/bash
/bin/bash

What should I try next? Thanks, Roy

On Mon, Jul 25, 2011 at 1:06 PM, Eliah Kagan <
<email address hidden>> wrote:

> Your question #165881 on grub2 in Ubuntu changed:
> https://answers.launchpad.net/ubuntu/+source/grub2/+question/165881
>
> Status: Open => Answered
>
> Eliah Kagan proposed the following answer:
> You should not ever have to create /mnt/dev or /mnt/proc while
> performing this procedure. Your Ubuntu partition--which itself already
> contains the necessary dev and proc directories--should be mounted on
> /mnt before you try to mount anything on /mnt/dev or /mnt/proc. (It
> seems you neglected to run "sudo mount /dev/sda1 /mnt" first.)
>
> Go ahead and reboot, and start over again. Make sure to run "sudo mount
> /dev/sda1 /mnt" this time, as directed by
> http://www.webtechquery.com/index.php/2010/04/install-grub2-from-live-
> cd/.
>
> --
> If this answers your question, please go to the following page to let us
> know that it is solved:
>
> https://answers.launchpad.net/ubuntu/+source/grub2/+question/165881/+confirm?answer_id=2
>
> If you still need help, you can reply to this email or go to the
> following page to enter your feedback:
> https://answers.launchpad.net/ubuntu/+source/grub2/+question/165881
>
> You received this question notification because you asked the question.
>

--
Roy Lowrance
home: 212 674 9777
mobile: 347 255 2544

Revision history for this message
Eliah Kagan (degeneracypressure) said :
#5

Please run this command and post the output here:

ls -l /mnt /mnt/bin

(-l is lower-case -L, not upper-case -i)

Revision history for this message
Roy Lowrance (roy-lowrance) said :
#6

Thanks for helping with this. I ran out of time, so I deleted all the
partitions on my drive and reinstalled.

On Mon, Jul 25, 2011 at 6:31 PM, Eliah Kagan <
<email address hidden>> wrote:

> Your question #165881 on grub2 in Ubuntu changed:
> https://answers.launchpad.net/ubuntu/+source/grub2/+question/165881
>
> Status: Open => Needs information
>
> Eliah Kagan requested more information:
> Please run this command and post the output here:
>
> ls -l /mnt /mnt/bin
>
> (-l is lower-case -L, not upper-case -i)
>
> --
> To answer this request for more information, you can either reply to
> this email or enter your reply at the following page:
> https://answers.launchpad.net/ubuntu/+source/grub2/+question/165881
>
> You received this question notification because you asked the question.
>

--
Roy Lowrance
home: 212 674 9777
mobile: 347 255 2544

Revision history for this message
Eliah Kagan (degeneracypressure) said :
#7

If this is now resolved (i.e., if you no longer want/need help with this problem), then please mark this question as Solved. (You can do that at https://answers.launchpad.net/ubuntu/+source/grub2/+question/165881.)

Can you help with this problem?

Provide an answer of your own, or ask Roy Lowrance for more information if necessary.

To post a message you must log in.