lucid to precise to trusty upgrade may leave system unbootable
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
| grub2 (Ubuntu) |
High
|
Unassigned | ||
| Trusty |
High
|
Unassigned |
Bug Description
A system, initially installed on 10.04 Lucid then upgraded to 12.04 precise, when upgraded to Trusty may not reboot following the end of the do-release-upgrade command.
Reproduction steps
==================
Install a VM with 10.04.4-server ISO. When booted in 10.04, issue :
$ sudo do-release-upgrade # to 12.04 precise
Then let the system upgrade and reboot.
$ sudo do-release-upgrade # to 14.04 trusty
Then let the system upgrade and reboot
Upon reboot, the system will display a blank screen with a prompt and will not reboot.
Workaround
==========
Force a reconfiguration of the grub-pc package :
$ sudo dpkg-reconfigure grub-pc
Changed in grub2 (Ubuntu): | |
status: | New → Confirmed |
importance: | Undecided → High |
description: | updated |
Changed in grub2 (Ubuntu): | |
assignee: | nobody → Louis Bouchard (louis-bouchard) |
Bryan Quigley (bryanquigley) wrote : | #1 |
Louis Bouchard (louis) wrote : | #2 |
Well, it looks like the culprit could pretty well be a wrong setting of the grub-pc/
Checking each context I find :
Lucid (initial) : grub-pc/
Lucid (post reconf) : grub-pc/
Whereas on a frech Precise install we have :
* grub-pc/
grub-
When upgrading from Lucid, the debconf values are wrong since even if grub has been installed, the debconf values do not reflect this so the first stage is not reinstalled, hence the failed boot.
description: | updated |
Louis Bouchard (louis) wrote : | #3 |
I have the feeling that this portion of the grub-pc.postinst script is causing the issue :
db_get grub-pc/
if [ -z "$RET" ]; then
# Reset the seen flag if the current answer is false, since
# otherwise we'll loop with no indication of why.
if [ "$RET" = false ]; then
fi
if db_input critical grub-pc/
if [ "$RET" = true ]; then
fi
else
fi
else
break
fi
Here is the debug log of a normal (i.e. failed) update :
debconf (developer): starting /var/lib/
...
debconf (developer): <-- INPUT high grub-pc/
debconf (developer): --> 30 question skipped
debconf (developer): <-- GO
debconf (developer): --> 0 ok
debconf (developer): <-- GET grub-pc/
debconf (developer): --> 0
debconf (developer): <-- GET grub-pc/
debconf (developer): --> 0
debconf (developer): <-- GET grub-pc/
debconf (developer): --> 0 true
debconf (developer): <-- INPUT critical grub-pc/
debconf (developer): --> 30 question skipped
When install_
When changing install_
debconf (developer): starting /var/lib/
....
debconf (developer): <-- INPUT high grub-pc/
debconf (developer): --> 30 question skipped
debconf (developer): <-- GO
debconf (developer): --> 0 ok
debconf (developer): <-- GET grub-pc/
debconf (developer): --> 0
debconf (developer): <-- GET grub-pc/
debconf (developer): --> 0
debconf (developer): <-- GET grub-pc/
debconf (developer): --> 0 false
debconf (developer): <-- FSET grub-pc/
debconf (developer): --> 0 false
debconf (developer): <-- INPUT critical grub-pc/
debconf (developer): --> 0 question will be asked
debconf (developer): <-- GO
Changed in grub2 (Ubuntu): | |
status: | Confirmed → In Progress |
Changed in grub2 (Ubuntu Trusty): | |
status: | New → In Progress |
importance: | Undecided → High |
assignee: | nobody → Louis Bouchard (louis-bouchard) |
tags: | added: sts |
Louis Bouchard (louis) wrote : | #4 |
Ok, just trying to be a bit clearer for my own good :
A system upgraded from Lucid to Precise will have the following debconf setup :
* grub-pc/
grub-
* grub-pc/
grub-
grub-
Once this system will be upgraded to Trusty, it will have :
* grub-pc/
grub-
grub-
grub-
* grub-pc/
Normally, the system should have what a fresh precise system had in the previous comment :
* grub-pc/
grub-
grub-
grub-
grub-
Louis Bouchard (louis) wrote : | #5 |
First proposition of fix for discussion
Louis Bouchard (louis) wrote : | #6 |
Second proposition of fix which exclude execution of the fix if grub-pc/
tags: | added: patch |
Changed in grub2 (Ubuntu): | |
assignee: | Louis Bouchard (louis) → nobody |
Changed in grub2 (Ubuntu Trusty): | |
assignee: | Louis Bouchard (louis) → nobody |
I believe a default change is needed before this would work:
1. Install and update Lucid on a VM
2. Note output of false from `sudo debconf-show grub-pc | grep empty
3. Run "sudo dpkg-reconfigure grub-pc". Note how it doesn't let you Select No. (looks to be bug 580408)
4. Note how _empty is now true.
5. Upgrade to 12.04.
6. During upgrade if _empty is set to true no grub prompt loads. If a prompt does load, selecting to not install grub will be equivalent for the next breakage.
7. Upgrade to 14.04 and reboot. Note how it doesn't ask you any questions at all about Grub.
8. Find blinking cursor and broken grub.