partman should reuse existing BIOS Boot Partition

Bug #746313 reported by Chad A. Davis on 2011-03-31
16
This bug affects 2 people
Affects Status Importance Assigned to Milestone
partman-auto (Ubuntu)
High
Colin Watson
Natty
High
Colin Watson
partman-base (Ubuntu)
Undecided
Unassigned
Natty
Undecided
Unassigned
ubiquity (Ubuntu)
Undecided
Unassigned
Natty
Undecided
Unassigned

Bug Description

Binary package hint: ubiquity

On a MacBookPro (6.2) (without any OS on it), installing Ubuntu twice, with 'guided - resize' parititons option causes grub to fail to install, leaving both systems inaccessible.

TEST CASE:
First install Ubuntu using an "entire disk" install.
http://iso.qa.ubuntu.com/qatracker/result/5334/1067
This leaves a 1MB GPT partition at the beginning of the disk, a <size-of-RAM> swap at the end of the disk, and an ext4 partition filling the middle of the disk.

Then install Ubuntu again, using the 'guided - resize' partitions option.
http://testcases.qa.ubuntu.com/Install/DesktopResize
This suggests splitting the ext4 partition on sda2 about 50% and the subsequent partition table seems correct (screenshot attached).
But then:

Unable to install GRUB in /dev/sda
Executing 'grub-install /dev/sda' failed
This is a fatal error

In a terminal, I do;

sudo chroot /target; grub-install /dev/sda

This gives:
/usr/sbin/grub-probe: error: cannot find a GRUB drive for /dev/sda5. Check your device.map.
Auto-detection of a filesystem of /dev/sda5 failed.
Please report this together with the output of "/usr/sbin/grub-probe --device-map="/boot/grub/device.map" --target=fs -v /boot/grub" to <email address hidden>

The output of grub-probe is attached (from before the install, and from after the error).
It seems that I needed the device map from the live CD, which I unfortunately didn't manage to capture.

This is ubuntu-desktop-adm65+mac.iso from 2011-03-29.1 on MacBookPro6.2

grub-pc-1.99~rc1-6ubuntu1
ubiquity-2.5.32

Chad A. Davis (chadadavis) wrote :
Chad A. Davis (chadadavis) wrote :
Chad A. Davis (chadadavis) wrote :
Chad A. Davis (chadadavis) wrote :
Chad A. Davis (chadadavis) wrote :
Chad A. Davis (chadadavis) wrote :

This grub error also occurs with kubuntu-desktop install and kubuntu-alternate install.

It does not occur on amd64 when following the same steps, only on amd64+mac.

Evan (ev) on 2011-03-31
Changed in grub (Ubuntu):
importance: Undecided → High
Chad A. Davis (chadadavis) wrote :
Changed in grub (Ubuntu Natty):
status: New → Triaged
assignee: nobody → Canonical Foundations Team (canonical-foundations)
Chad A. Davis (chadadavis) wrote :

When grub fails, a dialog is presented in the current version. It provides options to install grub to another disk / partition, to cancel the install, or to continue without installing grub. It notes that the latter two options will probably result in an unbootable system. None of the options seem to be active, however. I tried each of them in turn, selecting "OK" each time. The dialog is never dismissed and the install cannot continue. The only way out was to kill ubiquity. Of course, this was after grub failed to install to /dev/sda, so the system was not bootable, as described in the original bug report.

Colin Watson (cjwatson) on 2011-04-12
affects: grub (Ubuntu Natty) → grub2 (Ubuntu Natty)
Changed in grub2 (Ubuntu Natty):
assignee: Canonical Foundations Team (canonical-foundations) → Colin Watson (cjwatson)
Colin Watson (cjwatson) wrote :

Wow, this is pretty bad. Thanks for the detailed logs.

What's happening here is that partman creates a new BIOS Boot Partition rather than reusing the existing one; and for reasons best known to itself it also changes the existing BBP to not be a BBP any more. The effect of all this monkey business is that GRUB no longer manages to recognise the disk as GPT, and things go south pretty rapidly from there.

partman really ought to reuse the existing BBP. This is sadly not entirely trivial to arrange, so I probably won't manage to do it in time for beta-2, but it should be possible.

affects: grub2 (Ubuntu Natty) → partman-partitioning (Ubuntu Natty)
summary: - grub fails in ubuntu install on mac with 'guided resize' of partitions
+ partman should reuse existing BIOS Boot Partition
Changed in ubiquity (Ubuntu Natty):
status: New → Invalid
Murphy (murphy2712+launchpad) wrote :

Hi, I just updated my (previously) working Natty on MacBook Pro and am now stuck because grub is not working anymore and it won't reinstall using a natty livecd.

Is there any manual way to revert to a working boot/BBP/grub?

Thanks.

Chad A. Davis (chadadavis) wrote :

Murphy, this bug was originally about installing two instances of Natty side-by-side. Did you have a grub error while simply upgrading a singe instance of Natty to a newer instance of Natty? It might be worth opening a new bug report in that case. If you are able to get any information from your current partition layout (by booting from a CD), that might also be useful.

Yeah, if you just upgraded and it broke then that has nothing to do with
this bug. Please file a new one.

Murphy (murphy2712+launchpad) wrote :

Sorry, I created a new one:
https://bugs.launchpad.net/ubuntu/+source/grub/+bug/759192

Thanks for any tip.

Colin Watson (cjwatson) on 2011-04-15
Changed in partman-partitioning (Ubuntu Natty):
milestone: none → ubuntu-11.04
Colin Watson (cjwatson) wrote :

I think the right answer here is to add a new internal specifier to the partman recipe format, probably something like $reusemethod{ }, which would mean "only create this partition if there is no partition with this method already".

In Oneiric, we could also use this to avoid creating multiple swap partitions.

affects: partman-partitioning (Ubuntu Natty) → partman-base (Ubuntu Natty)
Changed in partman-base (Ubuntu Natty):
milestone: ubuntu-11.04 → none
Colin Watson (cjwatson) on 2011-04-20
Changed in partman-base (Ubuntu Natty):
milestone: none → ubuntu-11.04
Changed in partman-auto (Ubuntu Natty):
status: New → Triaged
importance: Undecided → High
assignee: nobody → Colin Watson (cjwatson)
milestone: none → ubuntu-11.04
Colin Watson (cjwatson) wrote :

(Sorry for the bug task churn - trying to decide where this belongs, and I forgot that partman-auto implements recipe application logic as well as containing the recipes themselves.)

Changed in partman-base (Ubuntu Natty):
assignee: Colin Watson (cjwatson) → nobody
importance: High → Undecided
milestone: ubuntu-11.04 → none
status: Triaged → Invalid
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package partman-auto - 93ubuntu15

---------------
partman-auto (93ubuntu15) natty; urgency=low

  * Add $reusemethod internal specifier, which excludes the partition if a
    partition with the same method already exists.
  * If there is an existing BIOS Boot Partition, reuse it rather than
    creating a new one (LP: #746313).
 -- Colin Watson <email address hidden> Wed, 20 Apr 2011 17:50:59 +0100

Changed in partman-auto (Ubuntu Natty):
status: Triaged → Fix Released
Chad A. Davis (chadadavis) wrote :

Fix confirmed for ubuntu natty RC (2011-04-25) on a MacBookPro6.2

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

Duplicates of this bug

Other bug subscribers