Karmic: legacy grub-install fails, possibly due to missing /target/etc/mtab

Bug #465231 reported by Daniel Richard G.
50
This bug affects 11 people
Affects Status Importance Assigned to Milestone
grub-installer (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

Binary package hint: debian-installer

Encountered this using the Karmic alternate installer (specifically, netboot via PXE). Same failure mode on both i386 and amd64.

After confirming whether to install GRUB on the MBR, the installer indicates "Executing 'grub-install (hd0)' failed. This is a fatal error."

The log on tty4 shows some "cannot read table of mounted file systems" warnings, suggesting that grub-install(8) is failing due to a missing /etc/mtab file (inside the /target chroot).

See the attached screenshots to see what I'm seeing.

Revision history for this message
Daniel Richard G. (skunk) wrote :
Revision history for this message
Daniel Richard G. (skunk) wrote :
Revision history for this message
Daniel Richard G. (skunk) wrote :

A workaround for this bug:

1. Start up a shell on tty2 or tty3

2. "cp /etc/mtab /target/etc/"

3. Edit the newly-created /target/etc/mtab file: Delete all lines except the one specifying the device for /target (note: *not* the "tmpfs /target/dev" line), and then change "/target" to "/".

4. At the fatal-error dialog, select <Go Back>, return to the "Install the GRUB boot loader on a hard disk" item in the main menu, and go through the install process again. It should work this time.

(This appears to confirm that an absent /target/etc/mtab file is the problem.)

Revision history for this message
Jim C (pad+lp) wrote :

Encountered the same problem using expert mode install with 9.10 Server Edition (ubuntu-9.10-server-amd64.iso).

The following workaround, immediately prior to running the GRUB install step, solved the problem.

  - open shell
  - mkdir /boot
  - mount -t ext2 /dev/sda5 /boot
  - cp /etc/mtab /target/etc/mtab

GRUB installed cleanly and the system rebooted without issue.

Revision history for this message
Daniel Richard G. (skunk) wrote :

A note for those needing a workaround: Both mine and Jim's make some assumptions about how the disk has been partitioned. I assume that /boot is *not* on its own partition, and Jim assumes that it is (and that it is formatted as ext2, on /dev/sda5---adjust accordingly).

I'd be a bit careful with your approach, Jim. Isn't the filesystem already mounted on /target/boot when it comes time to install GRUB? (Actually mounting it seems a bit much, too, since all you really need is the appropriate line in /etc/mtab to put in /target/etc/mtab.)

Colin Watson (cjwatson)
affects: debian-installer (Ubuntu) → grub-installer (Ubuntu)
Revision history for this message
Mike Perry (mike.perry) wrote :

I can confirm this bug, and I can confirm that Daniel's work around is valid. I'd also like to note that the only part of the /target/etc/mtab that is needed is the line contain the root file system, or the line containing the /boot file system (if applicable).

In my case I was using the 9.10 server install cd on a amd64 virtual kvm instance. This is always reproducible when using expert mode, and install legacy grub, and having 2 partitions (sda1 - swap, sda2 - root). File systems and valid partitioning schemes seem irrelevant, however I can't say I have tested all possible cases.

~Mike

Revision history for this message
Noel J. Bergman (noeljb) wrote :

I believe that I'm running into this bug attempting install Ubuntu Studio Karmic/9.10. I did not run into this problem whem installing from the normal alternate installs for Karmic and Lucid (I need to use them in expert mode because I do not want to use GRUB 2 at this time); only when attempting to install Ubuntu Studio.

Changed in grub-installer (Ubuntu):
status: New → Confirmed
Revision history for this message
Noel J. Bergman (noeljb) wrote :

The workaround of populating a /target/etc/fstab for the / partition from tty2 right before the GRUB install resolved it for me.

Revision history for this message
felipe valenzuela (fvp-1977) wrote :

Sorry guys but I'm a beginner. I was trying to install Ubuntu 12.04 LTS (from pendrive bootable files) and when the process was ending it gives me this warning about the "grub-installer". Can you tell me step by step what to do do to solve it?

Revision history for this message
Daniel Richard G. (skunk) wrote :

Karmic is no longer supported, and I'm not aware of this bug affecting newer releases.

Felipe, I would suggest asking for help at ubuntuforums.org; this bug report isn't the right place.

Changed in grub-installer (Ubuntu):
status: Confirmed → Invalid
Revision history for this message
felipe valenzuela (fvp-1977) wrote : RE: [Bug 465231] Re: Karmic: legacy grub-install fails, possibly due to missing /target/etc/mtab

Guanos a lot!

> Date: Tue, 15 May 2012 16:52:20 +0000
> From: <email address hidden>
> To: <email address hidden>
> Subject: [Bug 465231] Re: Karmic: legacy grub-install fails, possibly due to missing /target/etc/mtab
>
> Karmic is no longer supported, and I'm not aware of this bug affecting
> newer releases.
>
> Felipe, I would suggest asking for help at ubuntuforums.org; this bug
> report isn't the right place.
>
> ** Changed in: grub-installer (Ubuntu)
> Status: Confirmed => Invalid
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/465231
>
> Title:
> Karmic: legacy grub-install fails, possibly due to missing
> /target/etc/mtab
>
> Status in “grub-installer” package in Ubuntu:
> Invalid
>
> Bug description:
> Binary package hint: debian-installer
>
> Encountered this using the Karmic alternate installer (specifically,
> netboot via PXE). Same failure mode on both i386 and amd64.
>
> After confirming whether to install GRUB on the MBR, the installer
> indicates "Executing 'grub-install (hd0)' failed. This is a fatal
> error."
>
> The log on tty4 shows some "cannot read table of mounted file systems"
> warnings, suggesting that grub-install(8) is failing due to a missing
> /etc/mtab file (inside the /target chroot).
>
> See the attached screenshots to see what I'm seeing.
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/ubuntu/+source/grub-installer/+bug/465231/+subscriptions

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.