SimpleRecoveryAfterWindowsInstall

  • Launchpad Entry:

  • Created: 2010-08-19

  • Contributors: Jordan Uggla

  • Packages affected: grub2

Summary

This specification proposes a new option for the boot menu of the Ubuntu isos to allow booting of an installed Ubuntu system even if windows has clobbered the mbr, and a boot script that will re-install GRUB when Ubuntu is booted this way.

Release Note

With Ubuntu 11.04 you can now boot an existing Ubuntu install from the boot menu of the install CD by selecting "Boot Existing Ubuntu install (and recover GRUB)". This option will work even after a Windows install has rendered Ubuntu unbootable by overwriting the MBR, and will also cause GRUB to be re-installed so that an Ubuntu install CD is not required for future booting of Ubuntu.

Rationale

Currently it is entirely too complicated to re-install grub after installing windows, requiring advanced usage of potentially dangerous commands (selecting the wrong device for grub-install could render windows unbootable in addition to Ubuntu). See: https://help.ubuntu.com/community/RecoveringUbuntuAfterInstallingWindows

User stories

Assumptions

This specification depends on grub2 being used on the install isos and also on the installed Ubuntu system. The grub-legacy package does not store an install device and so automated recovery of grub-legacy is non-trivial. See foundations-m-cd-boot for the status of using GRUB2 for the install media.

Design

You can have subsections that better describe specific parts of the issue.

Implementation

UI Changes

A new menu entry will need to be added to the CD boot menu for this option.

Code Changes

Likely the most robust way to load an existing Ubuntu system from the CD is to load the systems /boot/grub/core.img using grub2's "multiboot" command. We can pass a parameter to the installed grub to set an environment variable like "multiboot /boot/grub/core.img grub_needs_recovery=true". You can search all drives for a /boot/grub/core.img within grub2 with something like "for grub_image in (*)/boot/grub/core.img (*)/grub/core.img do ..."

We would then need to make sure that we pass this on in the linux kernel parameters, which will require modification of /etc/grub.d/10_linux.

A new boot script will need to be added (or possibly simply an addition to the already existing /etc/init.d/grub-common) that will check for grub_needs_recovery and if true run "dpkg-reconfigure grub-pc -pcritical" or a similar command to re-run grub-install using the device(s) stored in grub-pc/install_devices and re-run update-grub (to add the new Windows install to the grub.cfg).

Migration

https://help.ubuntu.com/community/RecoveringUbuntuAfterInstallingWindows will need to be updated.

Test/Demo Plan

It's important that we are able to test new features, and demonstrate them to users. Use this section to describe a short plan that anybody can follow that demonstrates the feature is working. This can then be used during testing, and to show off after release. Please add an entry to http://testcases.qa.ubuntu.com/Coverage/NewFeatures for tracking test coverage.

This need not be added or completed until the specification is nearing beta.

Unresolved issues

This should highlight any issues that should be addressed in further specifications, and not problems with the specification itself; since any specification with problems cannot be approved.

BoF agenda and discussion

Use this section to take notes during the BoF; if you keep it in the approved spec, use it for summarising what was discussed and note any options that were rejected.


CategorySpec

SimpleRecoveryAfterWindowsInstall (last edited 2010-08-19 23:59:48 by adsl-76-254-19-98)